Bewerken

Delen via


Adding and Deleting Low Power Protocol Offloads

To add a low power protocol offload, NDIS protocol drivers issue an OID set request of OID_PM_ADD_PROTOCOL_OFFLOAD. The InformationBuffer member of the NDIS_OID_REQUEST structure contains a pointer to an NDIS_PM_PROTOCOL_OFFLOAD structure.

Note  If an incoming packet matches both an offloaded protocol and a pattern (for example, because of a configuration error), the network adapter should respond to the packet and wake up the computer.

The NDIS_PM_PROTOCOL_OFFLOAD structure includes the following information:

Member Description

Priority

Contains the priority of the protocol offload. If an overlying driver adds a higher priority protocol offload when there are no resources available for more protocol offloads, NDIS might remove a lower priority protocol offload to free resources. Miniport drivers should ignore this member. Protocol drivers can provide any value within the predefined range from NDIS_PM_PROTOCOL_OFFLOAD_PRIORITY_LOWEST to NDIS_PM_PROTOCOL_OFFLOAD_PRIORITY_HIGHEST.

ProtocolOffloadType

Contains an NDIS_PM_PROTOCOL_OFFLOAD_TYPE value that specifies the type of protocol offload.

FriendlyName

Contains an NDIS_PM_COUNTED_STRING structure that contains the user-readable description of the low power protocol offload.

ProtocolOffloadId

Contains an NDIS-provided value that identifies the offloaded protocol. Before NDIS sends the OID request of OID_PM_ADD_PROTOCOL_OFFLOAD down to the underlying NDIS drivers or completes the request to the overlying driver, NDIS sets ProtocolOffloadId to a value that is unique among the protocol offloads on a network adapter.

NextProtocolOffloadOffset

Contains the offset, the beginning of the OID request InformationBuffer, to the next NDIS_PM_PROTOCOL_OFFLOAD structure in a list for the OID_PM_PROTOCOL_OFFLOAD_LIST OID. For more information about OID_PM_PROTOCOL_OFFLOAD_LIST, see Obtaining the Current Parameter Settings of Low Power Protocol Offloads.

ProtocolOffloadParameters

Contains one of the IPv4ARPParameters, IPv6NSParameters, or Dot11RSNRekeyParameters structures in a union.

Term Description

IPv4ARPParameters

Contains IPv4 ARP parameters.

IPv6NSParameters

Contains IPv6 Neighbor Solicitation (NS) parameters.

Dot11RSNRekeyParameters

Contains IEEE 802.11 robust secure network (RSN) handshake parameters

 

NDIS assigns an identifier that is unique for a network adapter to every offloaded protocol. The protocol offload identifier is a unique value for each of the protocols that are offloaded on a network adapter. However, the protocol offload identifier is not globally unique across all network adapters. NDIS passes this identifier to the underlying miniport driver when NDIS sends the OID_PM_ADD_PROTOCOL_OFFLOAD OID request to the miniport driver. If offloading the protocol is successful, NDIS returns the identifier to the overlying driver that offloaded the protocol. The overlying driver uses the identifier to remove a previously offloaded protocol. The protocol offload identifier is also used in status indications to the upper layer drivers when an offloaded protocol is removed from a network adapter.

Protocol drivers must remove all of the offloaded protocols from a network adapter before closing the binding to that network adapter. To remove a low power protocol offload, a protocol driver sends an OID set request of OID_PM_REMOVE_PROTOCOL_OFFLOAD. The InformationBuffer member of the NDIS_OID_REQUEST structure contains a pointer to a protocol offload identifier.

NDIS allows multiple NDIS protocol drivers to add protocol offloads to the same network adapter. To ensure that the right set of protocols have been offloaded to a network adapter when the number of requested offloaded protocols is higher than what a network adapter can support, protocol drivers assign a priority to each offloaded protocol. When NDIS cannot offload a new high priority protocol because the network adapter is out of resources, NDIS deletes one of the lower priority offloaded protocols (if any) and attempts to offload the high priority protocol again.

Note  A miniport driver should fail a low power protocol offload add request and return the STATUS_NDIS_PM_PROTOCOL_OFFLOAD_LIST_FULL status code to allow NDIS to re-prioritize the protocol offloads.

If as a result of offloading a high priority protocol, one of the lower priority offloaded protocols is deleted, NDIS sends an NDIS_STATUS_PM_OFFLOAD_REJECTED status indication to notify the overlying driver that set the deleted protocol offload. The StatusBuffer member of the NDIS_STATUS_INDICATION structure contains a protocol offload identifier of the rejected protocol offload. NDIS provided the protocol offload identifier in the ProtocolOffloadId member of the NDIS_PM_PROTOCOL_OFFLOAD structure.