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
This commit is contained in:
Weongyo Jeong 2008-07-23 10:49:27 +00:00
parent 4522ac77de
commit 138ddff935

View File

@ -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;