NDIS_POLL callback function (poll.h)

Miniport drivers implement the NdisPoll callback function that NDIS will poll for receive indications and send completions.

Syntax

NDIS_POLL NdisPoll;

void() NdisPoll(
  [_In_]    void *Context,
  [_Inout_] NDIS_POLL_DATA *PollData
)
{...}

Parameters

[_In_] Context

A pointer to the context information that the driver provided when it created the Poll object.

[_Inout_] PollData

A pointer to an NDIS_POLL_DATA structure that the driver should use to perform receive indications and send completions. It also contains details about how many NBLs need to be indicated.

Remarks

Miniport drivers register the NdisPoll callback during miniport adapter initialization. Drivers specify an entry point for the NdisPoll function at the PollHandler parameter of the NDIS_POLL_CHARACTERISTICS structure before calling NdisRegisterPoll.

NDIS will first invoke the NdisPoll callback when the driver calls NdisRequestPoll. NDIS will keep invoking NdisPoll while the driver is making forward progress on receive indications or transmit completions.

The NdisPoll callback may be invoked at both PASSIVE_LEVEL and DISPATCH_LEVEL IRQL. The driver shouldn't make assumptions about which level it will be.

The driver must check the receive or transmit parameters of the NDIS_POLL_DATA structure to get the maximum number of NBLs it can indicate or complete.

For receive indications, the driver should:

  1. Fetch up to the maximum number of Rx packets it can indicate.
  2. Initialize the NBLs.
  3. Add them to the NBL queue provided by the NDIS_POLL_RECEIVE_DATA structure (located in the NDIS_POLL_DATA structure of the NdisPoll PollData parameter).
  4. Exit the callback.

For transmit completions, the driver should:

  1. Fetch up to the maximum number of Tx packets it can complete.
  2. Complete the NBLs.
  3. Add them to the NBL queue provided by the NDIS_POLL_TRANSMIT_DATA structure (located in the NDIS_POLL_DATA structure of the NdisPoll PollData parameter).
  4. Exit the callback.

The driver should not enable the Poll object's interrupt before exiting the NdisPoll function. NDIS will keep polling the driver until it assesses that no forward progress is being made. At this point NDIS will stop polling and ask the driver to reenable the interrupt by invoking the NdisSetPollNotification callback.

Requirements

Requirement Value
Minimum supported client Windows 11
Minimum supported server Windows Server 2022
Header poll.h (include ndis.h)
IRQL <= DISPATCH_LEVEL

See also

NdisSetPollNotification

NDIS_POLL_CHARACTERISTICS

NDIS_POLL_DATA

NDIS_POLL_RECEIVE_DATA

NdisRegisterPoll

NdisRequestPoll