svn commit: r311437 - stable/11/sys/cam/scsi
Alexander Motin
mav at FreeBSD.org
Thu Jan 5 11:53:08 UTC 2017
Author: mav
Date: Thu Jan 5 11:53:07 2017
New Revision: 311437
URL: https://svnweb.freebsd.org/changeset/base/311437
Log:
MFC r310489: Implement printing forwarded sense data.
Modified:
stable/11/sys/cam/scsi/scsi_all.c
stable/11/sys/cam/scsi/scsi_all.h
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/cam/scsi/scsi_all.c
==============================================================================
--- stable/11/sys/cam/scsi/scsi_all.c Thu Jan 5 11:52:11 2017 (r311436)
+++ stable/11/sys/cam/scsi/scsi_all.c Thu Jan 5 11:53:07 2017 (r311437)
@@ -4711,6 +4711,26 @@ scsi_sense_ata_sbuf(struct sbuf *sb, str
sbuf_printf(sb, "device: %02x, ", res->device);
}
+void
+scsi_sense_forwarded_sbuf(struct sbuf *sb, struct scsi_sense_data *sense,
+ u_int sense_len, uint8_t *cdb, int cdb_len,
+ struct scsi_inquiry_data *inq_data,
+ struct scsi_sense_desc_header *header)
+{
+ struct scsi_sense_forwarded *forwarded;
+ const char *sense_key_desc;
+ const char *asc_desc;
+ int error_code, sense_key, asc, ascq;
+
+ forwarded = (struct scsi_sense_forwarded *)header;
+ scsi_extract_sense_len((struct scsi_sense_data *)forwarded->sense_data,
+ forwarded->length - 2, &error_code, &sense_key, &asc, &ascq, 1);
+ scsi_sense_desc(sense_key, asc, ascq, NULL, &sense_key_desc, &asc_desc);
+
+ sbuf_printf(sb, "Forwarded sense: %s asc:%x,%x (%s): ",
+ sense_key_desc, asc, ascq, asc_desc);
+}
+
/*
* Generic sense descriptor printing routine. This is used when we have
* not yet implemented a specific printing routine for this descriptor.
@@ -4758,7 +4778,8 @@ struct scsi_sense_desc_printer {
{SSD_DESC_STREAM, scsi_sense_stream_sbuf},
{SSD_DESC_BLOCK, scsi_sense_block_sbuf},
{SSD_DESC_ATA, scsi_sense_ata_sbuf},
- {SSD_DESC_PROGRESS, scsi_sense_progress_sbuf}
+ {SSD_DESC_PROGRESS, scsi_sense_progress_sbuf},
+ {SSD_DESC_FORWARDED, scsi_sense_forwarded_sbuf}
};
void
Modified: stable/11/sys/cam/scsi/scsi_all.h
==============================================================================
--- stable/11/sys/cam/scsi/scsi_all.h Thu Jan 5 11:52:11 2017 (r311436)
+++ stable/11/sys/cam/scsi/scsi_all.h Thu Jan 5 11:53:07 2017 (r311437)
@@ -3532,6 +3532,8 @@ struct scsi_sense_forwarded
#define SSD_FORWARDED_SDS_UNK 0x00
#define SSD_FORWARDED_SDS_EXSRC 0x01
#define SSD_FORWARDED_SDS_EXDST 0x02
+ uint8_t status;
+ uint8_t sense_data[];
};
/*
@@ -3764,6 +3766,10 @@ void scsi_sense_ata_sbuf(struct sbuf *sb
u_int sense_len, uint8_t *cdb, int cdb_len,
struct scsi_inquiry_data *inq_data,
struct scsi_sense_desc_header *header);
+void scsi_sense_forwarded_sbuf(struct sbuf *sb, struct scsi_sense_data *sense,
+ u_int sense_len, uint8_t *cdb, int cdb_len,
+ struct scsi_inquiry_data *inq_data,
+ struct scsi_sense_desc_header *header);
void scsi_sense_generic_sbuf(struct sbuf *sb, struct scsi_sense_data *sense,
u_int sense_len, uint8_t *cdb, int cdb_len,
struct scsi_inquiry_data *inq_data,
More information about the svn-src-stable
mailing list