This function initializes a timer object associated with a driver’s MiniportTimer function.
Header file: | Ndis.h |
Windows CE versions: | 2.0 and later |
VOID NdisMInitializeTimer( IN OUT PNDIS_MINIPORT_TIMER Timer, IN NDIS_HANDLE MiniportAdapterHandle,
IN PNDIS_TIMER_FUNCTION TimerFunction,
IN PVOID FunctionContext );
MiniportInitialize must call this function to set up the driver’s MiniportTimer function( s ), if any. MiniportInitialize must call this function before the driver passes the MiniportTimer pointer to any other NDIS timer function.
Drivers of NICs that do not generate interrupts initialize at least one timer object for a polling MiniportTimer function that monitors the NIC state for incoming receives and for send completions.
Calls to the NDIS timer functions insert the timer object in the system timer queue. Calls to the NdisMCancelTimer function dequeue the timer object if it is currently queued. Only one instantiation of a particular timer object can be queued at any given moment.
When a driver calls the NdisMSetTimer function, the timer object at Timer is queued until the interval specified in the call expires. When it does, the timer object is dequeued and the caller-supplied TimerFunction is run once at IRQL DISPATCH_LEVEL as soon as a processor becomes available. When a driver calls the NdisMSetPeriodicTimer function, the timer object is dequeued and the caller-supplied TimerFunction is run when the given interval expires. However, the timer object is automatically requeued for the same fixed interval, so MiniportTimer runs periodically, also at IRQL DISPATCH_LEVEL.
MiniportInitialize can call this function more than once to initialize more than one timer object, each associated with a distinct MiniportTimer function. For example, an NIC driver might have one MiniportTimer function that polls the NIC state periodically and another that the miniport uses only to time-out a particular operation on its NIC. Each such MiniportTimer function has different functionality, and each such function should be associated with a different timer object by calling this function from MiniportInitialize.
A driver that calls this function runs at IRQL PASSIVE_LEVEL.
NdisMCancelTimer, NdisMSetPeriodicTimer, NdisMSetTimer