]> Zhao Yanbai Git Server - minix.git/commitdiff
Added debug output for unsupported PCI-to-PCI bridges.
authorPhilip Homburg <philip@cs.vu.nl>
Fri, 26 Aug 2005 11:36:57 +0000 (11:36 +0000)
committerPhilip Homburg <philip@cs.vu.nl>
Fri, 26 Aug 2005 11:36:57 +0000 (11:36 +0000)
drivers/libpci/pci.c
drivers/libpci/pci.h

index d4dbd0a8f64fb3bde33fd218b41db96ab63e877e..e3d2380d3f73f7ab8af19e8f54c7e479fd820f90 100644 (file)
@@ -692,7 +692,8 @@ int busind;
        int devind, i;
        int ind, type;
        u16_t vid, did;
-       u8_t sbusn;
+       u8_t sbusn, baseclass, subclass, infclass;
+       u32_t t3;
 
        vid= did= 0;    /* lint */
        for (devind= 0; devind< nr_pcidev; devind++)
@@ -711,7 +712,27 @@ int busind;
                        break;
                }
                if (pci_pcibridge[i].vid == 0)
+               {
+                       if (debug)
+                       {
+                               /* Report unsupported bridges */
+                               baseclass= pci_attr_r8(devind, PCI_BCR);
+                               subclass= pci_attr_r8(devind, PCI_SCR);
+                               infclass= pci_attr_r8(devind, PCI_PIFR);
+                               t3= ((baseclass << 16) | (subclass << 8) |
+                                       infclass);
+                               if (t3 != PCI_T3_PCI2PCI &&
+                                       t3 != PCI_T3_PCI2PCI_SUBTR)
+                               {
+                                       /* No a PCI-to-PCI bridge */
+                                       continue;
+                               }
+                               printf(
+                       "Ignoring unknown PCI-to-PCI bridge: %04X/%04X\n",
+                                       vid, did);
+                       }
                        continue;
+               }
                type= pci_pcibridge[i].type;
 
                if (debug)
index 6e2a679723120941bbc4b5416f172c7dfeead033..41385445e6e6d99badd4a27b147198968dde2701 100644 (file)
@@ -49,6 +49,10 @@ _PROTOTYPE( void pci_attr_w32, (int devind, int port, u32_t value)   );
 #define PCI_ILR                0x3C    /* Interrupt Line Register */
 #define PCI_IPR                0x3D    /* Interrupt Pin Register */
 
+/* Device type values as ([PCI_BCR] << 16) | ([PCI_SCR] << 8) | [PCI_PIFR] */
+#define        PCI_T3_PCI2PCI          0x060400        /* PCI-to-PCI Bridge device */
+#define        PCI_T3_PCI2PCI_SUBTR    0x060401        /* Subtr. PCI-to-PCI Bridge */
+
 /* PCI bridge devices (AGP) */
 #define PPB_SBUSN      0x19    /* Secondary Bus Number */