From e70c40732991e1d57670efa4f8910dc0a2330822 Mon Sep 17 00:00:00 2001 From: imp Date: Thu, 20 Jan 2005 19:56:22 +0000 Subject: [PATCH] Only attach to network functions (unlikely to matter since I'm not aware of any multi-function cs cards, but it doesn't hurt). --- sys/dev/cs/if_cs_pccard.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/dev/cs/if_cs_pccard.c b/sys/dev/cs/if_cs_pccard.c index dbd3e54aad14..c7b3eca51ef5 100644 --- a/sys/dev/cs/if_cs_pccard.c +++ b/sys/dev/cs/if_cs_pccard.c @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "card_if.h" #include "pccarddevs.h" @@ -57,6 +58,15 @@ static int cs_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, cs_pccard_products, sizeof(cs_pccard_products[0]), NULL)) != NULL) {