Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F140148068
D12364.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D12364.diff
View Options
Index: head/sys/dev/amdsmn/amdsmn.c
===================================================================
--- head/sys/dev/amdsmn/amdsmn.c
+++ head/sys/dev/amdsmn/amdsmn.c
@@ -89,6 +89,8 @@
static devclass_t amdsmn_devclass;
DRIVER_MODULE(amdsmn, hostb, amdsmn_driver, amdsmn_devclass, NULL, NULL);
MODULE_VERSION(amdsmn, 1);
+MODULE_PNP_INFO("W32:vendor/device", pci, amdsmn, amdsmn_ids,
+ sizeof(amdsmn_ids[0]), nitems(amdsmn_ids));
static bool
amdsmn_match(device_t parent)
Index: head/sys/dev/amdtemp/amdtemp.c
===================================================================
--- head/sys/dev/amdtemp/amdtemp.c
+++ head/sys/dev/amdtemp/amdtemp.c
@@ -100,7 +100,6 @@
{ VENDORID_AMD, DEVICEID_AMD_MISC16_M30H },
{ VENDORID_AMD, DEVICEID_AMD_MISC17 },
{ VENDORID_AMD, DEVICEID_AMD_HOSTB17H },
- { 0, 0 }
};
/*
@@ -165,6 +164,8 @@
DRIVER_MODULE(amdtemp, hostb, amdtemp_driver, amdtemp_devclass, NULL, NULL);
MODULE_VERSION(amdtemp, 1);
MODULE_DEPEND(amdtemp, amdsmn, 1, 1, 1);
+MODULE_PNP_INFO("U16:vendor;U16:device", pci, amdtemp, amdtemp_products,
+ sizeof(amdtemp_products[0]), nitems(amdtemp_products));
static int
amdtemp_match(device_t dev)
@@ -175,7 +176,7 @@
vendor = pci_get_vendor(dev);
devid = pci_get_device(dev);
- for (i = 0; amdtemp_products[i].amdtemp_vendorid != 0; i++) {
+ for (i = 0; i < nitems(amdtemp_products); i++) {
if (vendor == amdtemp_products[i].amdtemp_vendorid &&
devid == amdtemp_products[i].amdtemp_deviceid)
return (1);
Index: head/sys/dev/intpm/intpm.c
===================================================================
--- head/sys/dev/intpm/intpm.c
+++ head/sys/dev/intpm/intpm.c
@@ -88,34 +88,38 @@
static int intsmb_free(struct intsmb_softc *sc);
static void intsmb_rawintr(void *arg);
+const struct intsmb_device {
+ uint32_t devid;
+ const char *description;
+} intsmb_products[] = {
+ { 0x71138086, "Intel PIIX4 SMBUS Interface" },
+ { 0x719b8086, "Intel PIIX4 SMBUS Interface" },
+#if 0
+ /* Not a good idea yet, this stops isab0 functioning */
+ { 0x02001166, "ServerWorks OSB4" },
+#endif
+ { 0x43721002, "ATI IXP400 SMBus Controller" },
+ { AMDSB_SMBUS_DEVID, "AMD SB600/7xx/8xx/9xx SMBus Controller" },
+ { AMDFCH_SMBUS_DEVID, "AMD FCH SMBus Controller" },
+ { AMDCZ_SMBUS_DEVID, "AMD FCH SMBus Controller" },
+};
+
static int
intsmb_probe(device_t dev)
{
+ const struct intsmb_device *isd;
+ uint32_t devid;
+ size_t i;
- switch (pci_get_devid(dev)) {
- case 0x71138086: /* Intel 82371AB */
- case 0x719b8086: /* Intel 82443MX */
-#if 0
- /* Not a good idea yet, this stops isab0 functioning */
- case 0x02001166: /* ServerWorks OSB4 */
-#endif
- device_set_desc(dev, "Intel PIIX4 SMBUS Interface");
- break;
- case 0x43721002:
- device_set_desc(dev, "ATI IXP400 SMBus Controller");
- break;
- case AMDSB_SMBUS_DEVID:
- device_set_desc(dev, "AMD SB600/7xx/8xx/9xx SMBus Controller");
- break;
- case AMDFCH_SMBUS_DEVID: /* AMD FCH */
- case AMDCZ_SMBUS_DEVID: /* AMD Carizzo FCH */
- device_set_desc(dev, "AMD FCH SMBus Controller");
- break;
- default:
- return (ENXIO);
+ devid = pci_get_devid(dev);
+ for (i = 0; i < nitems(intsmb_products); i++) {
+ isd = &intsmb_products[i];
+ if (isd->devid == devid) {
+ device_set_desc(dev, isd->description);
+ return (BUS_PROBE_DEFAULT);
+ }
}
-
- return (BUS_PROBE_DEFAULT);
+ return (ENXIO);
}
static uint8_t
@@ -891,3 +895,5 @@
DRIVER_MODULE(smbus, intsmb, smbus_driver, smbus_devclass, 0, 0);
MODULE_DEPEND(intsmb, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER);
MODULE_VERSION(intsmb, 1);
+MODULE_PNP_INFO("W32:vendor/device;D:human", pci, intpm, intsmb_products,
+ sizeof(intsmb_products[0]), nitems(intsmb_products));
Index: head/sys/dev/ioat/ioat.c
===================================================================
--- head/sys/dev/ioat/ioat.c
+++ head/sys/dev/ioat/ioat.c
@@ -236,10 +236,11 @@
{ 0x6f278086, "BDX IOAT Ch7" },
{ 0x6f2e8086, "BDX IOAT Ch0 (RAID)" },
{ 0x6f2f8086, "BDX IOAT Ch1 (RAID)" },
-
- { 0x00000000, NULL }
};
+MODULE_PNP_INFO("W32:vendor/device;D:human", pci, ioat, pci_ids,
+ sizeof(pci_ids[0]), nitems(pci_ids));
+
/*
* OS <-> Driver linkage functions
*/
@@ -250,7 +251,7 @@
u_int32_t type;
type = pci_get_devid(device);
- for (ep = pci_ids; ep->type; ep++) {
+ for (ep = pci_ids; ep < &pci_ids[nitems(pci_ids)]; ep++) {
if (ep->type == type) {
device_set_desc(device, ep->desc);
return (0);
Index: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c
===================================================================
--- head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c
+++ head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c
@@ -495,8 +495,6 @@
{ 0x6F0D8086, "BDX Xeon E5 V4 Non-Transparent Bridge B2B", NTB_XEON,
NTB_SDOORBELL_LOCKUP | NTB_B2BDOORBELL_BIT14 |
NTB_SB01BASE_LOCKUP },
-
- { 0x00000000, NULL, NTB_ATOM, 0 }
};
static const struct ntb_reg atom_reg = {
@@ -1390,12 +1388,11 @@
static struct ntb_hw_info *
intel_ntb_get_device_info(uint32_t device_id)
{
- struct ntb_hw_info *ep = pci_ids;
+ struct ntb_hw_info *ep;
- while (ep->device_id) {
+ for (ep = pci_ids; ep < &pci_ids[nitems(pci_ids)]; ep++) {
if (ep->device_id == device_id)
return (ep);
- ++ep;
}
return (NULL);
}
@@ -3122,3 +3119,5 @@
DRIVER_MODULE(ntb_hw_intel, pci, ntb_intel_driver, ntb_hw_devclass, NULL, NULL);
MODULE_DEPEND(ntb_hw_intel, ntb, 1, 1, 1);
MODULE_VERSION(ntb_hw_intel, 1);
+MODULE_PNP_INFO("W32:vendor/device;D:human", pci, ntb_hw_intel, pci_ids,
+ sizeof(pci_ids[0]), nitems(pci_ids));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 21, 8:50 PM (11 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27121572
Default Alt Text
D12364.diff (5 KB)
Attached To
Mode
D12364: Add PNP metadata to a few drivers
Attached
Detach File
Event Timeline
Log In to Comment