A.1.4.1  Handling Requests to SCSI Peripherals

For all requests that require the port driver to execute a request on the SCSI bus, the class driver must set up an IRP with an SRB containing a CDB. Consequently, most class drivers have one or more internal routines to build SRBs. For more information about BuildSrb routines, see Section A.1.4.4.

SCSI class drivers also pass on IRP_MJ_INTERNAL_DEVICE_CONTROL requests to the Windows NT SCSI port driver. Such a request can originate from a SCSI filter driver, described in Section A.2. As for IOCTL_SCSI_PASS_THROUGH requests described in Section A.1.4.2, the class driver is responsible for setting the PathId, TargetId, and Lun members in the SRB. The class driver is also responsible for setting the MinorFunction code to IRP_MN_SCSI_CLASS in the port driver’s I/O stack location before passing the IRP on to the port driver with IoCallDriver.

Every SCSI class driver is responsible for splitting up transfer (IRP_MJ_READ and/or IRP_MJ_WRITE) requests that exceed the underlying HBA’s capabilities. Consequently, most class drivers also call an internal SplitTransferRequest routine, described in Section A.1.4.5, or implement the same functionality in their Dispatch routine(s) for read and write requests.