* SCSI general interface description
* Largely written by Julian Elischer (julian@tfs.com)
* for TRW Financial Systems.
* TRW Financial Systems, in accordance with their agreement with Carnegie
* Mellon University, makes this software available to CMU to distribute
* or use in any manner that they see fit as long as this message is kept with
* the software. For this reason TFS also grants any other persons or
* organisations permission to use or modify this software.
* TFS supplies this software to be publicly redistributed
* on the understanding that TFS is not responsible for the correct
* functioning of this software in any circumstances.
* Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
* Define dome bits that are in ALL (or a lot of) scsi commands
#define SCSI_CTL_LINK 0x01
#define SCSI_CTL_FLAG 0x02
#define SCSI_CTL_VENDOR 0xC0
#define SCSI_CMD_LUN 0xA0 /*these two should not be needed*/
#define SCSI_CMD_LUN_SHIFT 5 /* LUN in the cmd is no longer SCSI */
struct scsi_test_unit_ready
#define SSD_SELFTEST 0x04
#define SMS_PAGE_CODE 0x3F
#define SMS_PAGE_CTRL 0xC0
#define SMS_PAGE_CTRL_CURRENT 0x00
#define SMS_PAGE_CTRL_CHANGEABLE 0x40
#define SMS_PAGE_CTRL_DEFAULT 0x80
#define SMS_PAGE_CTRL_SAVED 0xC0
struct scsi_mode_sense_big
u_char byte2
; /* same bits as small version */
u_char page
; /* same bits as small version */
struct scsi_mode_select_big
u_char byte2
; /* same bits as small version */
#define TEST_UNIT_READY 0x00
#define REQUEST_SENSE 0x03
#define PREVENT_ALLOW 0x1e
#define POSITION_TO_ELEMENT 0x2b
#define MODE_SENSE_BIG 0x54
#define MODE_SELECT_BIG 0x55
#define READ_ELEMENT_STATUS 0xb8
#define SID_QUAL_LU_OK 0x00
#define SID_QUAL_LU_OFFLINE 0x20
#define SID_QUAL_RSVD 0x40
#define SID_QUAL_BAD_LU 0x60
#define SID_REMOVABLE 0x80
u_char additional_length
;
u_char error_code
; /* same bits as new version */
u_char flags
; /* same bits as new version */
/* allocate enough room to hold new stuff
( by increasing 16 to 26 below) */
struct scsi_sense_data_new
#define SSD_ERRCODE_VALID 0x80
struct /* this is depreciated, the standard says "DON'T"*/
#define SSD_FILEMARK 0x80
u_char add_sense_code_qual
;
#define SSD_SCS_VALID 0x80
u_char data_length
; /* Sense data length */
struct scsi_mode_header_big
u_char data_length
[2]; /* Sense data length */