scsi.7 (2010 09)
s
scsi(7) scsi(7)
NAME
scsi - Small Computer System Interface device drivers
DESCRIPTION
The Small Computer System Interface (SCSI) is an American National Standard for interconnecting com-
puters and peripheral devices. HP-UX supports the SCSI device protocol on parallel SCSI interfaces (see
ANSI Std X3.131-199X, "SCSI-2"), Fibre Channel interfaces (see ANSI Std X3.269-199X, "Fibre Channel
Protocol for SCSI"), and Serial Attached SCSI interfaces (SAS).
The SCSI standard includes specifications for a variety of device types. This section describes the general
SCSI interface for all SCSI device drivers. Information about specific device types can be found in the
manual sections which describe SCSI peripheral device drivers for those device types.
The ioctls described here can be issued either on persistent device files or legacy devices (see intro (7)).
Legacy device files are deprecated with HP-UX release 11i V3. They are maintained for backward com-
patibility, and may be obsolete in future releases.
The behavior of some ioctls may differ depending on whether issued on persistent device files or legacy
device files, and whether multi-pathing is enabled on legacy device files. Typically ioctls issuing SCSI
commands to a device may use any available LUN path to send the commands. However, when multi-
pathing is disabled on legacy device files (see
leg_mpath_enable
attribute in scsimgr(1M)), the ioctl
only attempts to use the LUN path corresponding to the legacy device file. If this LUN path is not avail-
able, the ioctl will fail even if there are other LUN paths available. This behavior corresponds to the
legacy behavior.
The
SIOC_INQUIRY ioctl is supported by all SCSI device drivers. This ioctl returns the SCSI device-
specific INQUIRY command data. This data contains device identification and capability information.
Since there have been multiple versions of the SCSI standard for inquiry data, multiple versions of the
inquiry data declaration are provided. The SCSI-1 version is provided for backward compatibility only.
If issued on a legacy device file, this ioctl only tries to use the LUN path corresponding to the legacy dev-
ice file even if multi-pathing is enabled on legacy device files.
The
SIOC_CAPACITY ioctl indicates the current device size. A device size is defined to be a logical
block size and some number of logical blocks. The means of determining this device-size data is particu-
lar to the specific device type. Logical block size and/or number of logical blocks equal to zero indicates:
the device size is unknown, the device is not currently capable of I/O operations, or I/O operations are not
meaningful for the device. Note that for very large devices, the ioctl argument can overflow,
SIOC_STORAGE_CAPACITY
is a better choice, than SIOC_CAPACITY where devices can be large.
Also note that
DIOC_CAPACITY
is preferred (see disk(7)).
The header file
<sys/scsi.h> has useful information for SCSI devices. The following is included from
<sys/scsi.h>:
#define SIOC_INQUIRY _IOR(’S’, 2, union inquiry_data)
#define SIOC_CAPACITY _IOR(’S’, 3, struct capacity)
#define SIOC_STORAGE_CAPACITY _IOR(’S’, 101, storage_capacity_t)
/* SCSI inquiry structure */
struct inquiry {
unsigned char dev_type;
unsigned int rmb :1;
unsigned int dtq :7;
unsigned int iso :2;
unsigned int ecma :3;
unsigned int ansi :3;
unsigned int resv :4;
unsigned int rdf :4;
unsigned char added_len;
unsigned char dev_class[3];
char vendor_id[8];
char product_id[16];
char rev_num[4];
unsigned char vendor_spec[20];
unsigned char resv4[40];
unsigned char vendor_parm_bytes[32];
};
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1