Lines 624-629
Link Here
|
624 |
int sec_bus, pri_bus; |
624 |
int sec_bus, pri_bus; |
625 |
static int previousBus = 0; |
625 |
static int previousBus = 0; |
626 |
Bool speculativeProbe = FALSE; |
626 |
Bool speculativeProbe = FALSE; |
|
|
627 |
Bool inLoop = FALSE; |
627 |
unsigned char base_class, sub_class; |
628 |
unsigned char base_class, sub_class; |
628 |
|
629 |
|
629 |
#ifdef DEBUGPCI |
630 |
#ifdef DEBUGPCI |
Lines 660-666
Link Here
|
660 |
/* |
661 |
/* |
661 |
* Is current dev a multifunction device? |
662 |
* Is current dev a multifunction device? |
662 |
*/ |
663 |
*/ |
663 |
if (!speculativeProbe && pciMfDev(pciBusNum, pciDevNum)) |
664 |
if (!inLoop && !speculativeProbe && pciMfDev(pciBusNum, pciDevNum)) |
664 |
/* Probe for other functions */ |
665 |
/* Probe for other functions */ |
665 |
pciFuncNum = 1; |
666 |
pciFuncNum = 1; |
666 |
else |
667 |
else |
Lines 693-698
Link Here
|
693 |
speculativeProbe = FALSE; |
694 |
speculativeProbe = FALSE; |
694 |
} |
695 |
} |
695 |
|
696 |
|
|
|
697 |
do { |
696 |
if (++pciBusNum >= pciMaxBusNum) { |
698 |
if (++pciBusNum >= pciMaxBusNum) { |
697 |
#ifdef DEBUGPCI |
699 |
#ifdef DEBUGPCI |
698 |
ErrorF("pciGenFindNext: out of buses\n"); |
700 |
ErrorF("pciGenFindNext: out of buses\n"); |
Lines 700-705
Link Here
|
700 |
/* No more buses. All done for now */ |
702 |
/* No more buses. All done for now */ |
701 |
return(PCI_NOT_FOUND); |
703 |
return(PCI_NOT_FOUND); |
702 |
} |
704 |
} |
|
|
705 |
} while (pciBusInfo[pciBusNum] && |
706 |
(pciBusInfo[pciBusNum]->numDevices == 0)); |
703 |
|
707 |
|
704 |
pciDevNum = 0; |
708 |
pciDevNum = 0; |
705 |
} |
709 |
} |
Lines 730-737
Link Here
|
730 |
#ifdef DEBUGPCI |
734 |
#ifdef DEBUGPCI |
731 |
ErrorF("pciGenFindNext: pciDeviceTag = 0x%lx, devid = 0x%lx\n", pciDeviceTag, devid); |
735 |
ErrorF("pciGenFindNext: pciDeviceTag = 0x%lx, devid = 0x%lx\n", pciDeviceTag, devid); |
732 |
#endif |
736 |
#endif |
733 |
if ((CARD16)(devid + 1U) <= (CARD16)1UL) |
737 |
if ((CARD16)(devid + 1U) <= (CARD16)1UL) { |
|
|
738 |
inLoop = TRUE; |
734 |
continue; /* Nobody home. Next device please */ |
739 |
continue; /* Nobody home. Next device please */ |
|
|
740 |
} |
735 |
|
741 |
|
736 |
/* |
742 |
/* |
737 |
* Some devices mis-decode configuration cycles in such a way as to |
743 |
* Some devices mis-decode configuration cycles in such a way as to |
Lines 742-750
Link Here
|
742 |
for (;;) { |
748 |
for (;;) { |
743 |
if (++pciDevNum >= pciBusInfo[pciBusNum]->numDevices) |
749 |
if (++pciDevNum >= pciBusInfo[pciBusNum]->numDevices) |
744 |
goto NextSpeculativeBus; |
750 |
goto NextSpeculativeBus; |
745 |
if (devid != |
751 |
inProbe = TRUE; |
746 |
pciReadLong(PCI_MAKE_TAG(pciBusNum, pciDevNum, 0), |
752 |
tmp = pciReadLong(PCI_MAKE_TAG(pciBusNum, pciDevNum, 0), |
747 |
PCI_ID_REG)) |
753 |
PCI_ID_REG); |
|
|
754 |
inProbe = FALSE; |
755 |
if (devid != tmp) |
748 |
break; |
756 |
break; |
749 |
} |
757 |
} |
750 |
|
758 |
|
Lines 1035-1040
Link Here
|
1035 |
devp->pci_vendor, devp->pci_device, devp->pci_rev_id, |
1043 |
devp->pci_vendor, devp->pci_device, devp->pci_rev_id, |
1036 |
devp->pci_base_class, devp->pci_sub_class); |
1044 |
devp->pci_base_class, devp->pci_sub_class); |
1037 |
#else |
1045 |
#else |
|
|
1046 |
if (pciNumBuses < 256) |
1038 |
xf86MsgVerb(X_INFO, 2, "PCI: %.2x:%02x:%1x: chip %04x,%04x" |
1047 |
xf86MsgVerb(X_INFO, 2, "PCI: %.2x:%02x:%1x: chip %04x,%04x" |
1039 |
" card %04x,%04x rev %02x class %02x,%02x,%02x hdr %02x\n", |
1048 |
" card %04x,%04x rev %02x class %02x,%02x,%02x hdr %02x\n", |
1040 |
devp->busnum, devp->devnum, devp->funcnum, |
1049 |
devp->busnum, devp->devnum, devp->funcnum, |
Lines 1043-1048
Link Here
|
1043 |
devp->pci_rev_id, devp->pci_base_class, |
1052 |
devp->pci_rev_id, devp->pci_base_class, |
1044 |
devp->pci_sub_class, devp->pci_prog_if, |
1053 |
devp->pci_sub_class, devp->pci_prog_if, |
1045 |
devp->pci_header_type); |
1054 |
devp->pci_header_type); |
|
|
1055 |
else |
1056 |
xf86MsgVerb(X_INFO, 2, "PCI: %.4x@%.2x:%02x:%1x: chip %04x,%04x" |
1057 |
" card %04x,%04x rev %02x class %02x,%02x,%02x" |
1058 |
" hdr %02x\n", |
1059 |
PCI_BUS_NO_DOMAIN(devp->busnum), |
1060 |
PCI_DOM_FROM_BUS(devp->busnum), |
1061 |
devp->devnum, devp->funcnum, |
1062 |
devp->pci_vendor, devp->pci_device, |
1063 |
devp->pci_subsys_vendor, devp->pci_subsys_card, |
1064 |
devp->pci_rev_id, devp->pci_base_class, |
1065 |
devp->pci_sub_class, devp->pci_prog_if, |
1066 |
devp->pci_header_type); |
1046 |
#endif |
1067 |
#endif |
1047 |
|
1068 |
|
1048 |
pci_devp[idx++] = devp; |
1069 |
pci_devp[idx++] = devp; |
Lines 1190-1199
Link Here
|
1190 |
/* if we use a mem base save it and move it out of the way */ |
1211 |
/* if we use a mem base save it and move it out of the way */ |
1191 |
if (b_reg >= 0 && b_reg <= 5) { |
1212 |
if (b_reg >= 0 && b_reg <= 5) { |
1192 |
savebase = pciReadLong(Tag, PCI_MAP_REG_START+(b_reg<<2)); |
1213 |
savebase = pciReadLong(Tag, PCI_MAP_REG_START+(b_reg<<2)); |
|
|
1214 |
if (pciNumBuses < 256) |
1193 |
xf86MsgVerb(X_INFO,5,"xf86ReadPciBios: modifying membase[%i]" |
1215 |
xf86MsgVerb(X_INFO,5,"xf86ReadPciBios: modifying membase[%i]" |
1194 |
" for device %i:%i:%i\n", basereg, |
1216 |
" for device %i:%i:%i\n", basereg, |
1195 |
(int)PCI_BUS_FROM_TAG(Tag), (int)PCI_DEV_FROM_TAG(Tag), |
1217 |
(int)PCI_BUS_FROM_TAG(Tag), (int)PCI_DEV_FROM_TAG(Tag), |
1196 |
(int)PCI_FUNC_FROM_TAG(Tag)); |
1218 |
(int)PCI_FUNC_FROM_TAG(Tag)); |
|
|
1219 |
else |
1220 |
xf86MsgVerb(X_INFO,5,"xf86ReadPciBios: modifying membase[%i]" |
1221 |
" for device %i@%i:%i:%i\n", basereg, |
1222 |
(int)PCI_DOM_FROM_BUS(PCI_BUS_FROM_TAG(Tag)), |
1223 |
(int)PCI_BUS_NO_DOMAIN(PCI_BUS_FROM_TAG(Tag)), |
1224 |
(int)PCI_DEV_FROM_TAG(Tag), |
1225 |
(int)PCI_FUNC_FROM_TAG(Tag)); |
1197 |
pciWriteLong(Tag, PCI_MAP_REG_START + (b_reg << 2), |
1226 |
pciWriteLong(Tag, PCI_MAP_REG_START + (b_reg << 2), |
1198 |
(CARD32)~0); |
1227 |
(CARD32)~0); |
1199 |
} |
1228 |
} |