lib: parse Information sense descriptor type
The Information descriptor type is defined in SPC-5 (r17 4.4.2.2) and may be used to provide the data offset on COMPARE_AND_WRITE miscompare. Signed-off-by: David Disseldorp <ddiss@suse.de>
This commit is contained in:
@@ -281,8 +281,10 @@ struct scsi_sense {
|
|||||||
unsigned sense_specific:1;
|
unsigned sense_specific:1;
|
||||||
unsigned ill_param_in_cdb:1;
|
unsigned ill_param_in_cdb:1;
|
||||||
unsigned bit_pointer_valid:1;
|
unsigned bit_pointer_valid:1;
|
||||||
|
unsigned info_valid:1;
|
||||||
unsigned char bit_pointer;
|
unsigned char bit_pointer;
|
||||||
uint16_t field_pointer;
|
uint16_t field_pointer;
|
||||||
|
uint64_t information;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct scsi_data {
|
struct scsi_data {
|
||||||
|
|||||||
@@ -330,6 +330,13 @@ static void parse_sense_descriptors(struct scsi_sense *sense, const uint8_t *sb,
|
|||||||
if (addl_len < 4)
|
if (addl_len < 4)
|
||||||
break;
|
break;
|
||||||
switch (p[0]) {
|
switch (p[0]) {
|
||||||
|
case 0:
|
||||||
|
/* Information descriptor with VALID flag */
|
||||||
|
if (addl_len == 0x0a && p[2] & 0x80) {
|
||||||
|
sense->info_valid = 1;
|
||||||
|
sense->information = scsi_get_uint64(p + 4);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
/* Sense key specific sense data descriptor */
|
/* Sense key specific sense data descriptor */
|
||||||
if (addl_len == 0x06)
|
if (addl_len == 0x06)
|
||||||
|
|||||||
Reference in New Issue
Block a user