Share via


NDIS_TASK_OFFLOAD_HEADER structure

Note   NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

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.

Syntax

typedef struct _NDIS_TASK_OFFLOAD_HEADER {
  ULONG                     Version;
  ULONG                     Size;
  ULONG                     Reserved;
  ULONG                     OffsetFirstTask;
  NDIS_ENCAPSULATION_FORMAT EncapsulationFormat;
} NDIS_TASK_OFFLOAD_HEADER, *PNDIS_TASK_OFFLOAD_HEADER;

Members

Version

Specifies the task-offload version supported by the TCP/IP transport. This value is always set to NDIS_TASK_OFFLOAD_VERSION.

Size

Specifies in bytes the size of the NDIS_TASK_OFFLOAD_HEADER structure. Size is set to sizeof(NDIS_TASK_OFFLOAD_HEADER) and is used to determine the version of the NDIS_TASK_OFFLOAD_HEADER structure.

Reserved

This is reserved.

OffsetFirstTask

Specifies in bytes the offset from the beginning of the InformationBuffer to the first NDIS_TASK_OFFLOAD structure. The miniport driver is responsible for setting this value when responding to a query of OID_TCP_TASK_OFFLOAD. The TCP/IP transport is responsible for setting this value when setting OID_TCP_TASK_OFFLOAD. If no NDIS_TASK_OFFLOAD structures are in the InformationBuffer, OffsetFirstTask is set to zero.

EncapsulationFormat

Specifies the encapsulation format for both send and receive packets that are passed to or from the TCP/IP transport through the miniport driver's NIC. This information is formatted as an NDIS_ENCAPSULATION_FORMAT structure, which is defined as follows:

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:

Encapsulation

Specifies the encapsulation type as one of the following values:

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

_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.

FixedHeaderSize

This is always set to 1 to indicate that the encapsulation header is the same size in each packet.

Reserved

This is reserved.

EncapsulationHeaderSize

Specifies in bytes the size of the encapsulation header. The first IP header in the encapsulated transmit packet starts at this offset from the start of the packet.

Remarks

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 Internet Protocol 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

  • It supports the encapsulation format specified by the TCP/IP protocol in the NDIS_TASK_OFFLOAD_HEADER structure

  • Or the specified encapsulation type is UNSPECIFIED_Encapsulation and the EncapsulationHeaderSize is set to the size of the encapsulation header for the media supported by the miniport driver and its NIC

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.

Requirements

Header

Ndis.h (include Ndis.h)

See also

NDIS_TASK_OFFLOAD

OID_TCP_TASK_OFFLOAD

 

 

Send comments about this topic to Microsoft