Index: sys/dev/et/if_et.c =================================================================== --- sys/dev/et/if_et.c +++ sys/dev/et/if_et.c @@ -188,6 +188,8 @@ static devclass_t et_devclass; DRIVER_MODULE(et, pci, et_driver, et_devclass, 0, 0); +MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, et, et_devices, + sizeof(et_devices[0]), nitems(et_devices) - 1); DRIVER_MODULE(miibus, et, miibus_driver, miibus_devclass, 0, 0); static int et_rx_intr_npkts = 32; Index: sys/dev/iir/iir_pci.c =================================================================== --- sys/dev/iir/iir_pci.c +++ sys/dev/iir/iir_pci.c @@ -141,6 +141,16 @@ void gdt_mpr_set_sema0(struct gdt_softc *); int gdt_mpr_test_busy(struct gdt_softc *); +static struct iir_pci_dev { + uint16_t vendorid; + uint16_t deviceid; + const char *description; +} iir_pci_devs[] = { + {INTEL_VENDOR_ID_IIR, INTEL_DEVICE_ID_IIR, "Intel Integrated RAID Controller"}, + {GDT_VENDOR_ID, GDT_DEVICE_ID_NEWRX, "ICP Disk Array Controller"}, + {0, 0, NULL}, +}; + static device_method_t iir_pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, iir_pci_probe), @@ -159,23 +169,36 @@ static devclass_t iir_devclass; DRIVER_MODULE(iir, pci, iir_pci_driver, iir_devclass, 0, 0); +MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, iir, iir_pci_devs, + sizeof(iir_pci_devs[0]), nitems(iir_pci_devs) - 1); MODULE_DEPEND(iir, pci, 1, 1, 1); MODULE_DEPEND(iir, cam, 1, 1, 1); static int iir_pci_probe(device_t dev) { - if (pci_get_vendor(dev) == INTEL_VENDOR_ID_IIR && - pci_get_device(dev) == INTEL_DEVICE_ID_IIR) { - device_set_desc(dev, "Intel Integrated RAID Controller"); - return (BUS_PROBE_DEFAULT); + const struct iir_pci_dev *iird; + uint16_t did; + uint16_t vid; + size_t i; + + vid = pci_get_vendor(dev); + did = pci_get_device(dev); + if (vid == GDT_VENDOR_ID && + (did >= GDT_DEVICE_ID_MIN && + did <= GDT_DEVICE_ID_MAX)) { + device_set_desc(dev, "ICP Disk Array Controller"); + return (BUS_PROBE_DEFAULT); } - if (pci_get_vendor(dev) == GDT_VENDOR_ID && - ((pci_get_device(dev) >= GDT_DEVICE_ID_MIN && - pci_get_device(dev) <= GDT_DEVICE_ID_MAX) || - pci_get_device(dev) == GDT_DEVICE_ID_NEWRX)) { - device_set_desc(dev, "ICP Disk Array Controller"); - return (BUS_PROBE_DEFAULT); + else { + for (i=0; ivendorid && + did == iird->deviceid) { + device_set_desc(dev, iird->description); + return (BUS_PROBE_DEFAULT); + } + } } return (ENXIO); } Index: sys/dev/ips/ips_pci.c =================================================================== --- sys/dev/ips/ips_pci.c +++ sys/dev/ips/ips_pci.c @@ -40,23 +40,34 @@ static int ips_pci_free(ips_softc_t *sc); static void ips_intrhook(void *arg); +static struct ips_pci_dev { + uint16_t vendorid; + uint16_t deviceid; + const char *description; +} ips_pci_devs[] = { + {IPS_VENDOR_ID, IPS_MORPHEUS_DEVICE_ID, "IBM ServeRAID Adapter"}, + {IPS_VENDOR_ID, IPS_COPPERHEAD_DEVICE_ID, "IBM ServeRAID Adapter"}, + {IPS_VENDOR_ID_ADAPTEC, IPS_MARCO_DEVICE_ID, "Adaptec ServeRAID Adapter"}, + {0,0,0}, +}; + static int ips_pci_probe(device_t dev) { - - if ((pci_get_vendor(dev) == IPS_VENDOR_ID) && - (pci_get_device(dev) == IPS_MORPHEUS_DEVICE_ID)) { - device_set_desc(dev, "IBM ServeRAID Adapter"); - return (BUS_PROBE_DEFAULT); - } else if ((pci_get_vendor(dev) == IPS_VENDOR_ID) && - (pci_get_device(dev) == IPS_COPPERHEAD_DEVICE_ID)) { - device_set_desc(dev, "IBM ServeRAID Adapter"); - return (BUS_PROBE_DEFAULT); - } else if ((pci_get_vendor(dev) == IPS_VENDOR_ID_ADAPTEC) && - (pci_get_device(dev) == IPS_MARCO_DEVICE_ID)) { - device_set_desc(dev, "Adaptec ServeRAID Adapter"); - return (BUS_PROBE_DEFAULT); + const struct ips_pci_dev *ipsd; + u_int16_t vid; + u_int16_t did; + size_t i; + + vid = pci_get_vendor(dev); + did = pci_get_device(dev); + for (i=0; ivendorid) && (did == ipsd->deviceid)) { + device_set_desc(dev, ipsd->description); + return (BUS_PROBE_DEFAULT); + } } - return(ENXIO); + return (ENXIO); } static int ips_pci_attach(device_t dev) @@ -221,3 +232,5 @@ static devclass_t ips_devclass; DRIVER_MODULE(ips, pci, ips_pci_driver, ips_devclass, 0, 0); +MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, ips, ips_pci_devs, + sizeof(ips_pci_devs[0]), nitems(ips_pci_devs) - 1); Index: sys/dev/ipw/if_ipw.c =================================================================== --- sys/dev/ipw/if_ipw.c +++ sys/dev/ipw/if_ipw.c @@ -202,6 +202,8 @@ static devclass_t ipw_devclass; DRIVER_MODULE(ipw, pci, ipw_driver, ipw_devclass, NULL, NULL); +MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, ipw, ipw_ident_table, + sizeof(ipw_ident_table[0]), nitems(ipw_ident_table) - 1); MODULE_VERSION(ipw, 1); Index: sys/dev/ismt/ismt.c =================================================================== --- sys/dev/ismt/ismt.c +++ sys/dev/ismt/ismt.c @@ -718,27 +718,32 @@ #define ID_INTEL_S1200_SMT1 0x0c5a8086 #define ID_INTEL_C2000_SMT 0x1f158086 +static struct ismt_dev { + uint32_t devid; + const char *description; +} ismt_devs[] = { + {ID_INTEL_S1200_SMT0, "Atom Processor S1200 SMBus 2.0 Controller 0"}, + {ID_INTEL_S1200_SMT1, "Atom Processor S1200 SMBus 2.0 Controller 1"}, + {ID_INTEL_C2000_SMT, "Atom Processor C2000 SMBus 2.0"}, + {0, NULL}, +}; + static int ismt_probe(device_t dev) { - const char *desc; - - switch (pci_get_devid(dev)) { - case ID_INTEL_S1200_SMT0: - desc = "Atom Processor S1200 SMBus 2.0 Controller 0"; - break; - case ID_INTEL_S1200_SMT1: - desc = "Atom Processor S1200 SMBus 2.0 Controller 1"; - break; - case ID_INTEL_C2000_SMT: - desc = "Atom Processor C2000 SMBus 2.0"; - break; - default: - return (ENXIO); + uint32_t did; + size_t i; + + did = pci_get_devid(dev); + const struct ismt_dev *ismtd; + for (i=0; idevid) { + device_set_desc(dev, ismtd->description); + return (BUS_PROBE_DEFAULT); + } } - - device_set_desc(dev, desc); - return (BUS_PROBE_DEFAULT); + return (ENXIO); } /* Device methods */ @@ -771,6 +776,8 @@ static devclass_t ismt_pci_devclass; DRIVER_MODULE(ismt, pci, ismt_pci_driver, ismt_pci_devclass, 0, 0); +MODULE_PNP_INFO("W32:vendor/device;D:#", pci, ismt, ismt_devs, + sizeof(ismt_devs[0]), nitems(ismt_devs) - 1); DRIVER_MODULE(smbus, ismt, smbus_driver, smbus_devclass, 0, 0); MODULE_DEPEND(ismt, pci, 1, 1, 1); Index: sys/dev/iwm/if_iwm.c =================================================================== --- sys/dev/iwm/if_iwm.c +++ sys/dev/iwm/if_iwm.c @@ -5694,21 +5694,23 @@ #define PCI_PRODUCT_INTEL_WL_8265_1 0x24fd static const struct iwm_devices { + uint16_t vendor; uint16_t device; const struct iwm_cfg *cfg; } iwm_devices[] = { - { PCI_PRODUCT_INTEL_WL_3160_1, &iwm3160_cfg }, - { PCI_PRODUCT_INTEL_WL_3160_2, &iwm3160_cfg }, - { PCI_PRODUCT_INTEL_WL_3165_1, &iwm3165_cfg }, - { PCI_PRODUCT_INTEL_WL_3165_2, &iwm3165_cfg }, - { PCI_PRODUCT_INTEL_WL_3168_1, &iwm3168_cfg }, - { PCI_PRODUCT_INTEL_WL_7260_1, &iwm7260_cfg }, - { PCI_PRODUCT_INTEL_WL_7260_2, &iwm7260_cfg }, - { PCI_PRODUCT_INTEL_WL_7265_1, &iwm7265_cfg }, - { PCI_PRODUCT_INTEL_WL_7265_2, &iwm7265_cfg }, - { PCI_PRODUCT_INTEL_WL_8260_1, &iwm8260_cfg }, - { PCI_PRODUCT_INTEL_WL_8260_2, &iwm8260_cfg }, - { PCI_PRODUCT_INTEL_WL_8265_1, &iwm8265_cfg }, + {PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_3160_1, &iwm3160_cfg }, + {PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_3160_2, &iwm3160_cfg }, + {PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_3165_1, &iwm3165_cfg }, + {PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_3165_2, &iwm3165_cfg }, + {PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_3168_1, &iwm3168_cfg }, + {PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_7260_1, &iwm7260_cfg }, + {PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_7260_2, &iwm7260_cfg }, + {PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_7265_1, &iwm7265_cfg }, + {PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_7265_2, &iwm7265_cfg }, + {PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_8260_1, &iwm8260_cfg }, + {PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_8260_2, &iwm8260_cfg }, + {PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_8265_1, &iwm8265_cfg }, + {0, 0, NULL}, }; static int @@ -6460,6 +6462,8 @@ static devclass_t iwm_devclass; DRIVER_MODULE(iwm, pci, iwm_pci_driver, iwm_devclass, NULL, NULL); +MODULE_PNP_INFO("U16:vendor;U16:device", pci, iwm, iwm_devices, + sizeof(iwm_devices[0]), nitems(iwm_devices) - 1); MODULE_DEPEND(iwm, firmware, 1, 1, 1); MODULE_DEPEND(iwm, pci, 1, 1, 1); MODULE_DEPEND(iwm, wlan, 1, 1, 1); Index: sys/dev/ixgb/if_ixgb.c =================================================================== --- sys/dev/ixgb/if_ixgb.c +++ sys/dev/ixgb/if_ixgb.c @@ -171,6 +171,9 @@ static devclass_t ixgb_devclass; DRIVER_MODULE(ixgb, pci, ixgb_driver, ixgb_devclass, 0, 0); +MODULE_PNP_INFO("U16:vendor;U16:device;U16:subvendor;U16:subdevice", + pci, ixgb, ixgb_vendor_info_array, sizeof(ixgb_vendor_info_array[0]), + nitems(ixgb_vendor_info_array) - 1); MODULE_DEPEND(ixgb, pci, 1, 1, 1); MODULE_DEPEND(ixgb, ether, 1, 1, 1); Index: sys/dev/ixgbe/if_ix.c =================================================================== --- sys/dev/ixgbe/if_ix.c +++ sys/dev/ixgbe/if_ix.c @@ -237,6 +237,8 @@ devclass_t ix_devclass; DRIVER_MODULE(ix, pci, ix_driver, ix_devclass, 0, 0); +MODULE_PNP_INFO("U16:vendor;U16:device", pci, ix, ixgbe_vendor_info_array, + sizeof(ixgbe_vendor_info_array[0]), nitems(ixgbe_vendor_info_array) - 1); MODULE_DEPEND(ix, pci, 1, 1, 1); MODULE_DEPEND(ix, ether, 1, 1, 1); Index: sys/dev/ixgbe/if_ixv.c =================================================================== --- sys/dev/ixgbe/if_ixv.c +++ sys/dev/ixgbe/if_ixv.c @@ -143,6 +143,8 @@ devclass_t ixv_devclass; DRIVER_MODULE(ixv, pci, ixv_driver, ixv_devclass, 0, 0); +MODULE_PNP_INFO("U16:vendor;U16:device", pci, ixv, ixv_vendor_info_array, + sizeof(ixv_vendor_info_array[0]), nitems(ixv_vendor_info_array) - 1); MODULE_DEPEND(ixv, pci, 1, 1, 1); MODULE_DEPEND(ixv, ether, 1, 1, 1); #ifdef DEV_NETMAP Index: sys/dev/pci/ignore_pci.c =================================================================== --- sys/dev/pci/ignore_pci.c +++ sys/dev/pci/ignore_pci.c @@ -43,6 +43,13 @@ #include static int ignore_pci_probe(device_t dev); +static struct ignore_pci_dev { + uint32_t devid; + const char *description; +} ignore_pci_devs[] = { + {0x10001042, "ignored"}, + {0, 0}, +}; static device_method_t ignore_pci_methods[] = { /* Device interface */ @@ -60,6 +67,8 @@ static devclass_t ignore_pci_devclass; DRIVER_MODULE(ignore_pci, pci, ignore_pci_driver, ignore_pci_devclass, 0, 0); +MODULE_PNP_INFO("U32:vendor/device", pci, ignore_pci, ignore_pci_devs, + sizeof(ignore_pci_devs[0]), nitems(ignore_pci_devs) - 1); static int ignore_pci_probe(device_t dev) Index: sys/dev/pci/isa_pci.c =================================================================== --- sys/dev/pci/isa_pci.c +++ sys/dev/pci/isa_pci.c @@ -59,6 +59,33 @@ static int isab_pci_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r); +static struct isab_pci_dev { + uint32_t devid; + const char *description; +} isab_pci_devs[] = { + {0x04848086, "PCI-ISA bridge"}, /* Intel 82378ZB/82378IB */ + {0x122e8086, "PCI-ISA bridge"}, /* Intel 82371FB */ + {0x70008086, "PCI-ISA bridge"}, /* Intel 82371SB */ + {0x71108086, "PCI-ISA bridge"}, /* Intel 82371AB */ + {0x71988086, "PCI-ISA bridge"}, /* Intel 82443MX */ + {0x24108086, "PCI-ISA bridge"}, /* Intel 82801AA (ICH) */ + {0x24208086, "PCI-ISA bridge"}, /* Intel 82801AB (ICH0) */ + {0x24408086, "PCI-ISA bridge"}, /* Intel 82801AB (ICH2) */ + {0x00061004, "PCI-ISA bridge"}, /* VLSI 82C593 */ + {0x05861106, "PCI-ISA bridge"}, /* VIA 82C586 */ + {0x05961106, "PCI-ISA bridge"}, /* VIA 82C596 */ + {0x06861106, "PCI-ISA bridge"}, /* VIA 82C686 */ + {0x153310b9, "PCI-ISA bridge"}, /* AcerLabs M1533 */ + {0x154310b9, "PCI-ISA bridge"}, /* AcerLabs M1543 */ + {0x00081039, "PCI-ISA bridge"}, /* SiS 85c503 */ + {0x00001078, "PCI-ISA bridge"}, /* Cyrix Cx5510 */ + {0x01001078, "PCI-ISA bridge"}, /* Cyrix Cx5530 */ + {0xc7001045, "PCI-ISA bridge"}, /* OPTi 82C700 (FireStar) */ + {0x886a1060, "PCI-ISA bridge"}, /* UMC UM8886 ISA */ + {0x02001166, "PCI-ISA bridge"}, /* ServerWorks IB6566 PCI */ + {0, 0}, /* sentinel */ +}; + static device_method_t isab_methods[] = { /* Device interface */ DEVMETHOD(device_probe, isab_pci_probe), @@ -96,6 +123,8 @@ }; DRIVER_MODULE(isab, pci, isab_driver, isab_devclass, 0, 0); +MODULE_PNP_INFO("U32:vendor/device", pci, isab, isab_pci_devs, + sizeof(isab_pci_devs[0]), nitems(isab_pci_devs) - 1); /* * XXX we need to add a quirk list here for bridges that don't correctly @@ -105,6 +134,11 @@ isab_pci_probe(device_t dev) { int matched = 0; + const struct isab_pci_dev *isad; + uint32_t did; + size_t i; + + did = pci_get_devid(dev); /* * Try for a generic match based on class/subclass. @@ -119,36 +153,15 @@ * such. Check in case one of them is pretending to be * something else. */ - switch (pci_get_devid(dev)) { - case 0x04848086: /* Intel 82378ZB/82378IB */ - case 0x122e8086: /* Intel 82371FB */ - case 0x70008086: /* Intel 82371SB */ - case 0x71108086: /* Intel 82371AB */ - case 0x71988086: /* Intel 82443MX */ - case 0x24108086: /* Intel 82801AA (ICH) */ - case 0x24208086: /* Intel 82801AB (ICH0) */ - case 0x24408086: /* Intel 82801AB (ICH2) */ - case 0x00061004: /* VLSI 82C593 */ - case 0x05861106: /* VIA 82C586 */ - case 0x05961106: /* VIA 82C596 */ - case 0x06861106: /* VIA 82C686 */ - case 0x153310b9: /* AcerLabs M1533 */ - case 0x154310b9: /* AcerLabs M1543 */ - case 0x00081039: /* SiS 85c503 */ - case 0x00001078: /* Cyrix Cx5510 */ - case 0x01001078: /* Cyrix Cx5530 */ - case 0xc7001045: /* OPTi 82C700 (FireStar) */ - case 0x886a1060: /* UMC UM8886 ISA */ - case 0x02001166: /* ServerWorks IB6566 PCI */ - if (bootverbose) - printf("PCI-ISA bridge with incorrect subclass 0x%x\n", - pci_get_subclass(dev)); - matched = 1; - break; - - default: - break; - } + for (i=0; idevid == did) { + matched = 1; + if (bootverbose) + printf("PCI-ISA bridge with incorrect subclass 0x%x\n", + pci_get_subclass(dev)); + } + } } if (matched) {