Registering NDIS Selective Suspend Handler Functions
If a miniport driver supports NDIS selective suspend, NDIS notifies the driver that the underlying network adapter has become idle. The miniport driver must provide the following functions to handle these idle notifications:
NDIS calls the MiniportIdleNotification handler function to notify the miniport driver that the network adapter has become idle. The miniport driver handles the idle notification by determining whether the network adapter can transition to a low-power state. The miniport driver performs this determination in a bus-specific manner.
For example, a USB miniport driver determines whether the network adapter can transition to a low-power state by issuing an I/O request packet (IRP) for a USB idle request (IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION) to the underlying USB bus driver. Through the processing of this IRP, the miniport driver is notified that the adapter is idle and can be transitioned to a low-power state.
NDIS calls the MiniportCancelIdleNotification handler function to cancel the outstanding idle notification. When this function is called, the miniport driver cancels any bus-specific IRPs that it may have previously issued for the idle notification.
For example, when MiniportCancelIdleNotification is called, the USB miniport must cancel the previously-issued USB idle request IRP. When the IRP is canceled, the miniport driver is notified that the adapter can now be transitioned to a full-power state.
When the miniport driver's DriverEntry function is called, the driver registers its NDIS selective suspend handler functions by following these steps:
The miniport driver must set the SetOptionsHandler member of the NDIS_MINIPORT_DRIVER_CHARACTERISTICS structure to the entry point for the driver's MiniportSetOptions function. The driver calls NdisMRegisterMiniportDriver to register its NDIS_MINIPORT_DRIVER_CHARACTERISTICS structure with NDIS.
When MiniportSetOptions is called, the miniport driver initializes an NDIS_MINIPORT_SS_CHARACTERISTICS structure with pointers to the handler functions. The miniport driver then calls NdisSetOptionalHandlers and sets the OptionalHandlers parameter to a pointer to the NDIS_MINIPORT_SS_CHARACTERISTICS structure.
For more information on how to handle idle notifications for NDIS selective suspend, see NDIS Selective Suspend Idle Notifications.