/*
* 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
*/
/*
*/
#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>
#include "cpuboard_topo.h"
/*
* sun4v specific cpuboard enumerator
*/
#ifdef __cplusplus
extern "C" {
#endif
/* Until future PRI changes, make connection between cpuboard id and RC */
topo_instance_t, void *, void *);
{ cpuboard_enum, NULL };
TOPO_STABILITY_PRIVATE, 1 };
static void *
{
}
static void
{
}
static int
{
int cpuboards_found = 0;
return (0);
}
return (0);
}
if ((type & LDOM_TYPE_CONTROL) != 0) {
} else {
}
if (bufsize < 1) {
bufsize);
return (0);
}
cpuboard_topo_free)) == NULL ||
return (0);
}
return (0);
}
if (ncomp <= 0) {
return (0);
}
for (i = 0; i < ncomp; i++) {
/*
* PRI nodes are still named "cpu-board", but the canonical
* names are "cpuboard".
*/
"id md_get_prop_val() failed. (%d: %s)\n",
continue;
}
"id %llx out of range. (%d: %s)\n",
continue;
}
"serial_number", &sn);
"part_number", &pn);
"dash_number", &dn);
}
}
return (cpuboards_found);
}
/*ARGSUSED*/
void
{
/*
* Turn on module debugging output
*/
}
return; /* mod errno already set */
}
}
void
{
}
static tnode_t *
{
int err;
"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);
}
"cpuboard_tnode_create: topo_node_bind (%s%d/%s%d) created!\n",
/* chassis */
}
return (ntn);
}
static int
{
int err, e;
}
if (e < 0)
return (0);
}
static int
{
return (-1);
}
&err) != 0) {
}
}
return (0);
}
/*ARGSUSED*/
static tnode_t *
{
int err;
return (NULL);
}
/* set ASRU to resource fmri */
return (ntn);
}
static int
{
"Currently only know how to enumerate %s components.\n",
CPUBOARD);
return (0);
}
"Calling chip_enum for inst: %lx\n", inst);
if (topo_mod_enumerate(mod,
}
return (0);
}
static topo_mod_t *
{
"%s enumerator could not load %s enum. (%d: %s)\n",
}
return (rp);
}
static di_node_t
{
return (NULL);
}
while (dnode != DI_NODE_NIL) {
char *path;
"NULL di_devfs_path.\n");
return (NULL);
}
"got px %d, node named: %s, path: %s\n",
return (dnode);
}
}
return (NULL);
}
static void
{
int i;
if (cpuboard_list[i].present == 0)
continue;
}
}
/*ARGSUSED*/
static int
{
topo_instance_t i = 0;
"Currently only know how to enumerate %s components.\n",
CPUBOARD);
return (-1);
}
/* Make sure we don't exceed CPUBOARD_MAX */
if (max >= CPUBOARD_MAX) {
max = CPUBOARD_MAX;
}
/* Scan PRI for cpu-boards. */
int cpuboards_found = 0;
/*
* if no PRI available (i.e. not in Control Domain),
* use px driver to determine cpuboard presence.
* NOTE: with this approach there will be no
* identity information - no SN nor PN.
*/
}
}
if (cpuboards_found == 0) {
return (-1);
}
}
return (-1);
}
if (cpuboard_list[i].present == 0)
continue;
"Enumeration of cpuboard failed: %s\n",
return (-1); /* mod_errno already set */
}
CHIP_MAX) < 0) {
return (-1); /* mod_errno already set */
}
"failed %s\n",
return (-1);
}
HOSTBRIDGE_MAX) < 0) {
"HOSTBRIDGE failed: %s\n",
return (-1);
}
cpuboardn, i) < 0) {
"failed: %s\n",
return (-1);
}
}
return (0);
}