/*
* 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 <string.h>
#include <fm/topo_mod.h>
#include <libdevinfo.h>
#include <sys/systeminfo.h>
#include <hb_sun4.h>
#include <util.h>
#include <hostbridge.h>
#include <pcibus.h>
#include <did.h>
{
char *comma;
char *bac;
int e;
return (NULL);
*comma = '\0';
if (e < 0) {
"Trouble interpreting bus_addr before comma.\n");
*comma = ',';
return (NULL);
}
return (pp);
}
if (e < 0) {
"Trouble interpreting bus_addr after comma.\n");
*comma = ',';
return (NULL);
}
*comma = ',';
return (pp);
}
void
{
/* No entries yet? */
return;
}
break;
break;
}
} else {
}
}
int
{
char *ba;
ba = di_bus_addr(n);
return (-1);
}
return (0);
}
void
{
return;
}
tnode_t *
{
return (NULL);
return (hb);
return (NULL);
}
tnode_t *
{
return (NULL);
if (topo_mod_enumerate(mod,
return (rc);
return (NULL);
}
/*
* declare_exbuses() assumes the elements in the provided busorrc list
* are sorted thusly:
*
* (Hostbridge #0, Root Complex #0, ExBus #0)
* (Hostbridge #0, Root Complex #0, ExBus #1)
* ...
* (Hostbridge #0, Root Complex #1, ExBus #0)
* ...
* ...
* ...
* (Hostbridge #0, Root Complex #(rcs/hostbridge), ExBus #(buses/rc))
* (Hostbridge #1, Root Complex #0, ExBus #0)
* ...
* ...
* ...
* ...
* (Hostbridge #nhb, Root Complex #(rcs/hostbridge), ExBus #(buses/rc))
*/
int
int nrc)
{
int err = 0;
busorrc_t *p;
/*
* Allocate an array to point at the hostbridge tnode_t pointers.
*/
/*
* Allocate an array to point at the root complex tnode_t pointers.
*/
}
err = -1;
break;
}
br);
err = -1;
break;
}
}
err = -1;
break;
}
} else {
if (topo_mod_enumerate(mod,
NULL) < 0) {
err = -1;
break;
}
}
rc++;
rc = 0;
br++;
br = 0;
}
}
if (err != 0) {
int i;
for (i = 0; i < nhb; ++i)
for (i = 0; i < nrc; ++i)
}
return (err);
}
/*
* declare_buses() assumes the elements in the provided busorrc list
* are sorted thusly:
*
* (Hostbridge #0, Bus #0)
* (Hostbridge #1, Bus #0)
* ...
* (Hostbridge #nhb, Bus #0)
* (Hostbridge #0, Bus #1)
* ...
* ...
* (Hostbridge #nhb, Bus #(buses/hostbridge))
*/
int
{
int err = 0;
busorrc_t *p;
/*
* Allocate an array to point at the hostbridge tnode_t pointers.
*/
if ((link =
err = -1;
break;
}
err = -1;
break;
}
} else {
if (topo_mod_enumerate(mod,
err = -1;
break;
}
}
br++;
br = 0;
bus++;
}
}
if (err != 0) {
int i;
for (i = 0; i < nhb; ++i)
}
return (err);
}