/*
* 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 <string.h>
#include <fm/topo_mod.h>
#include <libdevinfo.h>
#include <limits.h>
#include <sys/systeminfo.h>
#include <assert.h>
#include <hostbridge.h>
#include <pcibus.h>
#include <did.h>
#include <did_props.h>
#include <util.h>
/*
* Generic code shared by all the hostbridge enumerators
*/
nvlist_t **);
topo_instance_t, void *, void *);
const char *, topo_instance_t, topo_instance_t);
extern txprop_t ExHB_common_props[];
extern txprop_t HB_common_props[];
extern txprop_t RC_common_props[];
extern int ExHB_propcnt;
extern int HB_propcnt;
extern int RC_propcnt;
topo_instance_t, topo_instance_t, void *);
{ hb_enum, hb_release };
{ NULL }
};
1
};
int
{
/*
* Turn on module debugging output
*/
if (version != HB_ENUMR_VERS)
return (-1); /* mod errno already set */
}
return (0);
}
void
{
}
static int
{
if (version > TOPO_METH_LABEL_VERSION)
}
static topo_mod_t *
{
}
return (rp);
}
/*ARGSUSED*/
static int
{
int rv;
"Currently only know how to enumerate %s components.\n",
return (0);
}
/*
* Load the pcibus enumerator
*/
return (-1);
/*
* If we're asked to enumerate a whole range of hostbridges, then
* we need to find them all. If we're just asked to enumerate a
* single hostbridge, we expect our caller to have passed us linked
* did_t structures we can use to enumerate the singled out hostbridge.
*/
if (did_hash_init(mp) < 0) {
"Hash initialization for hostbridge "
"enumerator failed.\n");
return (-1);
}
} else {
}
return (rv);
}
/*ARGSUSED*/
static 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);
}
/* chassis */
}
return (NULL);
}
return (ntn);
}
tnode_t *
{
return (NULL);
return (NULL);
return (NULL);
}
/*
* We expect to find pci buses beneath the hostbridge.
*/
return (NULL);
}
return (ntn);
}
tnode_t *
{
return (NULL);
return (NULL);
return (NULL);
}
/*
* We expect to find root complexes beneath the hostbridge.
*/
return (NULL);
}
return (ntn);
}
tnode_t *
{
return (NULL);
did_markrc(pd);
return (NULL);
return (NULL);
}
/*
* We expect to find pci-express buses beneath a root complex
*/
return (NULL);
}
return (ntn);
}
/*ARGSUSED*/
static int
{
int brc = 0;
int bus;
/*
* Find the hostbridge of interest
*/
== NULL) {
return (-1);
}
if (topo_mod_enumerate(mod,
}
}
return (0);
}