NdisMSleep

VOID
NdisMSleep(
IN ULONG MicrosecondsToSleep
);

NdisMSleep delays execution of the caller for a given interval in microseconds.

Parameters

MicrosecondsToSleep

Specifies the number of microseconds to delay.

Comments

For the given MicrosecondsToSleep, the caller's thread of execution is put into a wait state, thereby allowing other threads to get work done on the current processor. When the given interval expires, the caller of NdisMSleep resumes execution.

An NDIS driver should always call NdisMSleep in preference to NdisStallExecution unless the driver is running at IRQL >= DISPATCH_LEVEL. NdisMSleep can accept a larger delay interval than NdisStallExecution, which should never be called with an interval greater than 50 microseconds.

NIC drivers can call NdisMSleep from their MiniportInitialize and, possibly, MiniportHalt functions when either function must wait for state changes to occur in the NIC before that function continues its operations.

Both NdisMSleep and NdisStallExecution allow a NIC driver to specify a delay consistently and independently of the clock speed of the host CPU. Neither function involves a timer object used by NdisSet(Periodic)Timer. The resolution of the host system clock varies, so very short delays can take slightly longer than the caller of NdisMSleep or NdisStallExecution specified.

Callers of NdisMSleep run at IRQL < DISPATCH_LEVEL.

See Also

MiniportHalt, MiniportInitialize, MiniportTimer, NdisMSetTimer, NdisMSetPeriodicTimer, NdisStallExecution, NdisWaitEvent