summaryrefslogtreecommitdiff
path: root/drivers/scsi/constants.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/constants.c')
-rw-r--r--drivers/scsi/constants.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c
index 7bdeed1c5a56..024553f9c247 100644
--- a/drivers/scsi/constants.c
+++ b/drivers/scsi/constants.c
@@ -1235,6 +1235,20 @@ scsi_print_sense_hdr(const char *name, struct scsi_sense_hdr *sshdr)
}
EXPORT_SYMBOL(scsi_print_sense_hdr);
+/*
+ * Print normalized SCSI sense header with device information and a prefix.
+ */
+void
+scsi_cmd_print_sense_hdr(struct scsi_cmnd *scmd, const char *desc,
+ struct scsi_sense_hdr *sshdr)
+{
+ scmd_printk(KERN_INFO, scmd, "%s: ", desc);
+ scsi_show_sense_hdr(sshdr);
+ scmd_printk(KERN_INFO, scmd, "%s: ", desc);
+ scsi_show_extd_sense(sshdr->asc, sshdr->ascq);
+}
+EXPORT_SYMBOL(scsi_cmd_print_sense_hdr);
+
static void
scsi_decode_sense_buffer(const unsigned char *sense_buffer, int sense_len,
struct scsi_sense_hdr *sshdr)