Protocol Binding States and Operations

An NDIS protocol driver must support the following operational states for each binding that the driver manages:

Unbound
The Unbound state is the initial state of a binding. In this state, the protocol driver waits for NDIS to call the ProtocolBindAdapterEx function.

Opening
In the Opening state, a protocol driver allocates resources for the binding and attempts to open the adapter.

Running
In the Running state, a protocol driver performs send and receive processing for a binding.

Closing
In the Closing state, the protocol driver closes the binding to the adapter and then releases the resources for the binding.

Pausing
In the Pausing state, a protocol driver completes any operations that are required to stop send and receive operations for a binding.

Paused
In the Paused state, the protocol driver does not perform send or receive operations for a binding.

Restarting
In the Restarting state, a protocol driver completes any operations that are required to restart send and receive operations for a binding.

In the following table, the headings represent the binding states, and events are listed in the first column. The rest of the entries in the table specify the next state that the binding enters after an event occurs within a state. The blank entries represent invalid event/state combinations.

Event \ State Unbound Opening Closing Paused Restarting Running Pausing

ProtocolBindAdapterEx

Opening

Bind failed

Unbound

Bind is complete

Paused

ProtocolUnbindAdapterEx

Closing

Unbind is complete

Unbound

PnP pause

Pausing

Pause is complete

Paused

PnP restart

Restarting

Restart is complete

Running

Restart failed

Paused

Send and receive operations

Running

Pausing

OID requests

Closing

Paused

Restarting

Running

Pausing

Note  The events listed in the preceding table are the primary events for an NDIS protocol binding. Additional events will be added to this table as the information becomes available.

The primary binding events are defined as follows:

ProtocolBindAdapterEx
After NDIS calls the driver's ProtocolBindAdapterEx function, the binding enters the Opening state. For more information, see Binding to an Adapter.

Bind failed
If the protocol driver fails to bind to the adapter, the binding returns to the Unbound state.

Bind is complete
If the driver successfully opens the adapter, the binding enters the Paused state. The driver completes the bind operation.

ProtocolUnbindAdapterEx
After NDIS calls the driver's ProtocolUnbindAdapterEx hander, the binding enters the Closing state. For more information, see Unbinding from an Adapter.

Unbind is complete
After the driver completes the unbind operation, the binding enters the Unbound state.

PnP Pause
After NDIS sends the protocol driver a network Plug and Play (PnP) pause event notification, the binding enters the Pausing state. For more information see Pausing a Binding.

Pause is complete
After the driver has completed all operations that are required to stop send and receive operations, the pause operation is complete and the binding is in the Paused state.

Note  The driver must wait for all its outstanding send requests to complete before the pause operation is complete.

PnP Restart
After NDIS sends the protocol driver a network PnP restart event notification, the binding enters the Restarting state. For more information, see Restarting a Binding.

Restart is complete
After the driver is ready to handle send and receive operations, the restart operation is complete and the binding is in the Running state.

Restart failed
If NDIS sends the protocol driver a network PnP restart event notification and the restart attempt fails, the binding returns to the Paused state.

Send and Receive Operations
A protocol driver must handle send and receive operations in the Running and Pausing states. For more information about send and receive operations, see Protocol Driver Send and Receive Operations.

OID Requests
A protocol driver can initiate OID requests to set or query information in underlying drivers. A protocol driver can initiate OID requests from all states, except Unbound and Opening.

Writing NDIS Protocol Drivers