編集

次の方法で共有


SERCX2_SYSTEM_DMA_TRANSMIT_CONFIG structure (sercx.h)

The SERCX2_SYSTEM_DMA_TRANSMIT_CONFIG structure contains information that version 2 of the serial framework extension (SerCx2) uses to configure a new system-DMA-transmit object.

Syntax

typedef struct _SERCX2_SYSTEM_DMA_TRANSMIT_CONFIG {
  ULONG                                                 Size;
  size_t                                                MaximumTransferLength;
  size_t                                                MinimumTransactionLength;
  ULONG                                                 DmaAlignment;
  ULONG                                                 MaximumScatterGatherFragments;
  DMA_WIDTH                                             DmaWidth;
  PHYSICAL_ADDRESS                                      DeviceAddress;
  PCM_PARTIAL_RESOURCE_DESCRIPTOR                       DmaDescriptor;
  ULONG                                                 MinimumTransferUnitOverride;
  BOOLEAN                                               Exclusive;
  PFN_SERCX2_SYSTEM_DMA_TRANSMIT_INITIALIZE_TRANSACTION EvtSerCx2SystemDmaTransmitInitializeTransaction;
  PFN_SERCX2_SYSTEM_DMA_TRANSMIT_CLEANUP_TRANSACTION    EvtSerCx2SystemDmaTransmitCleanupTransaction;
  PFN_SERCX2_SYSTEM_DMA_TRANSMIT_CONFIGURE_DMA_CHANNEL  EvtSerCx2SystemDmaTransmitConfigureDmaChannel;
  PFN_SERCX2_SYSTEM_DMA_TRANSMIT_DRAIN_FIFO             EvtSerCx2SystemDmaTransmitDrainFifo;
  PFN_SERCX2_SYSTEM_DMA_TRANSMIT_CANCEL_DRAIN_FIFO      EvtSerCx2SystemDmaTransmitCancelDrainFifo;
  PFN_SERCX2_SYSTEM_DMA_TRANSMIT_PURGE_FIFO             EvtSerCx2SystemDmaTransmitPurgeFifo;
} SERCX2_SYSTEM_DMA_TRANSMIT_CONFIG, *PSERCX2_SYSTEM_DMA_TRANSMIT_CONFIG;

Members

Size

The size, in bytes, of this structure. The SerCx2SystemDmaTransmitCreate method uses this member to determine which version of the structure the caller is using. The size of this structure might change in future versions of the Sercx.h header file.

MaximumTransferLength

The default maximum size, in bytes, that the serial controller can handle in a single system DMA transfer. If the size of the buffer in the write (IRP_MJ_WRITE) request is larger than this maximum size, SerCx2 uses multiple DMA transfers to handle the request, and limits each transfer to the maximum length.

MinimumTransactionLength

The minimum length, in bytes, of a system-DMA-transmit transaction. If the length of the buffer in a write request is less than this minimum length, SerCx2 uses programmed I/O (PIO) for the transaction.

DmaAlignment

DMA alignment requirement. Specifies how the starting address of a transfer in a system-DMA-transmit transaction must be aligned in memory. Set this member to the appropriate FILE_XXX_ALIGNMENT constant in the Wdm.h header file. For example, FILE_WORD_ALIGNMENT indicates that the starting DMA address must be aligned to a two-byte boundary in memory, FILE_LONG_ALIGNMENT indicates that the address must be aligned to a four-byte boundary, and so on. SerCx2 does not support FILE_BYTE_ALIGNMENT. The minimum transfer unit (MTU) of the system DMA adapter should be greater than or equal to the required alignment. For example, if the MTU is four bytes, DmaAlignment must be at least FILE_LONG_ALIGNMENT.

MaximumScatterGatherFragments

The maximum number of buffer fragments that can be specified in the scatter/gather list for a DMA transfer in a system-DMA-transmit transaction.

DmaWidth

The width of the data register at the address specified by DeviceAddress. Possible values are Width8Bits, Width16Bits, Width32Bits, and Width64Bits.

DeviceAddress

The translated device address to which the DMA controller transfers data to be transmitted. For more information, see the description of the DeviceAddress member in WDF_DMA_SYSTEM_PROFILE_CONFIG.

DmaDescriptor

