Changeset 582fe388 in mainline
- Timestamp:
- 2011-07-24T16:48:33Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- de3432b
- Parents:
- 45cae6b
- Location:
- uspace
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbmast/scsi_ms.c
r45cae6b r582fe388 64 64 { 65 65 scsi_sense_data_t sense_buf; 66 unsigned sense_key; 66 67 int rc; 67 68 68 69 rc = usbmast_request_sense(mfun, &sense_buf, sizeof(sense_buf)); 69 70 if (rc == EOK) { 70 printf("Got sense data (sense_key=0x%x, asc=0x%02x, " 71 "ascq=0x%02x.\n", sense_buf.flags_key & 0x0f, 71 sense_key = sense_buf.flags_key & 0x0f; 72 printf("Got sense data. Sense key: 0x%x (%s), ASC 0x%02x, " 73 "ASCQ 0x%02x.\n", sense_key, 74 scsi_get_sense_key_str(sense_key), 72 75 sense_buf.additional_code, 73 76 sense_buf.additional_cqual); -
uspace/lib/scsi/include/scsi/spc.h
r45cae6b r582fe388 205 205 SCSI_SK_ABORTED_COMMAND = 0xb, 206 206 SCSI_SK_VOLUME_OVERFLOW = 0xd, 207 SCSI_SK_MISCOMPARE = 0xe 207 SCSI_SK_MISCOMPARE = 0xe, 208 209 SCSI_SK_LIMIT = 0x10 208 210 }; 209 211 210 212 extern const char *scsi_dev_type_str[SCSI_DEV_LIMIT]; 213 extern const char *scsi_sense_key_str[SCSI_SK_LIMIT]; 214 211 215 extern const char *scsi_get_dev_type_str(unsigned); 216 extern const char *scsi_get_sense_key_str(unsigned); 212 217 213 218 #endif -
uspace/lib/scsi/src/spc.c
r45cae6b r582fe388 44 44 }; 45 45 46 const char *scsi_sense_key_str[SCSI_SK_LIMIT] = { 47 [SCSI_SK_NO_SENSE] = "No Sense", 48 [SCSI_SK_RECOVERED_ERROR] = "Recovered Error", 49 [SCSI_SK_NOT_READY] = "Not Ready", 50 [SCSI_SK_MEDIUM_ERROR] = "Medium Error", 51 [SCSI_SK_HARDWARE_ERROR] = "Hardware Error", 52 [SCSI_SK_ILLEGAL_REQUEST] = "Illegal Request", 53 [SCSI_SK_UNIT_ATTENTION] = "Unit Attention", 54 [SCSI_SK_DATA_PROTECT] = "Data Protect", 55 [SCSI_SK_BLANK_CHECK] = "Blank Check", 56 [SCSI_SK_VENDOR_SPECIFIC] = "Vendor-specific", 57 [SCSI_SK_COPY_ABORTED] = "Copy Aborted", 58 [SCSI_SK_ABORTED_COMMAND] = "Aborted Command", 59 [SCSI_SK_VOLUME_OVERFLOW] = "Volume Overflow", 60 [SCSI_SK_MISCOMPARE] = "Miscompare" 61 }; 62 46 63 /** Get peripheral device type string. 47 64 * … … 53 70 { 54 71 if (dev_type >= SCSI_DEV_LIMIT || scsi_dev_type_str[dev_type] == NULL) 55 return " <unknown>";72 return "Unknown"; 56 73 57 74 return scsi_dev_type_str[dev_type]; 58 75 } 76 77 /** Get sense key string. 78 * 79 * Return string description of SCSI sense key. 80 * The returned string is valid indefinitely, the caller should 81 * not attempt to free it. 82 */ 83 const char *scsi_get_sense_key_str(unsigned sense_key) 84 { 85 if (sense_key >= SCSI_SK_LIMIT || scsi_sense_key_str[sense_key] == NULL) 86 return "Unknown"; 87 88 return scsi_sense_key_str[sense_key]; 89 } 90
Note:
See TracChangeset
for help on using the changeset viewer.