diff options
author | nsayer <nsayer@FreeBSD.org> | 2001-08-23 00:57:40 +0000 |
---|---|---|
committer | nsayer <nsayer@FreeBSD.org> | 2001-08-23 00:57:40 +0000 |
commit | 2c80ec8e4ac8cca86e44e46bbf5b97a9f9c5fc1f (patch) | |
tree | ac5e9f5b203d5672873a58df06ca4f5fbece83b1 /sys | |
parent | 2406fd4d6b93137ecd11cc6dd4e97ec48e82819d (diff) | |
download | FreeBSD-src-2c80ec8e4ac8cca86e44e46bbf5b97a9f9c5fc1f.zip FreeBSD-src-2c80ec8e4ac8cca86e44e46bbf5b97a9f9c5fc1f.tar.gz |
Add support for the Netgear MA301 PCI adapter for the MA401.
It appears that a number of PrismII card vendors seem to be doing the
same thing (that is, using the same PCI bridge chip) to support PCI,
but each with their own vendor/product ID. So rather than cut-n-paste
another if statement into the probe routine, it's probably better to
provide support for a table. Adding new devices will be a lot easier
that way.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/wi/if_wi.c | 19 | ||||
-rw-r--r-- | sys/dev/wi/if_wireg.h | 2 |
2 files changed, 15 insertions, 6 deletions
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c index 40cdbc5..164fcf4 100644 --- a/sys/dev/wi/if_wi.c +++ b/sys/dev/wi/if_wi.c @@ -203,6 +203,15 @@ static driver_t wi_pci_driver = { sizeof(struct wi_softc) }; +struct { + unsigned int vendor,device; + char *desc; +} pci_ids[] = { + {0x1638, 0x1100, "PRISM2STA PCI WaveLAN/IEEE 802.11"}, + {0x1385, 0x4100, "Netgear MA301 PCI IEEE 802.11b"}, + {0, 0, NULL} +}; + static devclass_t wi_pccard_devclass; static devclass_t wi_pci_devclass; @@ -257,14 +266,16 @@ wi_pci_probe(dev) device_t dev; { struct wi_softc *sc; + int i; sc = device_get_softc(dev); - if ((pci_get_vendor(dev) == WI_PCI_VENDOR_EUMITCOM) && - (pci_get_device(dev) == WI_PCI_DEVICE_PRISM2STA)) { + for(i=0; pci_ids[i].vendor != 0; i++) { + if ((pci_get_vendor(dev) == pci_ids[i].vendor) && + (pci_get_device(dev) == pci_ids[i].device)) { sc->wi_prism2 = 1; - device_set_desc(dev, - "PRISM2STA PCI WaveLAN/IEEE 802.11"); + device_set_desc(dev, pci_ids[i].desc); return (0); + } } return(ENXIO); } diff --git a/sys/dev/wi/if_wireg.h b/sys/dev/wi/if_wireg.h index 6b0dbfa..0fa1c0c 100644 --- a/sys/dev/wi/if_wireg.h +++ b/sys/dev/wi/if_wireg.h @@ -149,8 +149,6 @@ struct wi_softc { #define WI_PCI_MEMRES 0x18 #define WI_PCI_IORES 0x1C -#define WI_PCI_VENDOR_EUMITCOM 0x1638 -#define WI_PCI_DEVICE_PRISM2STA 0x1100 #define WI_HFA384X_SWSUPPORT0_OFF 0x28 #define WI_PRISM2STA_MAGIC 0x4A2D |