NET_FRAGMENT structure

Warning

Some information in this topic relates to prereleased product, which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

NetAdapterCx is preview only in Windows 10, version 1903.

Represents one contiguous buffer in memory.

Syntax

typedef struct _NET_FRAGMENT {
  ULONG_PTR OsReserved_Bounced : 1;
  union {
    struct {
      void *RxBufferReturnContext;
    } DUMMYSTRUCTNAME;
    union {
      MDL             *Mdl;
      LOGICAL_ADDRESS DmaLogicalAddress;
    } Mapping;
  } DUMMYUNIONNAME;
  void      *VirtualAddress;
  UINT64    Reserved0 : 1;
  UINT64    ValidLength : 26;
  UINT64    Capacity : 26;
#if ...
  ULONG_PTR Reserved : 63;
  UINT64    Offset : 10;
#else
  ULONG_PTR Reserved : 31;
#endif
  UINT64    Scratch : 1;
} NET_FRAGMENT;

Members

OsReserved_Bounced

Reserved. Client drivers must not read or write to this value.

DUMMYUNIONNAME

A union that contains the fragment's return context and the Mapping union for DMA information.

DUMMYUNIONNAME.DUMMYSTRUCTNAME

DUMMYUNIONNAME.DUMMYSTRUCTNAME.RxBufferReturnContext

A pointer to a driver-allocated context space structure. This member is optional and is only used in the receive data path.

For more information about receive path capabilities, see NET_ADAPTER_RX_CAPABILITIES.

DUMMYUNIONNAME.Mapping

DUMMYUNIONNAME.Mapping.Mdl

For transmit queues, a pointer to an MDL to be used for scatter/gather DMA.

For receive queues, this member is not used.

Do not modify this value.

DUMMYUNIONNAME.Mapping.DmaLogicalAddress

For receive queues, contains a mapped DMA address that can be used to program NIC hardware.

For transmit queues, cast this value to an MDL pointer.

Do not modify this value.

VirtualAddress

Points to the start of the packet buffer. This address is mapped into the system address space.

For transmit queues, this value is read-only.

Reserved0

Reserved. Client drivers must not read or write to this value.

ValidLength

Contains the length of packet payload. This value is less than or equal to the value of Capacity.

For transmit queues, this value is read-only.

Capacity

Contains the total length of the packet buffer.

For transmit queues, this value is read-only.

Reserved.#2825468657

Offset

Contains the offset from the start of the VirtualAddress and DmaLogicalAddress to the start of the valid packet payload. This value is less than or equal to the value of Capacity.

For transmit queues, this value is read-only.

Reserved.#1025646688

Scratch

A bit field value that the client may use for any purpose. When the NET_PACKET to which this fragment belongs is reused, this value is reset to zero.

Remarks

The NET_FRAGMENT structure is similar in concept to a memory descriptor list (MDL).

A single NET_PACKET structure contains references to one or more NET_FRAGMENT structures.

While each fragment is a virtually contiguous buffer of memory, a packet that contains more than one fragment is virtually discontiguous.

The client driver should not unlink, append, or rearrange NET_FRAGMENT structures within a NET_PACKET structure.

Requirements

   
Minimum KMDF version 1.29
Header fragment.h