diff options
author | imp <imp@FreeBSD.org> | 2005-01-20 19:37:22 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2005-01-20 19:37:22 +0000 |
commit | 3afb2ac5309053fcf72759aacfa54654aed0323b (patch) | |
tree | fa9ac369213bd9ef949c22a8b423b23ab4c1222a /sys | |
parent | d7a3cd480757476d9b68913a296da7e21162ff12 (diff) | |
download | FreeBSD-src-3afb2ac5309053fcf72759aacfa54654aed0323b.zip FreeBSD-src-3afb2ac5309053fcf72759aacfa54654aed0323b.tar.gz |
Only attach to network functions.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ed/if_ed_pccard.c | 10 | ||||
-rw-r--r-- | sys/dev/ep/if_ep_pccard.c | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/sys/dev/ed/if_ed_pccard.c b/sys/dev/ed/if_ed_pccard.c index b9f75e7..6711df9 100644 --- a/sys/dev/ed/if_ed_pccard.c +++ b/sys/dev/ed/if_ed_pccard.c @@ -51,6 +51,7 @@ #include <dev/ed/if_edreg.h> #include <dev/ed/if_edvar.h> #include <dev/pccard/pccardvar.h> +#include <dev/pccard/pccard_cis.h> #ifndef ED_NO_MIIBUS #include <dev/mii/mii.h> #include <dev/mii/miivar.h> @@ -192,6 +193,15 @@ static int ed_pccard_match(device_t dev) { const struct ed_product *pp; + int error; + uint32_t fcn = PCCARD_FUNCTION_UNSPEC; + + /* Make sure we're a network function */ + error = pccard_get_function(dev, &fcn); + if (error != 0) + return (error); + if (fcn != PCCARD_FUNCTION_NETWORK) + return (ENXIO); if ((pp = (const struct ed_product *) pccard_product_lookup(dev, (const struct pccard_product *) ed_pccard_products, diff --git a/sys/dev/ep/if_ep_pccard.c b/sys/dev/ep/if_ep_pccard.c index 5101a17..163f168 100644 --- a/sys/dev/ep/if_ep_pccard.c +++ b/sys/dev/ep/if_ep_pccard.c @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include <dev/ep/if_epvar.h> #include <dev/pccard/pccardvar.h> +#include <dev/pccard/pccard_cis.h> #include "card_if.h" #include "pccarddevs.h" @@ -266,6 +267,15 @@ static int ep_pccard_match(device_t dev) { const struct pccard_product *pp; + int error; + uint32_t fcn = PCCARD_FUNCTION_UNSPEC; + + /* Make sure we're a network function */ + error = pccard_get_function(dev, &fcn); + if (error != 0) + return (error); + if (fcn != PCCARD_FUNCTION_NETWORK) + return (ENXIO); if ((pp = pccard_product_lookup(dev, ep_pccard_products, sizeof(ep_pccard_products[0]), NULL)) != NULL) { |