Share via


MiniportTimer (Windows Embedded CE 6.0)

1/6/2010

MiniportTimer is a required function if a driver's NIC does not generate interrupts. Otherwise, one or more MiniportTimer functions are optional.

Syntax

VOID MiniportTimer(
  PVOID SystemSpecific1,
  PVOID FunctionContext,
  PVOID SystemSpecific2,
  PVOID SystemSpecific3
);

Parameters

  • SystemSpecific1
    [in] Points to a system-specific variable, which is opaque to MiniportTimer and reserved for system use.
  • SystemSpecific2
    [in] Points to a system-specific value that is reserved for system use.
  • SystemSpecific3
    [in] Points to a system-specific value that is reserved for system use.

Remarks

The driver of a NIC that does not generate interrupts must have a MiniportTimer function to poll the state of the NIC. After such a driver's MiniportInitialize function sets up the driver-allocated timer object with NdisMInitializeTimer, a call to NdisMSetPeriodicTimer causes the MiniportTimer function associated with the timer object to be run repeatedly and automatically at the interval specified by MillisecondsPeriod. Such a polling MiniportTimer function monitors the state of the NIC to determine when to make indications, when to complete pending sends, and so forth. In effect, such a polling MiniportTimer function has the same functionality as the MiniportHandleInterrupt function in the driver of a NIC that does generate interrupts.

By contrast, calling NdisMSetTimer causes the MiniportTimer function associated with the timer object to be run once when the given MillisecondsToDelay expires. Such a MiniportTimer function usually performs some driver-determined action if a particular operation times out.

If either type of MiniportTimer function shares resources with other driver functions, the driver should synchronize access to those resources with a spin lock.

Any NIC driver or intermediate driver can have more than one MiniportTimer function at the discretion of the driver writer. Each such MiniportTimer function must be associated with a driver-allocated and initialized timer object.

A call to NdisMCancelTimer cancels execution of non-polling MiniportTimer function, if the interval passed in the immediately preceding call to NdisMSetTimer has not yet expired. After a call to NdisMSetPeriodicTimer, a call to NdisMSetTimer or NdisMCancelTimer with the same timer object disables a polling MiniportTimer function: either the MiniportTimer function runs once, or it is canceled.

The MiniportHalt function of any driver with a MiniportTimer function should call NdisMCancelTimer to ensure that the MiniportTimer function does not attempt to access resources that MiniportHalt has already released.

Requirements

Header externs.h
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

NDIS Upper-Edge Functions
MiniportHalt
MiniportInitialize
NdisAcquireSpinLock
NdisAllocateSpinLock
NdisDprAcquireSpinLock
NdisMCancelTimer
NdisMInitializeTimer
NdisMSetPeriodicTimer
NdisMSetTimer