|
@@ -122,7 +122,7 @@ pcibarsize(Pcidev *p, int rno)
|
|
|
}
|
|
|
|
|
|
static int
|
|
|
-pcilscan(int bno, Pcidev** list)
|
|
|
+pcilscan(int bno, char *path, Pcidev** list)
|
|
|
{
|
|
|
Pcidev *p, *head, *tail;
|
|
|
int dno, fno, i, hdt, l, maxfno, maxubn, sbn, tbdf, ubn, capoff;
|
|
@@ -152,6 +152,7 @@ pcilscan(int bno, Pcidev** list)
|
|
|
p->tbdf = tbdf;
|
|
|
p->vid = l;
|
|
|
p->did = l>>16;
|
|
|
+ p->path = path;
|
|
|
|
|
|
if(pcilist != nil)
|
|
|
pcitail->list = p;
|
|
@@ -282,7 +283,9 @@ pcilscan(int bno, Pcidev** list)
|
|
|
pcicfgw32(p, PciPCR, 0xFFFF0000);
|
|
|
pcicfgw32(p, PciPBN, Maxbus<<16 | sbn<<8 | bno);
|
|
|
pcicfgw16(p, PciSPSR, 0xFFFF);
|
|
|
- maxubn = pcilscan(sbn, &p->bridge);
|
|
|
+ char *bus = mallocz(256, 1);
|
|
|
+ snprint(bus, 256, "%s.%d", path, sbn);
|
|
|
+ maxubn = pcilscan(sbn, bus, &p->bridge);
|
|
|
pcicfgw32(p, PciPBN, maxubn<<16 | sbn<<8 | bno);
|
|
|
}
|
|
|
else {
|
|
@@ -294,9 +297,12 @@ pcilscan(int bno, Pcidev** list)
|
|
|
* way down. Need to look more closely at
|
|
|
* this.
|
|
|
*/
|
|
|
- if(ubn > maxubn)
|
|
|
+ if(ubn > maxubn) {
|
|
|
maxubn = ubn;
|
|
|
- pcilscan(sbn, &p->bridge);
|
|
|
+ }
|
|
|
+ char *bus = mallocz(256, 1);
|
|
|
+ snprint(bus, 256, "%s.%d", path, sbn);
|
|
|
+ pcilscan(sbn, bus, &p->bridge);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -386,7 +392,7 @@ pcicfginit(void)
|
|
|
list = &pciroot;
|
|
|
for(bno = 0; bno <= Maxbus; bno++) {
|
|
|
sbno = bno;
|
|
|
- bno = pcilscan(bno, list);
|
|
|
+ bno = pcilscan(bno, "0", list);
|
|
|
|
|
|
while(*list)
|
|
|
list = &(*list)->link;
|