2 * this is from the linux kernel scsi_eh.h
10 * This is a slightly modified SCSI sense "descriptor" format header.
11 * The addition is to allow the 0x70 and 0x71 response codes. The idea
12 * is to place the salient data from either "fixed" or "descriptor" sense
13 * format into one structure to ease application processing.
15 * The original sense buffer should be kept around for those cases
16 * in which more information is required (e.g. the LBA of a MEDIUM ERROR).
18 struct scsi_sense_hdr
{ /* See SPC-3 section 4.5 */
19 uint8_t response_code
; /* permit: 0x0, 0x70, 0x71, 0x72, 0x73 */
26 uint8_t additional_length
; /* always 0 for fixed sense format */
29 static inline int scsi_sense_valid(struct scsi_sense_hdr
*sshdr
)
34 return (sshdr
->response_code
& 0x70) == 0x70;
37 extern int scsi_normalize_sense(const uint8_t *sense_buffer
, int sb_len
,
38 struct scsi_sense_hdr
*sshdr
);