summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/ndis/kern_ndis.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/compat/ndis/kern_ndis.c b/sys/compat/ndis/kern_ndis.c
index 0720dda..2c7d037 100644
--- a/sys/compat/ndis/kern_ndis.c
+++ b/sys/compat/ndis/kern_ndis.c
@@ -876,6 +876,8 @@ ndis_set_info(arg, oid, buf, buflen)
sc = arg;
+ KeResetEvent(&sc->ndis_block->nmb_setevent);
+
KeAcquireSpinLock(&sc->ndis_block->nmb_lock, &irql);
if (sc->ndis_block->nmb_pendingreq != NULL) {
@@ -904,7 +906,6 @@ ndis_set_info(arg, oid, buf, buflen)
if (rval == NDIS_STATUS_PENDING) {
/* Wait up to 5 seconds. */
duetime = (5 * 1000000) * -10;
- KeResetEvent(&sc->ndis_block->nmb_setevent);
KeWaitForSingleObject(&sc->ndis_block->nmb_setevent,
0, 0, FALSE, &duetime);
rval = sc->ndis_block->nmb_setstat;
@@ -1097,6 +1098,8 @@ ndis_reset_nic(arg)
NDIS_UNLOCK(sc);
+ KeResetEvent(&sc->ndis_block->nmb_resetevent);
+
if (NDIS_SERIALIZED(sc->ndis_block))
KeAcquireSpinLock(&sc->ndis_block->nmb_lock, &irql);
@@ -1105,11 +1108,9 @@ ndis_reset_nic(arg)
if (NDIS_SERIALIZED(sc->ndis_block))
KeReleaseSpinLock(&sc->ndis_block->nmb_lock, irql);
- if (rval == NDIS_STATUS_PENDING) {
- KeResetEvent(&sc->ndis_block->nmb_resetevent);
+ if (rval == NDIS_STATUS_PENDING)
KeWaitForSingleObject(&sc->ndis_block->nmb_resetevent,
0, 0, FALSE, NULL);
- }
return(0);
}
@@ -1298,6 +1299,8 @@ ndis_get_info(arg, oid, buf, buflen)
sc = arg;
+ KeResetEvent(&sc->ndis_block->nmb_getevent);
+
KeAcquireSpinLock(&sc->ndis_block->nmb_lock, &irql);
if (sc->ndis_block->nmb_pendingreq != NULL) {
@@ -1328,7 +1331,6 @@ ndis_get_info(arg, oid, buf, buflen)
if (rval == NDIS_STATUS_PENDING) {
/* Wait up to 5 seconds. */
duetime = (5 * 1000000) * -10;
- KeResetEvent(&sc->ndis_block->nmb_getevent);
KeWaitForSingleObject(&sc->ndis_block->nmb_getevent,
0, 0, FALSE, &duetime);
rval = sc->ndis_block->nmb_getstat;
OpenPOWER on IntegriCloud