diff options
author | wpaul <wpaul@FreeBSD.org> | 2004-01-04 21:22:25 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 2004-01-04 21:22:25 +0000 |
commit | 389bb3f2740d927f4df014cafb327e374ba754f2 (patch) | |
tree | 22f4c945c9ab9acae545b55eb3a4bb09cce9f538 /sys/compat/ndis/subr_ndis.c | |
parent | d6c42f745d60bfd8defbb5aa613bfa4dd51e2731 (diff) | |
download | FreeBSD-src-389bb3f2740d927f4df014cafb327e374ba754f2.zip FreeBSD-src-389bb3f2740d927f4df014cafb327e374ba754f2.tar.gz |
Modify if_ndis.c so that the MiniportISR function runs in ndis_intr()
and MiniportHandleInterrupt() is fired off later via a task queue in
ndis_intrtask(). This more accurately follows the NDIS interrupt handling
model, where the ISR does a minimal amount of work in interrupt context
and the handler is defered and run at a lower priority.
Create a separate ndis_intrmtx mutex just for the guarding the ISR.
Modify NdisSynchronizeWithInterrupt() to aquire the ndis_intrmtx
mutex before invoking the synchronized procedure. (The purpose of
this function is to provide mutual exclusion for code that shares
variables with the ISR.)
Modify NdisMRegisterInterrupt() to save a pointer to the miniport
block in the ndis_miniport_interrupt structure so that
NdisSynchronizeWithInterrupt() can grab it later and derive
ndis_intrmtx from it.
Diffstat (limited to 'sys/compat/ndis/subr_ndis.c')
-rw-r--r-- | sys/compat/ndis/subr_ndis.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/compat/ndis/subr_ndis.c b/sys/compat/ndis/subr_ndis.c index 03ab318..218445a 100644 --- a/sys/compat/ndis/subr_ndis.c +++ b/sys/compat/ndis/subr_ndis.c @@ -1894,7 +1894,7 @@ ndis_register_intr(intr, adapter, ivec, ilevel, reqisr, shared, imode) uint8_t shared; ndis_interrupt_mode imode; { - + intr->ni_block = adapter; return(NDIS_STATUS_SUCCESS); } @@ -2124,13 +2124,20 @@ ndis_sync_with_intr(intr, syncfunc, syncctx) void *syncfunc; void *syncctx; { + struct ndis_softc *sc; __stdcall uint8_t (*sync)(void *); + uint8_t rval; if (syncfunc == NULL || syncctx == NULL) return(0); + sc = (struct ndis_softc *)intr->ni_block->nmb_ifp; sync = syncfunc; - return(sync(syncctx)); + mtx_lock(&sc->ndis_intrmtx); + rval = sync(syncctx); + mtx_unlock(&sc->ndis_intrmtx); + + return(rval); } /* |