Declarations and Structures

To inform the system that the module depends on SCSA routines, the driver
binary must be generated with the following command. See SCSA HBA Interfaces for more information on
SCSA routines.

% ld -r xx.o -o xx -N "misc/scsi"

The code samples are derived from a simplified isp driver
for the QLogic Intelligent SCSI Peripheral device. The isp driver
supports WIDE SCSI, with up to 15 target devices and 8 logical units (LUNs)
per target.

Per-Command Structure

An HBA driver usually needs to define a structure to maintain
state for each command submitted by a target driver. The layout of this per-command
structure is entirely up to the device driver writer. The layout needs to
reflect the capabilities and features of the hardware and the software algorithms
that are used in the driver.

The following structure is an example of a per-command structure. The
remaining code fragments of this chapter use this structure to illustrate
the HBA interfaces.