summaryrefslogtreecommitdiffstats
path: root/sys/cam/ctl/ctl.c
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2017-01-05 11:50:50 +0000
committermav <mav@FreeBSD.org>2017-01-05 11:50:50 +0000
commit4085dc0332a820a67f14c644ce04c4d4b39393d2 (patch)
treee8342118f515b1e56f55c322790de2a33eeaf0ca /sys/cam/ctl/ctl.c
parentc7660adf6d1d1fa6490191d997d2d79df14c1100 (diff)
downloadFreeBSD-src-4085dc0332a820a67f14c644ce04c4d4b39393d2.zip
FreeBSD-src-4085dc0332a820a67f14c644ce04c4d4b39393d2.tar.gz
MFC r310390: Add support for REPD bit in RSTMF command.
We have no real timeout values to report there, but its better then error.
Diffstat (limited to 'sys/cam/ctl/ctl.c')
-rw-r--r--sys/cam/ctl/ctl.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c
index 2853808..22cee47 100644
--- a/sys/cam/ctl/ctl.c
+++ b/sys/cam/ctl/ctl.c
@@ -7462,7 +7462,7 @@ int
ctl_report_supported_tmf(struct ctl_scsiio *ctsio)
{
struct scsi_report_supported_tmf *cdb;
- struct scsi_report_supported_tmf_data *data;
+ struct scsi_report_supported_tmf_ext_data *data;
int retval;
int alloc_len, total_len;
@@ -7472,7 +7472,10 @@ ctl_report_supported_tmf(struct ctl_scsiio *ctsio)
retval = CTL_RETVAL_COMPLETE;
- total_len = sizeof(struct scsi_report_supported_tmf_data);
+ if (cdb->options & RST_REPD)
+ total_len = sizeof(struct scsi_report_supported_tmf_ext_data);
+ else
+ total_len = sizeof(struct scsi_report_supported_tmf_data);
alloc_len = scsi_4btoul(cdb->length);
ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO);
@@ -7491,10 +7494,11 @@ ctl_report_supported_tmf(struct ctl_scsiio *ctsio)
ctsio->kern_data_resid = 0;
ctsio->kern_rel_offset = 0;
- data = (struct scsi_report_supported_tmf_data *)ctsio->kern_data_ptr;
+ data = (struct scsi_report_supported_tmf_ext_data *)ctsio->kern_data_ptr;
data->byte1 |= RST_ATS | RST_ATSS | RST_CTSS | RST_LURS | RST_QTS |
RST_TRS;
data->byte2 |= RST_QAES | RST_QTSS | RST_ITNRS;
+ data->length = total_len - 4;
ctl_set_success(ctsio);
ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
OpenPOWER on IntegriCloud