A.4.3.2  Port-Driver-Supplied ConfigInfo for HwScsiFindAdapter

The system port driver always sets up the following PORT_CONFIGURATION_INFORMATION before it calls a miniport’s HwScsiFindAdapter routine:

·Length to sizeof(PORT_CONFIGURATION_INFORMATION)

·AdapterInterfaceType to the miniport’s HW_INITIALIZATION_DATA specification

·InterruptMode to Latched

If the miniport has no HwScsiInterrupt routine and, therefore, set the HwInterrupt entry point to NULL in the HW_INITIALIZATION_DATA, this member is irrelevant.

·AtdiskPrimaryClaimed to TRUE if a previously loaded driver is using the I/O port range 0x1F0 to 0x1FF

·AtdiskSecondaryClaimed to TRUE if a previously loaded driver is using the I/O port range 0x170 to 0x17F

·NumberOfAccessRanges to the miniport’s HW_INITIALIZATION_DATA specification

The port driver also attempts to fill in the following members with values from the registry:

·SystemIoBusNumber set to the system-assigned value for the I/O bus

The miniport’s HwScsiFindAdapter routine can be called for each bus of the given AdapterInterfaceType with an updated value for SystemIoBusNumber, or this can be set to a value from the registry if the system detects an HBA on a particular bus of the given AdapterInterfaceType.

·AccessRanges elements, set with the bus-relative RangeStart address and RangeLength, as well as whether each range is a RangeInMemory

RangeInMemory set to FALSE indicates a range of ports in I/O space, rather than a memory-space range.

The port driver either supplies all the information in an ACCESS_RANGE-type element or it sets all members of the element to (default) zero. Usually, the port driver supplies additional configuration information if it provides nonzero values for an access range.

A miniport driver must map the bus-relative access range values, if any, supplied by the port driver with ScsiPortGetDeviceBase and use the mapped logical address values to determine whether the corresponding adapter is an HBA the driver supports. Never map and use a miniport-supplied range to access an adapter on the bus if the port driver supplies filled-in access range elements in the port configuration information it passes to the HwScsiFindAdapter routine. Using miniport-supplied addresses when the port driver has supplied range configuration information can reset an already configured adapter, making it disfunctional, or even cause the system to fail the boot process.

For more information about using mapped logical access ranges, see also Section A.4.3.3.

·BusInterruptLevel or BusInterruptVector

This member is irrelevant if the miniport has no HwScsiInterrupt routine.

·DmaChannel or DmaPort if the HBA uses a system DMA controller

If the HBA is a busmaster or uses PIO, these members of PORT_CONFIGURATION_INFORMATION are irrelevant.

·InitiatorBusId

If the input InitiatorBusId[0] has the value zero, the miniport can assign a default value if its HBA does not require the use of particular value(s) determined by querying the HBA. Otherwise, the miniport should use any nonzero value assigned by the port driver if possible. Every miniport must update InitiatorBusId specifications to match what its HBA uses, if necessary querying the HBA to determine the appropriate values(s).

A miniport driver must set an entry for each SCSI bus supported by the HBA, as indicated by the value of NumberOfBuses.