aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/ctl/ctl_error.h
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2016-12-24 17:42:34 +0000
committerAlexander Motin <mav@FreeBSD.org>2016-12-24 17:42:34 +0000
commit4fc0d1d757db3825ff144272ef3a335c79c2e578 (patch)
tree689a408acb53dbc7e42293b5efa214891e5b1a45 /sys/cam/ctl/ctl_error.h
parentd97b8afd73784c8865808adff8af102705b0ac1d (diff)
downloadsrc-4fc0d1d757db3825ff144272ef3a335c79c2e578.tar.gz
src-4fc0d1d757db3825ff144272ef3a335c79c2e578.zip
Improve length handling when writing sense data.
- Allow maximal sense size limitation via Control Extension mode page. - When sense size limited, include descriptors atomically: whole or none. - Set new SDAT_OVFL bit if some descriptors don't fit the limit. - Report real written sense length instead of static maximal 252 bytes. MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=310524
Diffstat (limited to 'sys/cam/ctl/ctl_error.h')
-rw-r--r--sys/cam/ctl/ctl_error.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/cam/ctl/ctl_error.h b/sys/cam/ctl/ctl_error.h
index 192228977896..d4cdbb370e25 100644
--- a/sys/cam/ctl/ctl_error.h
+++ b/sys/cam/ctl/ctl_error.h
@@ -45,12 +45,12 @@
struct ctl_lun;
-void ctl_set_sense_data_va(struct scsi_sense_data *sense_data, void *lun,
- scsi_sense_data_type sense_format, int current_error,
- int sense_key, int asc, int ascq, va_list ap);
-void ctl_set_sense_data(struct scsi_sense_data *sense_data, void *lun,
- scsi_sense_data_type sense_format, int current_error,
- int sense_key, int asc, int ascq, ...);
+void ctl_set_sense_data_va(struct scsi_sense_data *sense_data, u_int *sense_len,
+ void *lun, scsi_sense_data_type sense_format, int current_error,
+ int sense_key, int asc, int ascq, va_list ap);
+void ctl_set_sense_data(struct scsi_sense_data *sense_data, u_int *sense_len,
+ void *lun, scsi_sense_data_type sense_format, int current_error,
+ int sense_key, int asc, int ascq, ...);
void ctl_set_sense(struct ctl_scsiio *ctsio, int current_error, int sense_key,
int asc, int ascq, ...);
void ctl_sense_to_desc(struct scsi_sense_data_fixed *sense_src,
@@ -60,7 +60,8 @@ void ctl_sense_to_fixed(struct scsi_sense_data_desc *sense_src,
void ctl_set_ua(struct ctl_scsiio *ctsio, int asc, int ascq);
ctl_ua_type ctl_build_qae(struct ctl_lun *lun, uint32_t initidx, uint8_t *resp);
ctl_ua_type ctl_build_ua(struct ctl_lun *lun, uint32_t initidx,
- struct scsi_sense_data *sense, scsi_sense_data_type sense_format);
+ struct scsi_sense_data *sense, u_int *sense_len,
+ scsi_sense_data_type sense_format);
void ctl_set_overlapped_cmd(struct ctl_scsiio *ctsio);
void ctl_set_overlapped_tag(struct ctl_scsiio *ctsio, uint8_t tag);
void ctl_set_invalid_field(struct ctl_scsiio *ctsio, int sks_valid, int command,