Thread (90 messages) flat view 90 messages, 4 authors, 1d ago

Re: [PATCH v2 01/40] scsi: define all additional sense codes and their qualifiers

From: Hannes Reinecke <hare@suse.de>
Date: 2026-09-07 12:01:46
Also in: linux-ide, linux-s390, linux-scsi

On 9/3/26 5:41 AM, Damien Le Moal wrote:
Introduce the file include/scsi/scsi_sense.h to define all existing
additional sense codes and their combinations with additional sense code
qualifiers, according to the most current T10 list available at
https://www.t10.org/lists/asc-num.txt.

Additional sense codes (ASCs) are individually defined as an 8-bit value
with the ASC_ name prefix. The combination of all ASCs with T10 defined
possible non-zero code qualifiers are defined as 16-bits values. The
16-bits value for ASCs with a zero ASCQ are defined together with the ASC
8-code using the ASC() macro.

The sense key macro definitions in include/scsi/scsi_proto.h are also
moved into this new file and scsi_sense.h is included in scsi_proto.h. The
helper function scsi_sense_code() is defined to facilitate generating a
16-bits sense code from 8-bits ASC and ASCQ. The accessors
scsi_sense_code_asc() and scsi_sense_code_ascq() are defined for the
reverse operation, that is, to respectively extract an ASC and an ASCQ
from a 16-bits sense code.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
---
  include/scsi/scsi_proto.h |  20 +-
  include/scsi/scsi_sense.h | 943 ++++++++++++++++++++++++++++++++++++++
  2 files changed, 944 insertions(+), 19 deletions(-)
  create mode 100644 include/scsi/scsi_sense.h
Reviewed-by: Hannes Reinecke <hare@kernel.org>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
hare@suse.de                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help