summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2005-05-08 23:19:20 +0000
committerwpaul <wpaul@FreeBSD.org>2005-05-08 23:19:20 +0000
commit51b4d0ab7185a276a61d4152968bb0e56b681b12 (patch)
treeb0411028ee76fc24e1a194e837f7f1f5b41bab82
parentebc77ad8939abbd4361290c615b7ad4b3c52fdfb (diff)
downloadFreeBSD-src-51b4d0ab7185a276a61d4152968bb0e56b681b12.zip
FreeBSD-src-51b4d0ab7185a276a61d4152968bb0e56b681b12.tar.gz
More fixes for multibus drivers. When calling out to the match
function in if_ndis_pci.c and if_ndis_pccard.c, provide the bustype too so the stubs can ignore devlists that don't concern them.
-rw-r--r--sys/compat/ndis/kern_windrv.c2
-rw-r--r--sys/compat/ndis/ntoskrnl_var.h2
-rw-r--r--sys/dev/if_ndis/if_ndis_pccard.c9
-rw-r--r--sys/dev/if_ndis/if_ndis_pci.c9
4 files changed, 16 insertions, 6 deletions
diff --git a/sys/compat/ndis/kern_windrv.c b/sys/compat/ndis/kern_windrv.c
index afaf638..06a48e5 100644
--- a/sys/compat/ndis/kern_windrv.c
+++ b/sys/compat/ndis/kern_windrv.c
@@ -204,7 +204,7 @@ windrv_match(matchfunc, ctx)
STAILQ_FOREACH(d, &drvdb_head, link) {
if (d->windrv_devlist == NULL)
continue;
- match = matchfunc(d->windrv_devlist, ctx);
+ match = matchfunc(d->windrv_bustype, d->windrv_devlist, ctx);
if (match == TRUE) {
mtx_unlock(&drvdb_mtx);
return(d);
diff --git a/sys/compat/ndis/ntoskrnl_var.h b/sys/compat/ndis/ntoskrnl_var.h
index db736fa..3db1e4e 100644
--- a/sys/compat/ndis/ntoskrnl_var.h
+++ b/sys/compat/ndis/ntoskrnl_var.h
@@ -1225,7 +1225,7 @@ struct drvdb_ent {
extern image_patch_table ntoskrnl_functbl[];
typedef void (*funcptr)(void);
-typedef int (*matchfuncptr)(void *, void *);
+typedef int (*matchfuncptr)(interface_type, void *, void *);
__BEGIN_DECLS
extern int windrv_libinit(void);
diff --git a/sys/dev/if_ndis/if_ndis_pccard.c b/sys/dev/if_ndis/if_ndis_pccard.c
index 1963ff8..b0846e8 100644
--- a/sys/dev/if_ndis/if_ndis_pccard.c
+++ b/sys/dev/if_ndis/if_ndis_pccard.c
@@ -69,7 +69,8 @@ static int ndis_probe_pccard (device_t);
static int ndis_attach_pccard (device_t);
static struct resource_list *ndis_get_resource_list
(device_t, device_t);
-static int ndis_devcompare (struct ndis_pccard_type *, device_t);
+static int ndis_devcompare (interface_type,
+ struct ndis_pccard_type *, device_t);
extern int ndisdrv_modevent (module_t, int, void *);
extern int ndis_attach (device_t);
extern int ndis_shutdown (device_t);
@@ -111,13 +112,17 @@ static devclass_t ndis_devclass;
DRIVER_MODULE(ndis, pccard, ndis_driver, ndis_devclass, ndisdrv_modevent, 0);
static int
-ndis_devcompare(t, dev)
+ndis_devcompare(bustype, t, dev)
+ interface_type bustype;
struct ndis_pccard_type *t;
device_t dev;
{
const char *prodstr, *vendstr;
int error;
+ if (bustype != PCMCIABus)
+ return(FALSE);
+
error = pccard_get_product_str(dev, &prodstr);
if (error)
return(FALSE);
diff --git a/sys/dev/if_ndis/if_ndis_pci.c b/sys/dev/if_ndis/if_ndis_pci.c
index 81878f4..e54cb61 100644
--- a/sys/dev/if_ndis/if_ndis_pci.c
+++ b/sys/dev/if_ndis/if_ndis_pci.c
@@ -68,7 +68,8 @@ static int ndis_probe_pci (device_t);
static int ndis_attach_pci (device_t);
static struct resource_list *ndis_get_resource_list
(device_t, device_t);
-static int ndis_devcompare (struct ndis_pci_type *, device_t);
+static int ndis_devcompare (interface_type,
+ struct ndis_pci_type *, device_t);
extern int ndisdrv_modevent (module_t, int, void *);
extern int ndis_attach (device_t);
extern int ndis_shutdown (device_t);
@@ -103,10 +104,14 @@ DRIVER_MODULE(ndis, pci, ndis_driver, ndis_devclass, ndisdrv_modevent, 0);
DRIVER_MODULE(ndis, cardbus, ndis_driver, ndis_devclass, ndisdrv_modevent, 0);
static int
-ndis_devcompare(t, dev)
+ndis_devcompare(bustype, t, dev)
+ interface_type bustype;
struct ndis_pci_type *t;
device_t dev;
{
+ if (bustype != PCIBus)
+ return(FALSE);
+
while(t->ndis_name != NULL) {
if ((pci_get_vendor(dev) == t->ndis_vid) &&
(pci_get_device(dev) == t->ndis_did) &&
OpenPOWER on IntegriCloud