MiniportRestart (Compact 7)
3/12/2014
This function initiates a restart request for a miniport adapter that is paused.
Syntax
NDIS_STATUS MiniportRestart(
NDIS_HANDLE MiniportAdapterContext,
PNDIS_MINIPORT_RESTART_PARAMETERS MiniportRestartParameters
);
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.
- MiniportRestartParameters
[in] A pointer to an NDIS_MINIPORT_RESTART_PARAMETERS structure that defines the restart parameters for the miniport adapter.
Return Value
MiniportRestart returns one of the following status values:
- NDIS_STATUS_SUCCESS
MiniportRestart successfully restarted the flow of network data through the miniport adapter.
- NDIS_STATUS_PENDING
MiniportRestart did not complete the restart operation and the operation will be completed asynchronously. The miniport driver must call the NdisMRestartComplete function when the operation is is completed.
- NDIS_STATUS_RESOURCES
MiniportRestart failed because of insufficient resources.
- NDIS_STATUS_FAILURE
None of the previous status values applies. In this situation, the driver should call the NdisWriteErrorLogEntry function by using parameters that specify the reason for the failure.
Remarks
A driver specifies the MiniportRestart entry point when it calls the NdisMRegisterMiniportDriver function.
The miniport adapter that is specified by the MiniportAdapterContext parameter enters the Restarting state when NDIS calls MiniportRestart.
When NDIS calls MiniportRestart, a miniport driver:
- Must complete any tasks that are required to resume send and receive operations.
- Optionally modifies the restart attributes that are specified in the RestartAttributes member of the NDIS_MINIPORT_RESTART_PARAMETERS structure. If the pointer in RestartAttributes is NULL, the miniport driver should not modify or add to the restart attributes list. If the pointer in RestartAttributes is non-NULL, it points to an NDIS_RESTART_ATTRIBUTES structure. If a miniport driver does not restart, it should not modify any attributes.
- Can provide status indications with the NdisMIndicateStatusEx function.
- Should handle status requests in the MiniportOidRequest function.
If a miniport driver modifies the list of restart attributes, the miniport driver:
- Can add new media-specific attributes to the list of restart attributes. In this situation, the miniport driver must allocate a new NDIS_RESTART_ATTRIBUTES structure-for example, with the NdisAllocateMemoryWithTagPriority function-and provide memory space for the new attributes. After propagating the restart attributes to overlying drivers, NDIS frees the attributes memory for the miniport drivers.
- Can modify the media-specific attributes in the list of restart attributes. If the miniport driver requires more memory space, it can free an NDIS_RESTART_ATTRIBUTES structure with the NdisFreeMemory function and allocate a new structure to contain the modified information. After propagating the restart attributes to overlying drivers, NDIS frees the attributes memory for the miniport drivers.
- Can modify any field in the NDIS_RESTART_GENERAL_ATTRIBUTES structure. When NDIS provides a non-NULL pointer in the RestartAttributes member of the NDIS_MINIPORT_RESTART_PARAMETERS structure, the attributes list contains one entry in which the Oid member in the NDIS_RESTART_ATTRIBUTES structure is OID_GEN_MINIPORT_RESTART_ATTRIBUTES and the Data member contains an NDIS_RESTART_GENERAL_ATTRIBUTES structure.
- Should make sure that the NDISNDIS_RESTART_GENERAL_ATTRIBUTES structure contains the correct information. To make sure that the NDIS_RESTART_GENERAL_ATTRIBUTES structure contains the required information, you should first determine the version of the structure by checking the Revision member in the NDIS_OBJECT_HEADER structure that is specified in the Header member of the NDIS_RESTART_GENERAL_ATTRIBUTES structure.
NDIS does not initiate other Plug and Play (PnP) operations for the miniport adapter, such as halt, initialize, power change, or a pause request, until the restart operation is complete.
After the miniport driver successfully restarts the send and receive operations, it must complete the restart operation. If the driver returns NDIS_STATUS_SUCCESS from MiniportRestart, the restart operation is complete. If the driver returns NDIS_STATUS_PENDING, it can continue restart operations. The restart operation is complete after the driver calls the NdisMRestartComplete function. After the restart operation is complete, the miniport adapter is in the Running state.
The miniport driver can resume indicating received packets for the miniport adapter immediately after NDIS calls MiniportRestart and before the driver calls NdisMRestartComplete. The miniport driver should be ready to accept send requests after the driver completes the restart request.
If the miniport driver does not restart the send and receive operations, the driver must return an appropriate failure status from MiniportRestart. In this situation, the driver must stop any send or receive operations that were started and then return to the Paused state.
NDIS calls MiniportRestart at IRQL = PASSIVE_LEVEL.
See Also
Reference
NDIS Miniport Driver Functions
MiniportInitializeEx
MiniportPause
MiniportOidRequest
NDIS_MINIPORT_RESTART_PARAMETERS
NDIS_OBJECT_HEADER
NDIS_RESTART_ATTRIBUTES
NDIS_RESTART_GENERAL_ATTRIBUTES
NdisAllocateMemoryWithTagPriority
NdisFreeMemory
NdisMIndicateStatusEx
NdisMRegisterMiniportDriver
NdisMRestartComplete
NdisWriteErrorLogEntry
OID_GEN_MINIPORT_RESTART_ATTRIBUTES