EN
このコンテンツは設定された言語で表示できません。英語版のページが表示されます。

WdfDmaTransactionSetDeviceAddressOffset method

[Applies to KMDF only]

The WdfDmaTransactionSetDeviceAddressOffset method specifies the offset of the register that the system DMA controller will access when performing the DMA operation.

Syntax


void WdfDmaTransactionSetDeviceAddressOffset(
  [in]  WDFDMATRANSACTION DmaTransaction,
  [in]  ULONG Offset
);

Parameters

DmaTransaction [in]

A handle to a DMA transaction object that specifies the transaction to modify.

Offset [in]

The offset of the register, from the DeviceAddress specified in WDF_DMA_SYSTEM_PROFILE_CONFIG, to or from which DMA should be performed.

Return value

This method does not return a value.

Remarks

WdfDmaTransactionSetDeviceAddressOffset must be used with a DMA enabler that specifies a system-mode DMA profile.

Framework-based drivers call WdfDmaTransactionSetDeviceAddressOffset after initializing a DMA transaction and before executing it.

A driver can use this method to access multiple registers within a device's register file.

For example, a driver might use DMA to access separate read and write registers in a device's register file.

To do so, the driver specifies the base address of the device's register file when configuring the enabler, and then sets the offset of the read or write register as necessary before executing the transaction.

If your driver calls this method on an operating system earlier than Windows 8, the framework's verifier reports an error.

Examples

The following code example initializes a DMA transaction. It then sets the offset of the register that the system DMA controller will access, provides a transfer completion callback routine, and executes the DMA transaction.


status = WdfDmaTransactionInitialize(
                                     RequestContext->DmaTransaction,
                                     EvtProgramDma,
                                     direction,
                                     mdl,
                                     startingVa,
                                     length
                                     );

if(!NT_SUCCESS(status)) {
    goto Complete;
}

WdfDmaTransactionSetDeviceAddressOffset(
                                        RequestContext->DmaTransaction,
                                        READ_DATA_REGISTER_OFFSET
                                        );

WdfDmaTransactionSetTransferCompleteCallback(
                                             RequestContext->DmaTransaction,
                                             EvtDmaTransactionDmaTransferComplete,
                                             RequestContext
                                             );

status = WdfDmaTransactionExecute(
                                  RequestContext->DmaTransaction, 
                                  RequestContext );

if(!NT_SUCCESS(status)) {
    goto Complete;
}

return status;

Complete:

WdfDmaTransactionRelease(
                         RequestContext->DmaTransaction
                         );

Requirements

Minimum support

Windows 8

Minimum KMDF version

1.11

Header

Wdfdmatransaction.h (include Wdf.h)

Library

Wdf01000.sys (see Framework Library Versioning.)

IRQL

<=DISPATCH_LEVEL

DDI compliance rules

DriverCreate

See also

WDF_DMA_SYSTEM_PROFILE_CONFIG

 

 

Send comments about this topic to Microsoft

表示:
© 2014 Microsoft