Share via


Registering a CheckForHang Handler (Windows Embedded CE 6.0)

1/6/2010

A miniport can optionally supply a MiniportCheckForHang function when it calls the NdisMRegisterMiniport function. If a miniport does not register such a handler, it relies on NDIS to detect whether its NIC has stopped responding.

If a miniport supplies a MiniportCheckForHang function, NDIS calls this function every two seconds or at a driver-requested timeout interval. MiniportCheckForHang determines whether the NIC has stopped responding. MiniportCheckForHang returns TRUE if it detects that the NIC has stopped responding; otherwise, it returns FALSE.

If a miniport does not register MiniportCheckForHang, NDIS concludes that a miniport has stopped responding if one of the following actions occurs:

  • A send packet has been pending longer than twice the timeout period. For example, the miniport was passed a packet to send, it returned NDIS_STATUS_PENDING, and did not call NdisMSendComplete for the pending packet in a period equal to twice the timeout period. This applies only to serialized miniports.
  • A request sent to MiniportQueryInformation or MiniportSetInformation has not completed in a period equal to twice the timeout period.

A miniport can change timeout parameters by calling NdisMSetAttributesEx rather than NdisMSetAttributes in its MiniportInitialize function. With NdisMSetAttributesEx, the miniport can perform the following functions:

  • Change the default two-second timeout interval to a driver-specified interval. NDIS will call the miniport's MiniportCheckForHang function at this new interval. Miniports for slow NICs can specify a timeout interval that is appropriate for the NIC.
  • Specify that NDIS ignore the packet timeout.
  • Specify that NDIS ignore the request timeout.

If the miniport specifies that NDIS should ignore packet timeout and request timeout, the miniport is responsible for detecting when a NIC is suspended.

If MiniportCheckForHang returns TRUE, or if a send or a request has been pending for more than twice the timeout period, NDIS calls MiniportReset.

See Also

Reference

MiniportCheckForHang
MiniportInitialize
MiniportQueryInformation
MiniportReset
MiniportSetInformation
NdisMRegisterMiniport
NdisMSendComplete
NdisMSetAttributes
NdisMSetAttributesEx

Concepts

Registering MiniportXXX Functions