Handling OID_PNP_Xxx Queries and Sets

The virtual miniport of an intermediate driver must export the MiniportOidRequest function. NDIS calls the intermediate driver's MiniportOidRequest function when an overlying driver that is bound to the intermediate driver's virtual miniport calls NdisOidRequest to query or set information objects (OID_Xxx). NDIS can also call MiniportOidRequest on its own behalf. For more information about miniport driver handling of sets and queries to information objects, see Obtaining and Setting Miniport Driver Information and NDIS Support for WMI.

The intermediate driver should retain information about the capabilities of the underlying miniport adapters that it receives in the ProtocolBindAdapterEx function. If the miniport adapter is not power management-aware, NDIS sets the PowerManagementCapabilities member of NDIS_BIND_PARAMETERS to NULL.

The intermediate driver can query or set an OID_Xxx that is maintained by the underlying miniport driver. It does this with NdisOidRequest(if the intermediate driver has a connectionless lower edge), or with NdisCoOidRequest(if the intermediate driver has a connection-oriented lower edge).

An intermediate driver should handle queries and sets as follows:

  • OID_PNP_CAPABILITIES

    In response to this OID query, intermediate drivers must report the PnP capabilites of the underlying physical miniport adapters. Note that miniport adapters for physical devices do not receive this OID query.

    The intermediate driver receives the PnP capabilities of the underlying miniport adapters in the bind parameters. It should pass them to overlying drivers as appropriate for the intermediate driver's intended use. Intermediate drivers and miniport drivers report PnP capabilities in miniport adapter attributes. The intermediate driver does not issue OID_PNP_CAPABILITIES requests to the underlying miniport driver. If the underlying miniport adapter is power management-aware, in the NDIS_PM_WAKE_UP_CAPABILITIES structure in the virtual miniport attributes, the intermediate driver must specify a device power state of NdisDeviceStateUnspecified for each wake-up capability:

    • MinMagicPacketWakeUp
    • MinPatternWakeUp
    • MinLinkChangeWakeUp

    Such a setting indicates that the intermediate driver is power management-aware but cannot wake up the system.

  • OID_PNP_QUERY_POWER and OID_PNP_SET_POWER

    The intermediate driver must always return NDIS_STATUS_SUCCESS to a query of OID_PNP_QUERY_POWER or a set of OID_PNP_SET_POWER. The intermediate driver must never propagate either of these OID requests to the underlying miniport driver.

  • "Wake-up OIDs"

    If an underlying NIC is power management-aware, the intermediate driver must pass to the underlying miniport driver (by calling NdisOidRequest or NdisCoOidRequest) the following OID_PNP_Xxx that relate to wake-up events:

    OID_PNP_ENABLE_WAKE_UP

    OID_PNP_ADD_WAKE_UP_PATTERN

    OID_PNP_REMOVE_WAKE_UP_PATTERN

    OID_PNP_WAKE_UP_PATTERN_LIST

    OID_PNP_WAKE_UP_ERROR

    OID_PNP_WAKE_UP_OK

The intermediate driver must also propagate the underlying miniport driver's response to these OIDs to the overlying protocol drivers.

If the underlying miniport adapter is not power management-aware, the miniport driver sets the PowerManagementCapabilities member of NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES to NULL and NDIS sets the PowerManagementCapabilities member of NDIS_BIND_PARAMETERS to NULL.

If an underlying miniport adapter is not power management-aware, the intermediate driver should return NDIS_STATUS_NOT_SUPPORTED in response to a query or set of these OIDs.