Add SCSI sense key values.

This commit is contained in:
R. Bernstein
2010-02-05 03:37:27 -05:00
parent 34bc1ec0b4
commit 35b6969a45
2 changed files with 75 additions and 28 deletions

View File

@@ -86,6 +86,31 @@ extern "C" {
uint8_t asb[46]; /**< Additional sense bytes */
} mmc_request_sense_t;
/**
Meanings of the values of mmc_request_sense.sense_key
*/
typedef enum {
MMC_SENSE_KEY_NO_SENSE = 0,
MMC_SENSE_KEY_RECOVERED_ERROR = 1,
MMC_SENSE_KEY_NOT_READY = 2,
MMC_SENSE_KEY_MEDIUM_ERROR = 3,
MMC_SENSE_KEY_HARDWARE_ERROR = 4,
MMC_SENSE_KEY_ILLEGAL_REQUEST = 5,
MMC_SENSE_KEY_UNIT_ATTENTION = 6,
MMC_SENSE_KEY_DATA_PROTECT = 7,
MMC_SENSE_KEY_FIRMWARE_ERROR = 9,
MMC_SENSE_KEY_ABORTED_COMMAND = 11,
MMC_SENSE_KEY_EQUAL = 12,
MMC_SENSE_KEY_VOLUME_OVERFLOW = 13,
MMC_SENSE_KEY_MISCOMPARE = 14,
} mmc_sense_key_t;
/**
Maps a mmc_sense_key_t into a string name.
*/
extern const char mmc_sense_key2str[16][40];
/**
Set this to the maximum value in milliseconds that we will
wait on an MMC command.

View File

@@ -42,6 +42,28 @@
#include <errno.h>
#endif
/**
Maps a mmc_sense_key_t into a string name.
*/
const char mmc_sense_key2str[16][40] = {
"No Sense", /**< 0 No specific Sense Key info reported */
"Recovered Error", /**< 1 Completed ok with recovery */
"Not Ready", /**< 2 */
"Medium Error", /**< 3 */
"Hardware Error", /**< 4 */
"Illegal Request", /**< 5 */
"Unit Attention", /**< 6 */
"Data Protect", /**< 7 */
"Blank/Nonblank", /**< 8 */
"Firmware Error", /**< 9 - Vendor-specific */
"Copy aborted", /**< A */
"Aborted Command", /**< B */
"Equal", /**< C */
"Volume Overflow", /**< D */
"Miscompare", /**< E */
"(reserved error code)", /**< F */
};
/** The below variables are trickery to force enum symbol values to be
recorded in debug symbol tables. They are used to allow one to refer
to the enumeration value names in the typedefs above in a debugger