Partager via


MiniportPause (Compact 2013)

3/26/2014

NDIS calls a miniport driver's MiniportPause function to stop the flow of network data through a specified miniport adapter.

Syntax

NDIS_STATUS  MiniportPause(
    NDIS_HANDLE  MiniportAdapterContext,
    PNDIS_MINIPORT_PAUSE_PARAMETERS  MiniportPauseParameters
);

Parameters

  • MiniportAdapterContext
    [in] A handle to a context area that the miniport driver allocated in its MiniportInitializeEx function. The miniport driver uses this context area to maintain state information for an miniport adapter.

Return Value

MiniportPause returns one of the following status values:

  • NDIS_STATUS_SUCCESS
    MiniportPause successfully stopped the flow of network data through the miniport adapter.
  • NDIS_STATUS_PENDING
    MiniportPause did not complete the pause operation and the operation will be completed asynchronously. The miniport driver must call the NdisMPauseComplete function when the operation is complete.

Remarks

A driver specifies the MiniportPause entry point when it calls the NdisMRegisterMiniportDriver function.

NDIS pauses a miniport adapter to stop data flow that could interfere with PnP operations such as adding or removing a filter driver, or binding or unbinding a protocol driver.

NDIS calls a miniport driver's MiniportPause function to initiate a pause request for the miniport adapter specified at MiniportAdapterContext. The miniport adapter remains in the Pausing state until the pause operation is complete.

For a miniport adapter in the Pausing state, the miniport driver:

  • Waits for all calls to the NdisMIndicateReceiveNetBufferLists function to return.
  • Waits for NDIS to return the ownership of all NET_BUFFER_LIST structures from outstanding receive indications to the miniport driver's MiniportReturnNetBufferLists function.
  • Completes all outstanding send requests and calls the NdisMSendNetBufferListsComplete function for all the outstanding send requests.
  • Rejects all new send requests made to its MiniportSendNetBufferLists function immediately by calling NdisMSendNetBufferListsComplete. It should set the complete status in each NET_BUFFER_LIST to NDIS_STATUS_PAUSED.
  • Can provide status indications with the NdisMIndicateStatusEx function.
  • Should handle OID requests in the MiniportOidRequest function.
  • Should not stop the miniport adapter completely if stopping the miniport adapter prevents the driver from handling requests or providing status indications.
  • Should not free the resources the driver allocated during initialization.

NDIS does not initiate other PnP operations for the miniport adapter, such as halt, initialize, power change, pause, or a restart requests, while the miniport adapter is in the Pausing state. NDIS can initiate these PnP operations after a miniport adapter is in the Paused state.

After a miniport driver completes all outstanding send requests and NDIS returns all received network data structures (from outstanding receive indications), the driver must complete the pause operation. If the driver returns NDIS_STATUS_SUCCESS from MiniportPause, the pause operation is complete. If the driver returns NDIS_STATUS_PENDING, the miniport adapter can remain in the Pausing state and the pause operation is complete after the driver calls the NdisMPauseComplete function. After the pause operation is complete, the miniport adapter is in the Paused state.

For a miniport adapter in the Paused state, the miniport driver:

  • Must reject all send requests made to MiniportSendNetBufferLists immediately by calling NdisMSendNetBufferListsComplete. It should set the Status member in each NET_BUFFER_LIST to NDIS_STATUS_PAUSED.
  • Can handle receive interrupts (see the MiniportInterrupt function) and interrupt DPCs (see the MiniportInterruptDPC function), but should not indicate received network data.
  • Can provide status indications with the NdisMIndicateStatusEx function.
  • Should handle OID requests in the MiniportOidRequest function.
  • Should handle requests to change the device power state in the MiniportDevicePnPEventNotify function.
  • Can handle calls to NetTimerCallback functions.
  • Can handle requests to reset the hardware in the MiniportResetEx function.

Miniport drivers cannot fail a pause request. Therefore, if a miniport driver requires any resources to handle a pause request, it should preallocate the resources during initialization.

NDIS calls the MiniportRestart function to initiate a restart request for a miniport adapter that is paused.

NDIS calls MiniportPause at IRQL = PASSIVE_LEVEL.

See Also

Reference

NDIS Miniport Driver Functions
MiniportInitializeEx
MiniportDevicePnPEventNotify
MiniportResetEx
MiniportRestart
NDIS_MINIPORT_PAUSE_PARAMETERS
NdisMIndicateReceiveNetBufferLists
NdisMIndicateStatusEx
NdisMPauseComplete
NdisMRegisterMiniportDriver
NdisMSendNetBufferListsComplete
NET_BUFFER_LIST
NetTimerCallback