From 53c58f8aea983baf2f6b9b1155109221c689681b Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Wed, 14 Oct 2020 20:43:14 +0200 Subject: [PATCH] lib: parse Information fixed sense field This field is documented in SPC-5 (r17 4.4.3). Unlike the descriptor type, the fixed Information field is four bytes wide. Signed-off-by: David Disseldorp --- lib/iscsi-command.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/iscsi-command.c b/lib/iscsi-command.c index 582517b..3eb8e8f 100644 --- a/lib/iscsi-command.c +++ b/lib/iscsi-command.c @@ -354,6 +354,10 @@ void scsi_parse_sense_data(struct scsi_sense *sense, const uint8_t *sb) case 0x71: /* Fixed format */ sense->key = sb[2] & 0x0f; + if (sb[0] & 0x80) { /* VALID */ + sense->info_valid = 1; + sense->information = scsi_get_uint32(sb + 3); + } sense->ascq = scsi_get_uint16(&sb[12]); parse_sense_spec(sense, sb + 15); break;