summaryrefslogtreecommitdiffstats
path: root/sys/compat/ndis/kern_ndis.c
diff options
context:
space:
mode:
authorweongyo <weongyo@FreeBSD.org>2008-07-23 10:49:27 +0000
committerweongyo <weongyo@FreeBSD.org>2008-07-23 10:49:27 +0000
commit0293d4a27fab7e5e8177c40df0a10e477d426a8c (patch)
treefc9f3ee68d0324237491ce54ca3fc169e0d3b22d /sys/compat/ndis/kern_ndis.c
parent2620286140b697937520b92f540813fd844d2222 (diff)
downloadFreeBSD-src-0293d4a27fab7e5e8177c40df0a10e477d426a8c.zip
FreeBSD-src-0293d4a27fab7e5e8177c40df0a10e477d426a8c.tar.gz
when NDIS framework try to query/set informations NDIS drivers can
return NDIS_STATUS_PENDING. In this case, it's waiting for 5 secs to get the response from drivers now. However, some NDIS drivers can send the response before NDIS framework gets ready to receive it so we might always be blocked for 5 secs in current implementation. NDIS framework should reset the event before calling NDIS driver's callback not after. MFC after: 1 month
Diffstat (limited to 'sys/compat/ndis/kern_ndis.c')
-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