diff options
author | wpaul <wpaul@FreeBSD.org> | 2005-05-08 23:07:51 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 2005-05-08 23:07:51 +0000 |
commit | ebc77ad8939abbd4361290c615b7ad4b3c52fdfb (patch) | |
tree | 4e6bc7c75c9d9968ddf02e3220b8910641043fbb /usr.sbin | |
parent | 072d05d6e995d5d2aece606732e0048517a31cd9 (diff) | |
download | FreeBSD-src-ebc77ad8939abbd4361290c615b7ad4b3c52fdfb.zip FreeBSD-src-ebc77ad8939abbd4361290c615b7ad4b3c52fdfb.tar.gz |
Fix support for Windows drivers that support both PCI and PCMCIA devices at
the same time.
Fix if_ndis_pccard.c so that it sets sc->ndis_dobj and sc->ndis_regvals.
Correct IMPORT_SFUNC() macros for the READ_PORT_BUFFER_xxx() routines,
which take 3 arguments, not 2.
This fixes it so that the Windows driver for my Cisco Aironet 340 PCMCIA
card works again. (Yes, I know the an(4) driver supports this card natively,
but it's the only PCMCIA device I have with a Windows XP driver.)
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ndiscvt/windrv_stub.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/usr.sbin/ndiscvt/windrv_stub.c b/usr.sbin/ndiscvt/windrv_stub.c index 2097e50..30e74bf 100644 --- a/usr.sbin/ndiscvt/windrv_stub.c +++ b/usr.sbin/ndiscvt/windrv_stub.c @@ -71,14 +71,14 @@ struct ndis_pccard_type { #ifdef NDIS_PCI_DEV_TABLE -static struct ndis_pci_type ndis_devs[] = { +static struct ndis_pci_type ndis_devs_pci[] = { NDIS_PCI_DEV_TABLE { 0, 0, 0, NULL } }; #endif #ifdef NDIS_PCMCIA_DEV_TABLE -static struct ndis_pccard_type ndis_devs[] = { +static struct ndis_pccard_type ndis_devs_pccard[] = { NDIS_PCMCIA_DEV_TABLE { NULL, NULL, NULL } }; @@ -206,15 +206,6 @@ windrv_modevent(mod, cmd, arg) int error = 0; vm_offset_t drv_data_start; vm_offset_t drv_data_end; - interface_type drv_type; - -#ifdef NDIS_PCI_DEV_TABLE - drv_type = PCIBus; -#endif - -#ifdef NDIS_PCMCIA_DEV_TABLE - drv_type = PCMCIABus; -#endif drv_data_start = (vm_offset_t)&DRV_DATA_START; drv_data_end = (vm_offset_t)&DRV_DATA_END; @@ -225,14 +216,25 @@ windrv_modevent(mod, cmd, arg) windrv_loaded++; if (windrv_loaded > 1) break; - windrv_load(mod, drv_data_start, drv_data_len, drv_type, - ndis_devs, &ndis_regvals); +#ifdef NDIS_PCI_DEV_TABLE + windrv_load(mod, drv_data_start, drv_data_len, PCIBus, + ndis_devs_pci, &ndis_regvals); +#endif +#ifdef NDIS_PCMCIA_DEV_TABLE + windrv_load(mod, drv_data_start, drv_data_len, PCMCIABus, + ndis_devs_pccard, &ndis_regvals); +#endif break; case MOD_UNLOAD: windrv_loaded--; if (windrv_loaded > 0) break; +#ifdef NDIS_PCI_DEV_TABLE windrv_unload(mod, drv_data_start, drv_data_len); +#endif +#ifdef NDIS_PCMCIA_DEV_TABLE + windrv_unload(mod, drv_data_start, drv_data_len); +#endif break; case MOD_SHUTDOWN: break; |