EVT_WDF_DMA_TRANSACTION_CONFIGURE_DMA_CHANNEL callback function (wdfdmatransaction.h)

[Applies to KMDF only]

A driver's EvtDmaTransactionConfigureDmaChannel event callback function configures the DMA adapter for a system-mode DMA enabler.

Syntax

EVT_WDF_DMA_TRANSACTION_CONFIGURE_DMA_CHANNEL EvtWdfDmaTransactionConfigureDmaChannel;

BOOLEAN EvtWdfDmaTransactionConfigureDmaChannel(
  [in]           WDFDMATRANSACTION DmaTransaction,
  [in]           WDFDEVICE Device,
  [in]           PVOID Context,
  [in, optional] PMDL Mdl,
  [in]           size_t Offset,
  [in]           size_t Length
)
{...}

Parameters

[in] DmaTransaction

A handle to a DMA transaction object representing the transaction that is being executed.

[in] Device

A handle to the framework device object that the driver specified when it called WdfDmaTransactionCreate.

[in] Context

The context pointer that the driver specified in a previous call to WdfDmaTransactionSetChannelConfigurationCallback.

[in, optional] Mdl

A pointer to a single memory descriptor list (MDL) or MDL chain that describes the buffer associated with the current transfer, or NULL if the last transfer has been completed and the adapter is being freed.

[in] Offset

A byte offset into the buffer specified in the Mdl parameter where the current transfer starts.

[in] Length

The number of bytes being transferred in the current transfer.

Return value

The EvtDmaTransactionConfigureDmaChannel callback function returns TRUE if it successfully configures the DMA channel. If this callback function returns FALSE, the framework stops the transaction and does not call EvtProgramDma.

Remarks

Drivers register an EvtDmaTransactionConfigureDmaChannel event callback function by calling WdfDmaTransactionSetChannelConfigurationCallback.

The framework calls EvtDmaTransactionConfigureDmaChannel once for each system-profile DMA transfer in the transaction, after allocating the adapter channel but before mapping the transfer and calling EvtProgramDma.

The driver can use the EvtDmaTransactionConfigureDmaChannel callback to set any custom programming for the DMA adapter before mapping a transfer.

If the driver experiences an error while configuring the channel, it can stop the DMA transfer by calling WdfDmaTransactionDmaCompletedFinal and, if necessary, completing the request. The driver should then return FALSE from this callback function.

Requirements

Requirement Value
Minimum supported client Windows 8
Target Platform Universal
Minimum KMDF version 1.11
Header wdfdmatransaction.h (include Wdf.h)
IRQL DISPATCH_LEVEL

See also

WdfDmaTransactionDmaCompletedFinal

WdfDmaTransactionSetChannelConfigurationCallback