human-readable dmesg

Alexander Polakov polachok at gmail.com
Fri May 22 09:39:08 PDT 2009


diff --git a/sys/bus/pci/pci.c b/sys/bus/pci/pci.c
index 721b258..06475b1 100644
--- a/sys/bus/pci/pci.c
+++ b/sys/bus/pci/pci.c
@@ -63,6 +63,7 @@
 
 devclass_t	pci_devclass;
 const char	*pcib_owner;
+const char*     (*pci_db_match)(device_t dev);
 
 static void		pci_read_capabilities(device_t dev, pcicfgregs *cfg);
 static int		pcie_slotimpl(const pcicfgregs *);
@@ -1875,6 +1876,7 @@ pci_probe_nomatch(device_t dev, device_t child)
 	desc = pci_ata_match(child);
 	if (!desc) desc = pci_usb_match(child);
 	if (!desc) desc = pci_vga_match(child);
+        if (!desc && pci_db_match) desc = pci_db_match(child);
 	if (!desc) desc = pci_chip_match(child);
 	if (!desc) {
 		desc = "unknown card";
diff --git a/sys/bus/pci/pcisupport.c b/sys/bus/pci/pcisupport.c
index 903a19d..c3cf1de 100644
--- a/sys/bus/pci/pcisupport.c
+++ b/sys/bus/pci/pcisupport.c
@@ -68,6 +68,7 @@
 **
 **---------------------------------------------------------
 */
+extern const char* (*pci_db_match)(device_t dev);
 
 static void
 fixbushigh_i1225(device_t dev)
@@ -141,9 +142,13 @@ pci_bridge_type(device_t dev)
 {
     char *descr, tmpbuf[120];
 
+    descr = NULL;
     if (pci_get_class(dev) != PCIC_BRIDGE)
 	    return NULL;
-
+    if (pci_db_match)
+            descr = pci_db_match(dev);
+    if(descr)
+            return descr;
     switch (pci_get_subclass(dev)) {
     case PCIS_BRIDGE_HOST:	strcpy(tmpbuf, "Host to PCI"); break;
     case PCIS_BRIDGE_ISA:	strcpy(tmpbuf, "PCI to ISA"); break;
Attachment:
pcidb.tgz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bin00000.bin
Type: application/octet-stream
Size: 157944 bytes
Desc: "Description: application/tar-gz"
URL: <http://lists.dragonflybsd.org/pipermail/kernel/attachments/20090522/72dc174b/attachment-0019.bin>


More information about the Kernel mailing list