The NDIS_TASK_OFFLOAD_HEADER structure specifies the encapsulation format for send and receive packets on which a miniport driver may perform tasks offloaded from the TCP/IP transport.
typedef struct _NDIS_TASK_OFFLOAD_HEADER
{
ULONG Version;
ULONG Size;
ULONG Reserved;
UCHAR OffsetFirstTask;
NDIS_ENCAPSULATION_FORMAT EncapsulationFormat;
} NDIS_TASK_OFFLOAD_HEADER, *PNDIS_TASK_OFFLOAD_HEADER;
typedef struct _NDIS_ENCAPSULATION_FORMAT
{
NDIS_ENCAPSULATION Encapsulation;
{
ULONG FixedHeaderSize:1;
ULONG Reserved:31;
} Flags;
ULONG EncapsulationHeaderSize;
} NDIS_ENCAPSULATION_FORMAT,*PNDIS_ENCAPSULATION_FORMAT;
The members of this structure contain the following information:
UNSPECIFIED_Encapsulation
An encapsulation type other than those listed below.
NULL_Encapsulation
This is reserved.
IEEE_802_3_Encapsulation
IEEE 802.3 encapsulation (Ethernet_DIX)
IEEE_802_5_Encapsulation
IEEE 802.5 encapsulation
LLC_SNAP_ROUTED_Encapsulation
LLC encapsulation for routed protocols, as described in RFC 1483.
Also used to indicate Ethernet LLC/SNAP encapsulation.
LLC_SNAP_BRIDGE_Encapsulation
This is reserved.
Declared in ndis.h. Include ndis.h.
When the TCP/IP transport queries OID_TCP_TASK_OFFLOAD, it initializes and passes an NDIS_TASK_OFFLOAD_HEADER structure in the InformationBuffer associated with the query. The miniport driver that receives this query examines the NDIS_TASK_OFFLOAD_HEADER structure to determine the encapsulation format for send and receive packets processed by the TCP/IP transport. The miniport driver or its NIC uses the encapsulation information to determine the format of the encapsulation header, as well as the start of the first IP header, in such packets so that the NIC can perform offload tasks on these packets.
The miniport driver responds to the OID_TCP_TASK_OFFLOAD query by appending one or more NDIS_TASK_OFFLOAD structures to the NDIS_TASK_OFFLOAD_HEADER structure in the InformationBuffer. Each NDIS_TASK_OFFLOAD structure represents an offload task supported by the miniport driver's NIC. The miniport driver sets the OffsetFirstTask member of the NDIS_TASK_OFFLOAD_HEADER structure to the offset in bytes from the start of the InformationBuffer to the first NDIS_TASK_OFFLOAD structure. The miniport driver does not alter any other values in the NDIS_TASK_OFFLOAD_HEADER structure. If the Version, Size, or EncapsulationFormat values specified in the NDIS_TASK_OFFLOAD_HEADER structure are not acceptable to the miniport driver, the miniport driver should fail the OID_TCP_TASK_OFFLOAD query.
To support task offloads for a particular frame type, a miniport driver's NIC must support the appropriate encapsulation type or types. The following table indicates which encapsulation types a miniport driver must support to be able to offload tasks for a given frame type:
| Frame Type | Encapsulation Type |
|---|---|
| Ethernet | IEEE_802_3_Encapsulation |
| Token Ring | IEEE_802_5_Encapsulation |
| ATM (CLIP) | LLC_SNAP_ROUTED_Encapsulation |
| Other | UNSPECIFIED_Encapsulation |
A NIC does not have to support the same set of offload tasks for each encapsulation type. For example, an Ethernet NIC can support checksum and IP Security offloads for the IEEE_802_3_Encapsulation type (Ethernet DIX) but only checksum offloads for the LLC_SNAP_ROUTED_Encapsulation type.
A NIC can offload the segmentation of large TCP packets only if
The encapsulation format specified by the TCP/IP transport in the NDIS_TASK_OFFLOAD_HEADER structure applies to both send and receive packets that are passed to or from the TCP/IP transport through the NIC. Only one encapsulation format is supported per NIC at any given time.
To disable all a NIC's task-offload capabilities, the TCP/IP transport sets OID_TCP_TASK_OFFLOAD, passing only an NDIS_TASK_OFFLOAD_HEADER in the InformationBuffer. In this case, the TCP/IP transport sets the OffsetFirstTask member of the NDIS_TASK_OFFLOAD_HEADER to zero.