Beispiel #1
0
tnode_t *
pciexrc_declare(topo_mod_t *mod, tnode_t *parent, di_node_t din,
    topo_instance_t ri)
{
	did_t *pd;
	tnode_t *ntn;

	if ((pd = did_find(mod, din)) == NULL)
		return (NULL);
	did_markrc(pd);
	if ((ntn = hb_tnode_create(mod, parent, PCIEX_ROOT, ri, din)) == NULL)
		return (NULL);
	if (did_props_set(ntn, pd, RC_common_props, RC_propcnt) < 0) {
		topo_node_unbind(ntn);
		return (NULL);
	}
	/*
	 * We expect to find pci-express buses beneath a root complex
	 */
	if (child_range_add(mod, ntn, PCIEX_BUS, 0, MAX_HB_BUSES) < 0) {
		topo_node_range_destroy(ntn, PCIEX_BUS);
		return (NULL);
	}
	return (ntn);
}
Beispiel #2
0
tnode_t *
ioboard_declare(tnode_t *parent, topo_instance_t i, void *priv,
    di_prom_handle_t promtree, topo_mod_t *mod)
{
	tnode_t *ntn;

	if ((ntn = iob_tnode_create(parent, IOBOARD, i, priv, mod)) == NULL)
		return (NULL);
	if (did_props_set(ntn, priv, IOB_common_props, IOB_propcnt,
	    promtree) < 0) {
		topo_node_unbind(ntn);
		return (NULL);
	}
	/*
	 * We expect to find host bridges beneath the ioboard.
	 */
	if (child_range_add(mod, ntn, HOSTBRIDGE, 0, MAX_HBS) < 0) {
		topo_node_unbind(ntn);
		return (NULL);
	}
	return (ntn);
}
Beispiel #3
0
tnode_t *
pciexhostbridge_declare(topo_mod_t *mod, tnode_t *parent, di_node_t din,
    topo_instance_t hi)
{
	did_t *pd;
	tnode_t *ntn;

	if ((pd = did_find(mod, din)) == NULL)
		return (NULL);
	if ((ntn = hb_tnode_create(mod, parent, HOSTBRIDGE, hi, din)) == NULL)
		return (NULL);
	if (did_props_set(ntn, pd, ExHB_common_props, ExHB_propcnt) < 0) {
		topo_node_unbind(ntn);
		return (NULL);
	}
	/*
	 * We expect to find root complexes beneath the hostbridge.
	 */
	if (child_range_add(mod, ntn, PCIEX_ROOT, 0, MAX_HB_BUSES) < 0) {
		topo_node_unbind(ntn);
		return (NULL);
	}
	return (ntn);
}