Indicating Connection Status (NDIS 5.1)

Note   NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

A miniport driver calls NdisMIndicateStatusor NdisMCoIndicateStatusto indicate a change in the media connection status. The miniport driver passes one of the following status indications to NdisMCoIndicateStatus:

  • NDIS_STATUS_MEDIA_CONNECT
    Indicates a media connection status change from disconnected to connected. A media connect status change occurs when a disconnected adapter makes a network connection. For example, the adapter connects when it comes within range (for a wireless adapter), or the user connects the network cable.

  • NDIS_STATUS_MEDIA_DISCONNECT
    Indicates a media connection status change from connected to disconnected. A media disconnect status change occurs when a connected adapter looses a network connection. For example, the adapter looses the connection because it is out of range (for a wireless adapter), or the user unplugs the network cable.

Unless specified otherwise, miniport drivers should indicate media connection status changes within two seconds after detecting the status change.

A miniport driver can check the media connection status while performing certain operations (see the following list). If the status is the same after the operation is complete as it was before the operation started, it is not necessary for the miniport driver to report any status changes that might occurred during the operation.

Additional requirements for indicating media connection status changes for miniport drivers are as follows:

  • Resetting
    NDIS calls MiniportReset to reset a miniport driver. The miniport driver can complete the reset either synchronously or asynchronously.

    If the media connection status is different after resetting, the driver should indicate the status within two seconds after completing the reset.

    A miniport driver should not complete the reset operation until it has determined the media connection status.

  • Halting
    A miniport driver must not indicate any media connection status changes when NDIS calls MiniportHalt.

  • Initializing
    NDIS calls a miniport driver's MiniportInitialize function to initialize an adapter.

    If the miniport driver does not indicate the media connection status after returning from MiniportInitialize, NDIS will proceed as if the adapter is connected.

    If an adapter is connected after NDIS calls MiniportInitialize, the miniport driver can indicate NDIS_STATUS_MEDIA_CONNECT within five seconds after it returns from MiniportInitialize.

    If an adapter is disconnected after NDIS calls MiniportInitialize, the miniport driver should indicate NDIS_STATUS_MEDIA_DISCONNECT within two seconds after it returns from MiniportInitialize.

    While initializing, the miniport driver should process OID_GEN_MEDIA_CONNECT_STATUS or OID_GEN_CO_MEDIA_CONNECT_STATUS requests asynchronously. The miniport driver should not complete such requests until after it has determined the connection status.

    Determination of the media connection status should not delay initialization. If necessary, the miniport driver should initiate the process to determine the connection status within MiniportInitialize, and complete the process at a later time. For example, the miniport driver could set a timer to poll the adapter for the connection status.

    A deserialized miniport driver can indicate a media disconnect during initialization whereas a serialized miniport driver should not.

  • Sleeping
    A miniport driver enters a network sleep state when it receives an OID_PNP_SET_POWER request to set a device power state of D1, D2, or D3.

    A miniport driver must not indicate any media connection status changes when it enters a sleep state or while it is in a sleeping state.

  • Waking
    A miniport driver wakes from a sleep state when it receives an OID_PNP_SET_POWER request to set the device power state to D0.

    If the adapter's media connection status after waking is the same as the status was prior to sleeping, the miniport driver should not indicate a media connection status change. If the connection status changed, the miniport driver should indicate the new connection status within two seconds after waking.

    While waking, the miniport driver should process OID_GEN_MEDIA_CONNECT_STATUS or OID_GEN_CO_MEDIA_CONNECT_STATUS requests asynchronously. The miniport driver should not complete such requests until after it has determined the connection status.

    Note   Token-ring miniport drivers are allowed 30 seconds to indicate the media connection status. This applies to all cases in this topic that require drivers to respond within two seconds (or five seconds for initializing).

     

 

 

Send comments about this topic to Microsoft