As a set request, overlying drivers use the OID_OFFLOAD_ENCAPSULATION OID to set the task offload encapsulation settings of an underlying miniport adapter. Miniport drivers that support task offload must handle this OID set request.
As a query request, overlying drivers use the OID_OFFLOAD_ENCAPSULATION OID to obtain the current task offload encapsulation settings of an underlying miniport adapter. NDIS handles this OID query for miniport drivers.
If a miniport driver does not support offload and this OID, the driver should return NDIS_STATUS_NOT_SUPPORTED.
Miniport drivers must use the contents of the NDIS_OFFLOAD_ENCAPSULATION structure to update the currently reported TCP offload capabilities. After the update, the miniport driver must report the current task offload capabilities with the NDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG status indication. This status indication ensures that all of the overlying protocol drivers are updated with the new capabilities information.
Setting Encapsulation (Protocol Drivers)
Protocol drivers set OID_OFFLOAD_ENCAPSULATION after determining the system encapsulation requirements. A protocol driver can determine the capabilities of the underlying miniport adapter from the NDIS_BIND_PARAMETERS structure or by querying OID_TCP_OFFLOAD_CURRENT_CONFIG. The protocol driver must set an encapsulation type that the miniport adapter supports on at least one offload service.
If a miniport driver supports any offload type that supports the requested encapsulation type, the driver must return NDIS_STATUS_SUCCESS in response to a set of OID_OFFLOAD_ENCAPSULATION. Otherwise, the miniport driver should return NDIS_STATUS_INVALID_PARAMETER.
For send operations, a protocol driver can issue send requests by using only those offload types that the miniport adapter supports with the required encapsulation type. Therefore, if an OID set request of OID_OFFLOAD_ENCAPSULATION fails, the protocol driver must not use any offload settings in send requests that are directed to that miniport adapter.
For receive operations, the miniport driver must not start checksum or Internet protocol security (IPsec) offload services until after it receives an OID set request of OID_OFFLOAD_ENCAPSULATION.
Obtaining Current Encapsulation Settings (Protocol Drivers)
A protocol driver can issue an OID_OFFLOAD_ENCAPSULATION query only after setting the OID_OFFLOAD_ENCAPSULATION OID.
NDIS responds with an NDIS_OFFLOAD_ENCAPSULATION structure that contains the current encapsulation settings.
Protocol drivers must be prepared to handle any NDIS_STATUS_Xxx failure code. If a failure occurs, the protocol driver must not attempt to perform any offload operations that are directed to the affected miniport adapter.