ScsiPortGetUncachedExtension

PVOID ScsiPortGetUncachedExtension(HwDeviceExtension, ConfigInfo, NumberOfBytes)
IN PVOID  HwDeviceExtension;
IN PPORT_CONFIGURATION_INFORMATION  ConfigInfo;
IN ULONG  NumberOfBytes;
 

Allocates memory that can be used by both the CPU and host bus adapter for DMA or shared data.

HwDeviceExtension
Points to the miniport driver's storage for per-adapter data.
ConfigInfo
Specifies information about the adapter's DMA capabilities. The following members must be filled-in: DmaChannel or DmaPort, DmaWidth, DmaSpeed, MaximumLength, ScatterGather, Master, NumberOfPageBreaks, AdapterInterfaceType, Dma32BitAddresses, SystemIoBusNumber, and AutoRequestSense.

Members that are not pertinent to the HBA, such as DmaChannel for an EISA master adapter, must be left alone.

NumberOfBytes
Indicates the size, in bytes, of the uncached extension to be allocated.

This function can be called only from HBA miniport driver's HwFindAdapter routine. Calls to ScsiPortGetUncachedExtension from other miniport driver functions will result in either a system failure or an incorrect operation.

Because new machines have caches and large memories, any memory shared between the host bus adapter and the CPU must be specially allocated. Mailboxes or I/O request queues in system memory are examples of this shared memory.

The allocation of memory can be done only once per HBA.

Use ScsiPortGetPhysicalAddress to find the physical address of the uncached extension.

Under Windows 95, this extension is allocated using the IOS memory pool (ISP_Alloc_Mem, memory type MED_MISC) if the amount of memory requested is less than or equal to 1024 bytes. Otherwise, the memory allocation is made using _PageAllocate, obtaining system memory (PG_SYS) with the following flags: PAGEZEROINIT, PAGEUSEALIGN (4K), PAGEFIXED, PAGECONTIG.

See Also

PORT_CONFIGURATION_INFORMATION, HwFindAdapter, ScsiPortGetPhysicalAddress