summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2004-06-09 06:31:40 +0000
committerimp <imp@FreeBSD.org>2004-06-09 06:31:40 +0000
commitbad5788e8363a97fbf34603bf2210de14df76f28 (patch)
tree5330705fd2bdc2e5f18366f0a8c9b31264693ede /sys
parente550332ee64f8101ad3324149dac6ba7717eb210 (diff)
downloadFreeBSD-src-bad5788e8363a97fbf34603bf2210de14df76f28.zip
FreeBSD-src-bad5788e8363a97fbf34603bf2210de14df76f28.tar.gz
Only match cards that claim to be network cards. I've had two
different cards that matched vendor/id, but weren't wi cards. This is because the vendor foolishly didn't have unique product ids. Symbol has a serial card that would otherwise match the wi driver, for example... Taken from a patch for xe posted by: Carlos Velasco
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/wi/if_wi_pccard.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/dev/wi/if_wi_pccard.c b/sys/dev/wi/if_wi_pccard.c
index e1f70be..549825b 100644
--- a/sys/dev/wi/if_wi_pccard.c
+++ b/sys/dev/wi/if_wi_pccard.c
@@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$");
#include <net80211/ieee80211_radiotap.h>
#include <dev/pccard/pccardvar.h>
+#include <dev/pccard/pccard_cis.h>
#include <dev/wi/if_wavelan_ieee.h>
#include <dev/wi/if_wireg.h>
@@ -162,6 +163,15 @@ wi_pccard_match(dev)
device_t dev;
{
const struct pccard_product *pp;
+ u_int32_t fcn = PCCARD_FUNCTION_UNSPEC;
+ int error;
+
+ /* Make sure we're a network driver */
+ error = pccard_get_function(dev, &fcn);
+ if (error != 0)
+ return (error);
+ if (fcn != PCCARD_FUNCTION_NETWORK)
+ return (ENXIO);
if ((pp = pccard_product_lookup(dev, wi_pccard_products,
sizeof(wi_pccard_products[0]), NULL)) != NULL) {
OpenPOWER on IntegriCloud