Поделиться через


MiniportTimer callback function

Note   NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

The MiniportTimer function is required if a miniport driver sets a timer.

Syntax

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

Parameters

  • SystemSpecific1 [in]
    Pointer to a system-specific variable, which is opaque to MiniportTimer and reserved for system use.

  • FunctionContext [in]
    Specifies the context pointer passed to NdisMInitializeTimer when MiniportInitialize set up the associated timer object.

  • SystemSpecific2 [in]
    Pointer to a system-specific value that is reserved for system use.

  • SystemSpecific3 [in]
    Pointer to a system-specific value that is reserved for system use.

Return value

None

Remarks

A miniport driver can 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.

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 a MiniportTimer function, provided that 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 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

Target platform

Desktop

Version

Not supported for NDIS 6.0 drivers in Windows Vista. Use NetTimerCallback instead. Supported for NDIS 5.1 drivers in Windows Vista and Microsoft Windows XP.

Header

Ndis.h (include Ndis.h)

IRQL

<= DISPATCH_LEVEL

See also

MiniportHalt

MiniportInitialize

NdisAcquireSpinLock

NdisAllocateSpinLock

NdisDprAcquireSpinLock

NdisMCancelTimer

NdisMInitializeTimer

NdisMSetPeriodicTimer

NdisMSetTimer

 

 

Send comments about this topic to Microsoft