summaryrefslogtreecommitdiff
path: root/sys/dev/rtwn
diff options
context:
space:
mode:
authorHiroki Sato <hrs@FreeBSD.org>2020-02-27 19:35:17 +0000
committerHiroki Sato <hrs@FreeBSD.org>2020-02-27 19:35:17 +0000
commit28180b6298caef65c3f1429a1778997bc679c26f (patch)
tree13f806f2daf96b3e642a1d9f9b77fdb320d2efe6 /sys/dev/rtwn
parent561af25fa7b21943d96619473c1f7e6493ca74cc (diff)
Notes
Diffstat (limited to 'sys/dev/rtwn')
-rw-r--r--sys/dev/rtwn/pci/rtwn_pci_attach.c13
-rw-r--r--sys/dev/rtwn/pci/rtwn_pci_attach.h1
2 files changed, 8 insertions, 6 deletions
diff --git a/sys/dev/rtwn/pci/rtwn_pci_attach.c b/sys/dev/rtwn/pci/rtwn_pci_attach.c
index 392279cb7149..a7a6e849fa09 100644
--- a/sys/dev/rtwn/pci/rtwn_pci_attach.c
+++ b/sys/dev/rtwn/pci/rtwn_pci_attach.c
@@ -96,15 +96,16 @@ static void rtwn_pci_attach_methods(struct rtwn_softc *);
static const struct rtwn_pci_ident *
rtwn_pci_probe_sub(device_t dev)
{
- const struct rtwn_pci_ident *ident;
- int vendor_id, device_id;
+ int i, vendor_id, device_id;
vendor_id = pci_get_vendor(dev);
device_id = pci_get_device(dev);
- for (ident = rtwn_pci_ident_table; ident->name != NULL; ident++)
- if (vendor_id == ident->vendor && device_id == ident->device)
- return (ident);
+ for (i = 0; i < nitems(rtwn_pci_ident_table); i++) {
+ if (vendor_id == rtwn_pci_ident_table[i].vendor &&
+ device_id == rtwn_pci_ident_table[i].device)
+ return (&rtwn_pci_ident_table[i]);
+ }
return (NULL);
}
@@ -788,6 +789,8 @@ static devclass_t rtwn_pci_devclass;
DRIVER_MODULE(rtwn_pci, pci, rtwn_pci_driver, rtwn_pci_devclass, NULL, NULL);
MODULE_VERSION(rtwn_pci, 1);
+MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, rtwn, rtwn_pci_ident_table,
+ nitems(rtwn_pci_ident_table));
MODULE_DEPEND(rtwn_pci, pci, 1, 1, 1);
MODULE_DEPEND(rtwn_pci, wlan, 1, 1, 1);
MODULE_DEPEND(rtwn_pci, rtwn, 2, 2, 2);
diff --git a/sys/dev/rtwn/pci/rtwn_pci_attach.h b/sys/dev/rtwn/pci/rtwn_pci_attach.h
index 796d8c4d400d..b37ef6725257 100644
--- a/sys/dev/rtwn/pci/rtwn_pci_attach.h
+++ b/sys/dev/rtwn/pci/rtwn_pci_attach.h
@@ -36,7 +36,6 @@ static const struct rtwn_pci_ident rtwn_pci_ident_table[] = {
{ 0x10ec, 0x8176, "Realtek RTL8188CE", RTWN_CHIP_RTL8192CE },
{ 0x10ec, 0x8179, "Realtek RTL8188EE", RTWN_CHIP_RTL8188EE },
{ 0x10ec, 0x8178, "Realtek RTL8192CE", RTWN_CHIP_RTL8192CE },
- { 0, 0, NULL, RTWN_CHIP_MAX_PCI }
};
typedef void (*chip_pci_attach)(struct rtwn_pci_softc *);