diff options
author | wpaul <wpaul@FreeBSD.org> | 2005-10-26 06:52:57 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 2005-10-26 06:52:57 +0000 |
commit | a16098473846c54b54bd1b74ca434605687746c7 (patch) | |
tree | e7dba255548a2bef54a00de0a1224fb116f0d971 /sys/compat/ndis/kern_ndis.c | |
parent | fe60acc5023fa40342cc5c55c39c1a2efcbdfc82 (diff) | |
download | FreeBSD-src-a16098473846c54b54bd1b74ca434605687746c7.zip FreeBSD-src-a16098473846c54b54bd1b74ca434605687746c7.tar.gz |
Get rid of the timer tracking and reaping code in NdisMInitializeTimer()
and ndis_halt_nic(). It's been disabled for some time anyway, and
it turns out there's a possible deadlock in NdisMInitializeTimer() when
acquiring the miniport block lock to modify the timer list: it's
possible for a driver to call NdisMInitializeTimer() when the miniport
block lock has already been acquired by an earlier piece of code. You
can't acquire the same spinlock twice, so this can deadlock.
Also, implement MmMapIoSpace() and MmUnmapIoSpace(), and make
NdisMMapIoSpace() and NdisMUnmapIoSpace() use them. There are some
drivers that want MmMapIoSpace() and MmUnmapIoSpace() so that they can
map arbitrary register spaces not directly associated with their
device resources. For example, there's an Atheros driver for
a miniPci card (0x168C:0x1014) on the IBM Thinkpad x40 that wants
to map some I/O spaces at 0xF00000 and 0xE00000 which are held by
the acpi0 device. I don't know what it wants these ranges for,
but if it can't map and access them, the MiniportInitialize() method
fails.
Diffstat (limited to 'sys/compat/ndis/kern_ndis.c')
-rw-r--r-- | sys/compat/ndis/kern_ndis.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/sys/compat/ndis/kern_ndis.c b/sys/compat/ndis/kern_ndis.c index a5754b6..6e8b347 100644 --- a/sys/compat/ndis/kern_ndis.c +++ b/sys/compat/ndis/kern_ndis.c @@ -1108,8 +1108,6 @@ ndis_reset_nic(arg) return(0); } -#undef NDIS_REAP_TIMERS - int ndis_halt_nic(arg) void *arg; @@ -1117,9 +1115,6 @@ ndis_halt_nic(arg) struct ndis_softc *sc; ndis_handle adapter; ndis_halt_handler haltfunc; -#ifdef NDIS_REAP_TIMERS - ndis_miniport_timer *t, *n; -#endif ndis_miniport_block *block; int empty = 0; uint8_t irql; @@ -1127,24 +1122,6 @@ ndis_halt_nic(arg) sc = arg; block = sc->ndis_block; -#ifdef NDIS_REAP_TIMERS - /* - * Drivers are sometimes very lax about cancelling all - * their timers. Cancel them all ourselves, just to be - * safe. We must do this before invoking MiniportHalt(), - * since if we wait until after, the memory in which - * the timers reside will no longer be valid. - */ - - t = sc->ndis_block->nmb_timerlist; - while (t != NULL) { - KeCancelTimer(&t->nmt_ktimer); - n = t; - t = t->nmt_nexttimer; - n->nmt_nexttimer = NULL; - } - sc->ndis_block->nmb_timerlist = NULL; -#endif if (!cold) KeFlushQueuedDpcs(); |