Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F166385992
D12364.id33045.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
6 KB
Referenced Files
None
Subscribers
None
D12364.id33045.diff
View Options
Index: sys/dev/amdsmn/amdsmn.c
===================================================================
--- sys/dev/amdsmn/amdsmn.c
+++ 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: sys/dev/amdtemp/amdtemp.c
===================================================================
--- sys/dev/amdtemp/amdtemp.c
+++ sys/dev/amdtemp/amdtemp.c
@@ -74,33 +74,19 @@
device_t sc_smn;
};
-#define VENDORID_AMD 0x1022
-#define DEVICEID_AMD_MISC0F 0x1103
-#define DEVICEID_AMD_MISC10 0x1203
-#define DEVICEID_AMD_MISC11 0x1303
-#define DEVICEID_AMD_MISC12 0x1403
-#define DEVICEID_AMD_MISC14 0x1703
-#define DEVICEID_AMD_MISC15 0x1603
-#define DEVICEID_AMD_MISC16 0x1533
-#define DEVICEID_AMD_MISC16_M30H 0x1583
-#define DEVICEID_AMD_MISC17 0x141d
-#define DEVICEID_AMD_HOSTB17H 0x1450
-
static struct amdtemp_product {
- uint16_t amdtemp_vendorid;
- uint16_t amdtemp_deviceid;
+ uint32_t amdtemp_deviceid;
} amdtemp_products[] = {
- { VENDORID_AMD, DEVICEID_AMD_MISC0F },
- { VENDORID_AMD, DEVICEID_AMD_MISC10 },
- { VENDORID_AMD, DEVICEID_AMD_MISC11 },
- { VENDORID_AMD, DEVICEID_AMD_MISC12 },
- { VENDORID_AMD, DEVICEID_AMD_MISC14 },
- { VENDORID_AMD, DEVICEID_AMD_MISC15 },
- { VENDORID_AMD, DEVICEID_AMD_MISC16 },
- { VENDORID_AMD, DEVICEID_AMD_MISC16_M30H },
- { VENDORID_AMD, DEVICEID_AMD_MISC17 },
- { VENDORID_AMD, DEVICEID_AMD_HOSTB17H },
- { 0, 0 }
+ { 0x11031022 },
+ { 0x12031022 },
+ { 0x13031022 },
+ { 0x14031022 },
+ { 0x17031022 },
+ { 0x16031022 },
+ { 0x15331022 },
+ { 0x15831022 },
+ { 0x141d1022 },
+ { 0x14501022 },
};
/*
@@ -139,7 +125,7 @@
static int amdtemp_attach(device_t dev);
static void amdtemp_intrhook(void *arg);
static int amdtemp_detach(device_t dev);
-static int amdtemp_match(device_t dev);
+static bool amdtemp_match(device_t dev);
static int32_t amdtemp_gettemp0f(device_t dev, amdsensor_t sensor);
static int32_t amdtemp_gettemp(device_t dev, amdsensor_t sensor);
static int32_t amdtemp_gettemp17h(device_t dev, amdsensor_t sensor);
@@ -165,23 +151,23 @@
DRIVER_MODULE(amdtemp, hostb, amdtemp_driver, amdtemp_devclass, NULL, NULL);
MODULE_VERSION(amdtemp, 1);
MODULE_DEPEND(amdtemp, amdsmn, 1, 1, 1);
+MODULE_PNP_INFO("W32:vendor/device", pci, amdtemp, amdtemp_products,
+ sizeof(amdtemp_products[0]), nitems(amdtemp_products));
-static int
+static bool
amdtemp_match(device_t dev)
{
int i;
- uint16_t vendor, devid;
+ uint32_t devid;
- vendor = pci_get_vendor(dev);
- devid = pci_get_device(dev);
+ devid = pci_get_devid(dev);
- for (i = 0; amdtemp_products[i].amdtemp_vendorid != 0; i++) {
- if (vendor == amdtemp_products[i].amdtemp_vendorid &&
- devid == amdtemp_products[i].amdtemp_deviceid)
- return (1);
+ for (i = 0; i < nitems(amdtemp_products); i++) {
+ if (devid == amdtemp_products[i].amdtemp_deviceid)
+ return (true);
}
- return (0);
+ return (false);
}
static void
Index: sys/dev/intpm/intpm.c
===================================================================
--- sys/dev/intpm/intpm.c
+++ 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: sys/dev/ioat/ioat.c
===================================================================
--- sys/dev/ioat/ioat.c
+++ 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: sys/dev/ntb/ntb_hw/ntb_hw_intel.c
===================================================================
--- sys/dev/ntb/ntb_hw/ntb_hw_intel.c
+++ 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
Fri, Aug 14, 7:26 AM (2 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36709870
Default Alt Text
D12364.id33045.diff (6 KB)
Attached To
Mode
D12364: Add PNP metadata to a few drivers
Attached
Detach File
Event Timeline
Log In to Comment