For data transfer operations, storage class drivers need configuration information about each HBA driving a bus to which their devices are attached. To get this information, a class driver either calls an internal GetDescriptor routine or implements the same functionality in its StartDevice routine. (For information about StartDevice, see Handling PnP Start in a Storage Class Driver.)
A GetDescriptor routine builds and sets up query-property requests (IRP_MJ_DEVICE_CONTROL with IOCTL_STORAGE_QUERY_PROPERTY) for the port driver to retrieve device and adapter descriptors which the class driver stores in its device extension. The class driver might also set driver-writer-determined flags in the device extension according to the returned descriptor data.
The class driver inspects the returned STORAGE_DEVICE_DESCRIPTOR data to determine device capabilities (SCSI inquiry data or the non-SCSI equivalent) such as the SCSI device type, whether the device's media (if any) is removable (RemovableMedia), whether the device supports multiple outstanding commands (CommandQueueing), and various ID strings. The class driver inspects the returned STORAGE_ADAPTER_DESCRIPTOR data to determine adapter capabilities, including:
The maximum number of bytes a particular HBA can transfer in a single operation (MaximumTransferLength).
If the HBA can transfer buffered data backed by noncontiguous physical pages (in other words, if it supports scatter/gather), how many noncontiguous physical pages per buffer it can manage, per transfer operation (MaximumPhysicalPages).
The HBA's alignment requirements for transfers so the class driver can properly set the AlignmentRequirement field in its device objects (AlignmentMask).
Applications that send IOCTL_SCSI_PASS_THROUGH requests also might use this field.
For more information about setting up AlignmentRequirement in device objects, see Initializing a Device Object.
Whether the HBA supports SCSI tagged queuing and/or per-logical-unit internal queues (CommandQueueing).
Whether the HBA supports synchronous transfers (AcceleratedTransfer).
Whether the HBA caches data internally (CachesData).
The class driver should store this information in the FDO's device extension so its dispatch routines can ensure that all requests sent to the storage port driver conform to the size, number of physical breaks, and alignment requirements of the underlying HBA. For more information about class driver dispatch routines, see Storage Class Driver's Dispatch Routines. For more information about setting up device extensions, see Setting Up a Storage Class Driver's Device Extension.