다음을 통해 공유


MiniportResetEx (Compact 2013)

3/26/2014

NDIS calls a miniport driver's MiniportResetEx function to initiate a reset of a network adapter.

Syntax

NDIS_STATUS MiniportResetEx(
    NDIS_HANDLE  MiniportAdapterContext,
    PBOOLEAN  AddressingReset
);

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 a miniport adapter.
  • AddressingReset
    [out] A pointer to a Boolean variable. The driver sets this variable to TRUE if NDIS should call the MiniportOidRequest function to restore addressing information to the current values.

Return Value

MiniportResetEx can return one of the following status values:

  • NDIS_STATUS_SUCCESS
    MiniportResetEx successfully reset the miniport adapter to an operational state.
  • NDIS_STATUS_PENDING
    The driver will complete the reset operation asynchronously by calling the NdisMResetComplete function when the operation is complete.
  • NDIS_STATUS_RESET_IN_PROGRESS
    MiniportResetEx determined that the miniport adapter was currently being reset, so this call is superfluous.
  • NDIS_STATUS_SOFT_ERRORS
    MiniportResetEx successfully reset the miniport adapter but a recoverable error occurred during the operation. MiniportResetEx should have called the NdisWriteErrorLogEntry function that has more information about the error.
  • NDIS_STATUS_HARD_ERRORS
    MiniportResetEx tried to reset the miniport adapter but an unrecoverable error occurred during the operation. MiniportResetEx should have called NdisWriteErrorLogEntry with more information about the error.

Remarks

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

MiniportResetEx is not required for intermediate drivers.

MiniportResetEx can reset the parameters of the miniport adapter. If a reset causes a change in the miniport adapter's station address, the miniport driver automatically restores the prior value of the station address after the reset is complete. Any multicast or functional addressing masks, reset by the hardware, do not have to be reset in this function.

If a reset operation changes other information, such as multicast or functional addressing information, MiniportResetEx must set the variable at AddressingReset to TRUE before it returns. This causes NDIS to call the MiniportOidRequest function to restore the information. NDIS also restores the Wake on Lan (WoL) pattern list by calling OID_PNP_ADD_WAKE_UP_PATTERN. The driver should free the WoL pattern list from its adapter context because the hardware list is already reset.

NDIS will not abort any pending OID requests or send requests. If the driver can safely complete pending OID or send requests after a reset, the driver can hold pending OID or send requests until after the reset operation is complete. Otherwise, the driver should complete the pending OID or send requests by calling the NdisMOidRequestComplete or NdisMSendNetBufferListsComplete functions respectively before MiniportResetEx returns.

A miniport driver should not call the NdisMIndicateStatusEx function to signal the start and finish of each reset operation. NDIS notifies bound protocol drivers when a reset begins and ends.

If MiniportResetEx must wait for state changes in the miniport adapter during reset operations, it can call the NdisStallExecution function. However, a MiniportResetEx function must not call NdisStallExecution with a time interval larger than 50 microseconds. If the driver must wait longer than 50 microseconds (or if would poll), it should set a timer instead and return NDIS_STATUS_PENDING.

If MiniportResetEx returns NDIS_STATUS_PENDING, the driver must complete the reset by calling the NdisMResetComplete function.

MiniportResetEx can be preempted by an interrupt.

NDIS calls the MiniportCheckForHangEx function periodically to determine whether it should call MiniportResetEx. The default time-out for calling MiniportCheckForHangEx is two seconds. If this default is too short, a miniport driver can call the NdisMSetMiniportAttributes function during initialization to increase the time-out interval.

NDIS cannot determine whether a network adapter has stopped responding for receive operations. To handle this kind of failure, the MiniportCheckForHangEx function can monitor receive operations and, if it is necessary, return TRUE to force a reset.

NDIS calls MiniportResetEx at IRQL <= DISPATCH_LEVEL.

See Also

Reference

NDIS Miniport Driver Functions
MiniportCheckForHangEx
MiniportInitializeEx
MiniportOidRequest
NdisMIndicateStatusEx
NdisMRegisterMiniportDriver
NdisMOidRequestComplete
NdisMResetComplete
NdisMSendNetBufferListsComplete
NdisMSetMiniportAttributes
NdisStallExecution
NdisWriteErrorLogEntry