Microsoft Windows CE 3.0  

MiniportReset

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

MiniportResetis a required function that issues a hardware reset to the network adapter and/or resets the driver's software state.

NDIS_STATUS
MiniportReset(
OUT PBOOLEAN
AddressingReset
,
IN NDIS_HANDLE
MiniportAdapterContext
);

Parameters

AddressingReset
Points to a variable that MiniportResetsets to TRUE if the NDIS library should call MiniportSetInformationto restore addressing information to the current values.
MiniportAdapterContext
Specifies the handle to a miniport-allocated context area in which the driver maintains per-network adapter state, set up by MiniportInitialize.

Return Values

MiniportResetcan return one of the following:

NDIS_STATUS_SUCCESS
MiniportResetsuccessfully reset the network adapter to an operational state.
NDIS_STATUS_PENDING
The driver will complete the reset operation asynchronously by calling NdisMResetCompletewhen the operation is done.
NDIS_STATUS_NOT_RESETTABLE
The network adapter does not provide reset capabilities under software control.
NDIS_STATUS_RESET_IN_PROGRESS
MiniportResetdetermined that the network adapter was currently being reset, so this call is superfluous.
NDIS_STATUS_SOFT_ERRORS
MiniportResetsuccessfully reset the network adapter but a recoverable error occurred during the operation. MiniportResethas called NdisWriteErrorLogEntrywith more information about the error.
NDIS_STATUS_HARD_ERRORS
MiniportResetattempted to reset the network adapter but an unrecoverable error occurred during the operation. MiniportResethas called NdisWriteErrorLogEntrywith more information about the error.

Comments

MiniportResetcan reset the parameters of its network adapter. If a reset causes a change in the network adapter's station address, the miniport automatically restores the station address following the reset to its prior value. Any multicast or functional addressing masks reset by the hardware do not have to be reset in this function.

If other information, such as multicast or functional addressing information or the lookahead size, is changed by a reset, MiniportResetmust set the variable at AddressingResetto TRUE before it returns control. This causes NDIS to call the MiniportSetInformationfunction to restore the information.

As a general rule, the MiniportResetfunction of an NDIS intermediate driver should always set AddressingResetto TRUE. Until the underlying network adapter driver resets its network adapter, such an intermediate driver cannot determine whether it must restore addressing information for its virtual network adapter. Because an intermediate driver disables the NDIS library's timing out of queued sends and requests to itself with an initialization-time call to NdisMSetAttributesEx, such a driver's MiniportResetfunction is called only when a reset request is directed to the underlying network adapter driver.

Intermediate drivers that layer themselves above other types of device drivers also must have a MiniportResetfunction. Such a MiniportResetfunction must handle reset requests initiated by protocol drivers' calls to NdisReset. If the intermediate driver also has a MiniportCheckForHangfunction, its MiniportResetfunction will be called whenever MiniportCheckForHangreturns TRUE.

It is unnecessary for a driver to complete outstanding requests before MiniportResetbegins resetting the network adapter or updating its software state. NDIS submits no further requests to the miniport for the network adapter designated by the MiniportAdapterContexthandle when NDIS has called MiniportResetuntil the reset operation is completed. A miniport need not call NdisMIndicateStatusto signal the start and finish of each reset operation because NDIS notifies bound protocols when a reset begins and ends.

If MiniportResetmust wait for state changes in the network adapter during reset operations, it can call NdisStallExecution. However, a MiniportResetfunction should nevercall NdisStallExecutionwith an interval greater than 50 microseconds.

If MiniportResetreturns NDIS_STATUS_PENDING, the driver must complete the original request subsequently with a call to NdisMResetComplete.

MiniportResetcan be pre-empted by an interrupt.

If a network adapter driver supplies a MiniportCheckForHangfunction, the NDIS library calls it periodically to determine whether to call the driver's MiniportResetfunction. Otherwise, the NDIS library calls a network adapter driver's MiniportResetfunction whenever requests NDIS submitted to the MiniportQueryInformation, MiniportSetInformation, MiniportSend, or MiniportWanSendfunctions seem to have timed out. By default, the NDIS-determined time-out interval for outstanding sends and requests is around four seconds. If this default is too short, a network adapter driver can make an initialization-time call to NdisMSetAttributesEx, rather than NdisMSetAttributes, to lengthen the time-out interval to suit its network adapter.

Every NDIS intermediate driver should call NdisMSetAttributesExfrom MiniportInitializeand disable NDIS's attempts to time out requests and sends in the intermediate driver. NDIS runs an intermediate driver's MiniportCheckForHangfunction, if any, approximately every two seconds.

NDIS cannot determine whether a network adapter might be hung on receives, so supplying a MiniportCheckForHangfunction allows a driver to monitor its network adapter for this condition and to force a reset if it occurs.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later Ndis.h   Ndislib.lib
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

MiniportCheckForHang, MiniportInitialize, MiniportQueryInformation, MiniportSend, MiniportSetInformation, MiniportWanSend, NdisMIndicateStatus, NdisMResetComplete, NdisMSetAttributes, NdisMSetAttributesEx, NdisStallExecution, NdisWriteErrorLogEntry