Changeset f7a55f9 in mainline for uspace/lib/scsi/include/scsi/spc.h
- Timestamp:
- 2011-07-05T10:43:21Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5e2aa83, bee37cf
- Parents:
- b5085a7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/scsi/include/scsi/spc.h
rb5085a7 rf7a55f9 42 42 /** SCSI command codes defined in SCSI-SPC */ 43 43 enum scsi_cmd_spc { 44 SCSI_CMD_INQUIRY = 0x12 44 SCSI_CMD_INQUIRY = 0x12, 45 SCSI_CMD_REQUEST_SENSE = 0x03 45 46 }; 46 47 47 48 /** SCSI Inquiry command */ 48 49 typedef struct { 49 /** Operation code ( 12h,SCSI_CMD_INQUIRY) */50 /** Operation code (SCSI_CMD_INQUIRY) */ 50 51 uint8_t op_code; 51 52 /** Reserved:7-2, obsolete:1, evpd:0 */ … … 92 93 93 94 /* End of required data */ 94 } scsi_std_inquiry_data_t;95 } __attribute__((packed)) scsi_std_inquiry_data_t; 95 96 96 97 /** Size of struct or union member. */ … … 138 139 }; 139 140 141 /** SCSI Request Sense command */ 142 typedef struct { 143 /** Operation code (SCSI_CMD_REQUEST_SENSE) */ 144 uint8_t op_code; 145 /** Reserved, Desc */ 146 uint8_t desc; 147 /* Reserved */ 148 uint16_t res_2; 149 /* Allocation Length */ 150 uint8_t alloc_len; 151 /* Control */ 152 uint8_t control; 153 } __attribute__((packed)) scsi_cdb_request_sense_t; 154 155 /** Minimum size of sense data. 156 * 157 * If the target returns less data, the missing bytes should be considered 158 * zero. 159 */ 160 #define SCSI_SENSE_DATA_MIN_SIZE 18 161 162 /** Maximum size of sense data */ 163 #define SCSI_SENSE_DATA_MAX_SIZE 252 164 165 /** Fixed-format sense data. 166 * 167 * Returned for Request Sense command with Desc bit cleared. 168 */ 169 typedef struct { 170 /** Valid, Response Code */ 171 uint8_t valid_rcode; 172 /** Peripheral qualifier, Peripheral device type */ 173 uint8_t obsolete_1; 174 /** Filemark, EOM, ILI, Reserved, Sense Key */ 175 uint8_t flags_key; 176 /** Information */ 177 uint32_t info; 178 /** Additional Sense Length */ 179 uint8_t additional_len; 180 /** Command-specific Information */ 181 uint8_t cmd_spec; 182 /** Additional Sense Code */ 183 uint8_t additional_code; 184 /** Additional Sense Code Qualifier */ 185 uint8_t additional_cqual; 186 /** Field-replaceable Unit Code */ 187 uint8_t fru_code; 188 /** SKSV, Sense-key specific */ 189 uint8_t key_spec[3]; 190 } __attribute__((packed)) scsi_sense_data_t; 191 192 /** Sense key */ 193 enum scsi_sense_key { 194 SCSI_SK_NO_SENSE = 0x0, 195 SCSI_SK_RECOVERED_ERROR = 0x1, 196 SCSI_SK_NOT_READY = 0x2, 197 SCSI_SK_MEDIUM_ERROR = 0x3, 198 SCSI_SK_HARDWARE_ERROR = 0x4, 199 SCSI_SK_ILLEGAL_REQUEST = 0x5, 200 SCSI_SK_UNIT_ATTENTION = 0x6, 201 SCSI_SK_DATA_PROTECT = 0x7, 202 SCSI_SK_BLANK_CHECK = 0x8, 203 SCSI_SK_VENDOR_SPECIFIC = 0x9, 204 SCSI_SK_COPY_ABORTED = 0xa, 205 SCSI_SK_ABORTED_COMMAND = 0xb, 206 SCSI_SK_VOLUME_OVERFLOW = 0xd, 207 SCSI_SK_MISCOMPARE = 0xe 208 }; 209 140 210 extern const char *scsi_dev_type_str[SCSI_DEV_LIMIT]; 141 211 extern const char *scsi_get_dev_type_str(unsigned);
Note:
See TracChangeset
for help on using the changeset viewer.