SCSI_PHYSICAL_ADDRESS ScsiPortGetPhysicalAddress(HwDeviceExtension, Srb, VirtualAddress, Length) IN PVOID HwDeviceExtension; IN PSCSI_REQUEST_BLOCK Srb; /* optional */ IN PVOID VirtualAddress; OUT ULONG *Length;
Translates a virtual address range to a physical address range for a DMA operation.
HwDeviceExtension
Points to the miniport driver's storage for per-adapter data.
Srb
Points to a SCSI request block, if the VirtualAddress to be translated comes from an SRB's DataBuffer field; otherwise, this pointer is NULL.
VirtualAddress
Specifies the virtual address to be translated. The Srb pointer is required if the address came from the DataBuffer field of an SRB.
Length
Returns the number of bytes mapped, starting at the returned physical address.
An Srb parameter is not required if the VirtualAddress is in an UncachedExtension, SenseInfoBuffer or the SrbExtension. If an Srb is provided, the VirtualAddress must be within the range of DataBuffer or must be the pointer from SenseInfoBuffer field specified by the Srb. This function can be called to translate an extension address only if NeedPhysicalAddresses was specified in the HW_INITIALIZATION_DATA structure.
ScsiPortGetPhysicalAddress can be used to build a scatter/gather list for data transfers that span pages. Note that the Length returned can be greater than the length of the DataBuffer specified in the Srb parameter.
See also HW_INITIALIZATION_DATA, SCSI_REQUEST_BLOCK, ScsiPortGetUncachedExtension, ScsiPortGetVirtualAddress