HwDmaStarted Routine

A miniport driver whose HBA uses the system DMA controller must have a HwDmaStarted routine.

For a data transfer operation, such a miniport driver must call ScsiPortIoMapTransfer, passing in the pointers to its device extension for per-HBA data and the SRB requesting the transfer, along with a range of logical addresses for the buffer from which or into which the data will be transferred.

Note that the logical address range passed to ScsiPortIoMapTransfer either must be the mapped values for the input SRB's DataBuffer and DataTransferLength or a proper subset of this range. For most transfer requests, a miniport driver designer can assume that all data specified in the input SRB can be transferred in a single DMA operation. That is, the miniport driver might have to carry out more than one transfer operation to satisfy a given SRB only if the HBA provides application-dedicated support and the application sends large transfer requests directly to the miniport driver. Otherwise, it is the responsibility of SCSI class drivers to split up large transfer requests into a set of partial transfer requests, each sized to suit the capabilities of the HBA.

ScsiPortIoMapTransfer calls the miniport's HwDmaStarted routine when the system DMA controller is ready to transfer data between system memory and the HBA. HwDmaStarted must set up the HBA for the transfer operation.

When a transfer operation is complete, the miniport driver must call ScsiPortFlushDma before it calls ScsiPortNotification with the SRB and/or calls ScsiPortIoMapTransfer to set up the DMA controller again for a subrange in the buffer. ScsiPortFlushDma flushes any remaining data cached in the DMA controller. Note that ScsiPortFlushDma also can be called to cancel a system DMA transfer, even if the miniport's HwDmaStarted routine has not yet been called.

For more information about ScsiPortIoMapTransfer and ScsiPortFlushDma, see the Introduction to SCSI Port Driver Services Reference.