A pointer to the CM_PARTIAL_RESOURCE_DESCRIPTOR structure that describes the system DMA resource to use for transmit transactions. The serial controller driver gets this structure from the raw resource list it receives in the EvtDevicePrepareHardware callback that starts the serial controller.

MinimumTransferUnitOverride

An override value to use in place of the default minimum transfer unit. The number of bytes specified by an element in a scatter/gather list must be an integer multiple of the minimum transfer unit. A value of zero indicates that the default minimum transfer unit should be used. For more information about the default minimum transfer unit, see DMA_ADAPTER_INFO_V1.

Exclusive

Whether to use system-DMA-transmit transactions exclusively to handle write (IRP_MJ_WRITE) requests. Set to TRUE to indicate that write requests should use system-DMA-transmit transactions exclusively. Set to FALSE to indicate that write requests can use a combination of system-DMA-transmit transactions and PIO-transmit transactions.

Set this member to TRUE only if the minimum transfer unit for system-DMA-transmit transactions is one byte, the minimum transaction length is one byte, and the write buffer for the transaction can start on any byte boundary in memory.

If Exclusive is TRUE, the MinimumTransferUnitOverride, Alignment, and MinimumTransactionLength members must be zero.

EvtSerCx2SystemDmaTransmitInitializeTransaction

A pointer to the driver-implemented EvtSerCx2SystemDmaTransmitInitializeTransaction event callback function. This member is optional and can be set to NULL to indicate that the driver does not implement the function.

EvtSerCx2SystemDmaTransmitCleanupTransaction

A pointer to the driver-implemented EvtSerCx2SystemDmaTransmitCleanupTransaction event callback function. This member is optional and can be set to NULL to indicate that the driver does not implement the function.

EvtSerCx2SystemDmaTransmitConfigureDmaChannel

A pointer to the driver-implemented EvtSerCx2SystemDmaTransmitConfigureDmaChannel event callback function. This member is optional and can be set to NULL to indicate that the driver does not implement the function.

EvtSerCx2SystemDmaTransmitDrainFifo

A pointer to the driver-implemented EvtSerCx2SystemDmaTransmitDrainFifo event callback function. This member is optional and can be set to NULL to indicate that the driver does not implement the function. However, a driver that implements this function must also implement EvtSerCx2SystemDmaTransmitCancelDrainFifo and EvtSerCx2SystemDmaTransmitPurgeFifo functions.

EvtSerCx2SystemDmaTransmitCancelDrainFifo

A pointer to the driver-implemented EvtSerCx2SystemDmaTransmitCancelDrainFifo event callback function. This member is optional and can be set to NULL to indicate that the driver does not implement the function. However, a driver that implements this function must also implement EvtSerCx2SystemDmaTransmitDrainFifo and EvtSerCx2SystemDmaTransmitPurgeFifo functions.

EvtSerCx2SystemDmaTransmitPurgeFifo

A pointer to the driver-implemented EvtSerCx2SystemDmaTransmitPurgeFifo event callback function. This member is optional and can be set to NULL to indicate that the driver does not implement the function. However, a driver that implements this function must also implement EvtSerCx2SystemDmaTransmitDrainFifo and EvtSerCx2SystemDmaTransmitCancelDrainFifo functions.

Remarks

The SerCx2SystemDmaTransmitCreate method accepts a pointer to a SERCX2_SYSTEM_DMA_TRANSMIT_CONFIG structure as an input parameter. Before calling SerCx2SystemDmaTransmitCreate, call the SERCX2_SYSTEM_DMA_TRANSMIT_CONFIG_INIT function to initialize this structure.

Requirements

Requirement Value
Minimum supported client Supported starting with Windows 8.1.
Header sercx.h

See also

DMA_ADAPTER_INFO_V1

EvtSerCx2SystemDmaTransmitCancelDrainFifo

EvtSerCx2SystemDmaTransmitCleanupTransaction

EvtSerCx2SystemDmaTransmitConfigureDmaChannel

EvtSerCx2SystemDmaTransmitDrainFifo

EvtSerCx2SystemDmaTransmitInitializeTransaction

EvtSerCx2SystemDmaTransmitPurgeFifo

IRP_MJ_WRITE

SERCX2_SYSTEM_DMA_TRANSMIT_CONFIG_INIT

SerCx2SystemDmaTransmitCreate

WdfDmaEnablerSetMaximumScatterGatherElements