/*
* 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
*/
/*
*/
/*
* Create Base Board (MB) topology node from SMBIOS Type 2 structure
*/
#include <strings.h>
#include <fm/topo_mod.h>
#include <sys/systeminfo.h>
#include <sys/smbios_impl.h>
#include <x86pi_impl.h>
/* base board ID counts */
/* base baoed type values to hc-canonical-name */
static const struct x86pi_bb_name {
int type;
const char *name;
} x86pi_bb_names[] = {
{ SMB_BBT_SBLADE, "systemboard" },
{ SMB_BBT_PROC, "cpuboard" },
{ SMB_BBT_IO, "ioboard" },
{ SMB_BBT_MEM, "memboard" },
{ SMB_BBT_DAUGHTER, "systemboard" },
{ SMB_BBT_MOTHER, "motherboard" },
{ SMB_BBT_PROCMEM, "systemboard" },
{ SMB_BBT_PROCIO, "systemboard" },
{ SMB_BBT_INTER, "systemboard" },
{ 0x00 }
};
tnode_t *
{
int rv;
char *f = "x86pi_gen_bboard";
return (NULL);
}
/* SMBIOS Base Board struct */
if (rv != 0) {
return (NULL);
}
return (NULL);
}
/* SMBIOS Base Board strings */
if (rv != 0) {
return (NULL);
}
/*
* populate string entries
*
* We don't set "product" because it may contain characters
* unacceptable by fmri. topo_mod_auth() will set the product-name
* for us and call topo_cleanup_auth_str() when necessary.
*/
ip.smbi_serial, 0);
/* asset tag string contains the part number */
ip.smbi_asset, 0);
LABEL);
/* determine the hc-name */
case SMB_BBT_PROC :
break;
case SMB_BBT_IO :
break;
case SMB_BBT_MEM :
break;
case SMB_BBT_MOTHER :
break;
default :
/*
* Enumerate any other baseboard type
* as systemboard.
*
* SMB_BBT_UNKNOWN
* SMB_BBT_OTHER
* SMB_BBT_SBLADE
* SMB_BBT_CSWITCH
* SMB_BBT_SMM
* SMB_BBT_DAUGHTER
* SMB_BBT_PROCMEM
* SMB_BBT_PROCIO
* SMB_BBT_INTER
*/
break;
}
break;
}
}
else
if (rv != 0) {
instance);
}
/* free up strings */
}
}
}
}
}
return (bb_node);
}
int
{
int count;
int ncmp = 0;
return (ncmp);
for (int i = 0; i < count; i++) {
ncmp++;
}
}
/*
* If there are missing SMB_TYPE_PROCESSOR structures
* contained within SMB_TYPE_BASEBOARD, and if the
* system has only one baseboard we enumerate
* all processors under it.
*/
if (nboards == 1) {
} else {
if (ncmp == 0) {
" (or) no processors are contained"
" within baseboard instance %d, unable to"
" enumerate chips\n", index);
}
}
return (ncmp);
}
{
return (top_bb_smbid);
for (int i = 0; i < ch_count; i++)
return (top_bb_smbid);
for (int i = 0; i < bb_count; i++) {
== X86PI_VISITED) {
*pnode =
node;
*psmbid =
id;
break;
}
break;
}
}
}
return (top_bb_smbid);
}
{
int rv;
return (-1);
if (rv != 0)
return (-1);
return (bb.smbb_chassis);
}
int
{
int rv;
int bb_count = 0;
return (-1);
for (int i = 0; i < bb_count; i++) {
/* SMBIOS Base Board struct */
if (rv != 0)
return (-1);
/* Set Baseboard - Chassis Relationship */
if (rv == -1) {
" the chassis handle\n");
return (rv);
}
}
/* SMBIOS contained object handles */
if (cont_cnt > 0) {
/* allocate space for and get contained handles */
sizeof (id_t));
cont_hdl);
if (rv > SMB_CONT_MAX) {
sizeof (id_t));
return (-1);
}
/* attach contained handles */
for (int j = 0; j < cont_cnt; j++) {
" %d: %d\n", i, j, hdl);
for (int k = 0; k < bb_count; k++)
if (stypes[SMB_TYPE_BASEBOARD].\
stypes[\
}
}
}
}
return (0);
}