HP-UX Reference (11i v2 04/09) - 7 Device (Special) Files, 9 General Information, Index (vol 10)

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-3’’) and Fibre Channel interfaces (see ANSI Std X3.269-199X, "Fibre Chan-
nel Protocol for SCSI"). The SCSI standard includes specifications for a variety of device types. This sec-
tion 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 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.
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-1 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];
};
/* SCSI-2 inquiry structure */
struct inquiry_2 {
unsigned int periph_qualifier:3;
unsigned int dev_type:5;
unsigned int rmb:1;
unsigned int dtq:7;
unsigned int iso:2;
unsigned int ecma:3;
unsigned int ansi:3;
unsigned int aenc:1;
unsigned int trmiop:1;
unsigned int resv1:2;
Section 7130 Hewlett-Packard Company 1 HP-UX 11i Version 2: September 2004