Initializing Intermediate Drivers to Handle PnP and Power Management Events

To handle Plug and Play (PnP) and power management events, NDIS intermediate drivers must do the following:

  • When NDIS calls the intermediate driver's ProtocolBindAdapterEx function, the BindParameters parameter points to an NDIS_PM_CAPABILITIES structure that contains the capabilities of the underlying miniport adapter. The power management capabilities are reported in one of the following members:

    • PowerManagementCapabilities

      For NDIS 6.0 and NDIS 6.1 intermediate drivers, this member contains the power management capabilities within an NDIS_PNP_CAPABILITIES structure. For more information about this structure, see OID_PNP_CAPABILITIES.

      Note For NDIS 6.20 and later intermediate drivers, the PowerManagementCapabilities member is set to NULL and the power management capabilities are reported in the PowerManagementCapabilitiesEx member.

    • PowerManagementCapabilitiesEx

      For NDIS 6.20 and later intermediate drivers, this member contains the power management capabilities within an NDIS_PM_CAPABILITIES structure.

      Note For NDIS 6.0 and NDIS 6.1 intermediate drivers, the PowerManagementCapabilitiesEx member is set to NULL and the power management capabilities are reported in the PowerManagementCapabilities member.

Note If the underlying miniport adapter does not support power management events, the PowerManagementCapabilities and PowerManagementCapabilitiesEx members are set to NULL.

  • When NDIS calls MiniportInitializeEx for each virtual miniport supported by the NDIS intermediate driver, the driver reports its power management capabilities by calling NdisMSetMiniportAttributes in the following ways:

    1. Depending on the version of the NDIS intermediate driver, the power management capabilities are reported in either the PowerManagementCapabilities member (for NDIS 6.0 and NDIS 6.1 intermediate drivers) or PowerManagementCapabilitiesEx member (for NDIS 6.20 and later intermediate drivers) of NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES. If either the PowerManagementCapabilities or PowerManagementCapabilitiesEx member of the NDIS_BIND_PARAMETERS structure is not NULL, the intermediate driver must do the following:

      • Save the original values of the MinMagicPacketWakeUp, MinPatternWakeUp, and MinLinkChangeWakeUp members of the PowerManagementCapabilities(NDIS 6.0 and NDIS 6.1) or PowerManagementCapabilitiesEx(NDIS 6.20 and later) members.

      • Disable the power management functionality by setting the MinMagicPacketWakeUp, MinPatternWakeUp, and MinLinkChangeWakeUp members to NdisDeviceStateUnspecified.

      • Pass the address of the modified NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES structure as the MiniportAttributes parameter in the call to NdisMSetMiniportAttributes.

    2. An intermediate driver must set the NDIS_MINIPORT_ATTRIBUTES_NO_HALT_ON_SUSPEND flag in the AttributeFlags member of the NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES structure. The driver must pass the address of this structure as the MiniportAttributes parameter in the call to NdisMSetMiniportAttributes.

    For more information about the initialization requirements of NDIS intermediate drivers, see Initializing Virtual Miniports.