motherboard.c revision 92ba710950bf6ee35de67e1e0b7f20ec9e528106
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <fm/topo_mod.h>
#include <libdevinfo.h>
#include <limits.h>
#include <sys/systeminfo.h>
#include <assert.h>
#include <sys/systeminfo.h>
#include <fm/fmd_fmri.h>
/*
* sun4v specific motherboard enumerators
*/
#ifdef __cplusplus
extern "C" {
#endif
#define MB_VERSION TOPO_VERSION
topo_instance_t, void *, void *);
static const topo_modops_t Mb_ops =
static const topo_modinfo_t mb_info =
static const topo_pgroup_info_t mb_auth_pgroup = {
1
};
static const topo_pgroup_info_t mb_sys_pgroup = {
1
};
/*ARGSUSED*/
void
{
/*
* Turn on module debugging output
*/
return; /* mod errno already set */
}
}
void
{
}
static void *
{
}
static void
{
}
static int
{
char isa[MAXNAMELEN];
return (-1);
}
isa);
return (-1);
}
bufsize);
return (-1);
}
return (-1);
}
return (-1);
}
if (nfrus <= 0) {
return (-1);
}
for (i = 0; i < nfrus; i++) {
/* systemboard/motherboard component */
"serial_number", &sn) < 0)
"part_number", &pn) < 0)
"dash_number", &dn) < 0)
}
}
/* redefined access method for chassis serial number */
"serial_number", &csn) < 0)
}
}
}
pstr = mb_topo_alloc(i);
mb_topo_free(pstr, i);
return (0);
}
static void
{
int err;
char isa[MAXNAMELEN];
(err != ETOPO_PROP_DEFD))
return;
return;
isa[0] = '\0';
}
static tnode_t *
{
/* Get Chassis ID, MB Serial Number and Part Number from PRI */
"failed to add chassis to auth");
return (NULL);
}
}
"Unable to make nvlist for %s bind: %s.\n",
return (NULL);
}
"topo_node_bind (%s%d/%s%d) failed: %s\n",
name, i,
return (NULL);
}
return (ntn);
}
/*ARGSUSED*/
static tnode_t *
{
char *label = "MB";
int err;
return (NULL);
/* Set FRU */
return (NULL);
}
/* Label is MB */
}
return (ntn);
}
/*ARGSUSED*/
static int
{
"Currently only know how to enumerate %s components.\n",
return (0);
}
mb_mod_hdl = mod;
"failed: %s\n",
return (-1); /* mod_errno already set */
}
return (0);
}