A.1.3.3  SCSI Class Driver’s GetCapabilities Routine

For data transfer operations, SCSI class drivers need configuration information about each HBA driving a bus to which their devices are attached. Consequently, a class driver either calls a GetCapabilities routine or implements the same functionality in its DriverEntry routine.

A GetCapabilities routine builds and sets up an IRP_MJ_DEVICE_CONTROL request with the I/O control code IOCTL_SCSI_GET_CAPABILITIES for the port driver. The class driver inspects the returned IO_SCSI_CAPABILITIES-type information to determine the following:

·The maximum number of bytes a particular HBA can transfer in a single operation

·If the HBA can transfer buffered data backed by discontiguous physical pages, how many discontiguities per buffer it can manage per transfer operation

·The HBA’s alignment requirements for transfers so the class driver can properly set the AlignmentRequirement field in its device objects.

Applications that send IOCTL_SCSI_PASS_THROUGH requests also might use this field.

For more information about setting up AlignmentRequirement in device objects, see Chapter 3.

·Whether the HBA uses PIO and requires the use of system-space virtual addresses mapped to physical memory for data buffers

·Whether the HBA supports SCSI-II tagged queueing and/or per-logical-unit internal queues (MultipleRequestsPerLu)

·Whether the HBA supports asynchronous event notifications

·Whether the HBA scans down

The class driver should store this information in the device extension so its Dispatch routines can ensure that all requests sent to the port and miniport drivers conform to the size, alignment, and PIO requirements of the underlying HBA. For more information about class driver Dispatch routines, see Section A.1.4. For more information about setting up device extensions, see Section A.1.3.4.

For more information about general requirements for DriverEntry routines, see Chapter 5.