summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2014-10-06 13:22:05 +0000
committermav <mav@FreeBSD.org>2014-10-06 13:22:05 +0000
commitb913091bf13ea00d761f0764571556d6eb348f57 (patch)
tree1c8f907cdc8454147f4f1a424e758d712f5600bb
parent48c3bee1ace64a23f42dc65b9aec3fa8389a2b6c (diff)
downloadFreeBSD-src-b913091bf13ea00d761f0764571556d6eb348f57.zip
FreeBSD-src-b913091bf13ea00d761f0764571556d6eb348f57.tar.gz
MFC r271845:
Allow more commands to pass persistent reservation according to SPC-4 r37.
-rw-r--r--sys/cam/ctl/ctl.c2
-rw-r--r--sys/cam/ctl/ctl_cmd_table.c15
-rw-r--r--sys/cam/scsi/scsi_all.h1
3 files changed, 12 insertions, 6 deletions
diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c
index 8499532..e5a3f60 100644
--- a/sys/cam/ctl/ctl.c
+++ b/sys/cam/ctl/ctl.c
@@ -7904,7 +7904,7 @@ retry:
res_cap = (struct scsi_per_res_cap *)ctsio->kern_data_ptr;
scsi_ulto2b(sizeof(*res_cap), res_cap->length);
- res_cap->flags2 |= SPRI_TMV | SPRI_ALLOW_3;
+ res_cap->flags2 |= SPRI_TMV | SPRI_ALLOW_5;
type_mask = SPRI_TM_WR_EX_AR |
SPRI_TM_EX_AC_RO |
SPRI_TM_WR_EX_RO |
diff --git a/sys/cam/ctl/ctl_cmd_table.c b/sys/cam/ctl/ctl_cmd_table.c
index 7d679a7..0f9e9d1 100644
--- a/sys/cam/ctl/ctl_cmd_table.c
+++ b/sys/cam/ctl/ctl_cmd_table.c
@@ -304,7 +304,8 @@ const struct ctl_cmd_entry ctl_cmd_table_84[32] =
/* 00 RECEIVE COPY STATUS (LID1) */
{ctl_receive_copy_status_lid1, CTL_SERIDX_RD_CAP,
CTL_CMD_FLAG_OK_ON_BOTH |
- CTL_FLAG_DATA_IN,
+ CTL_FLAG_DATA_IN |
+ CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
CTL_LUN_PAT_NONE,
16, {0x00, 0xff, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
@@ -320,14 +321,16 @@ const struct ctl_cmd_entry ctl_cmd_table_84[32] =
CTL_CMD_FLAG_OK_ON_STOPPED |
CTL_CMD_FLAG_OK_ON_INOPERABLE |
CTL_CMD_FLAG_OK_ON_SECONDARY |
- CTL_FLAG_DATA_IN,
+ CTL_FLAG_DATA_IN |
+ CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
CTL_LUN_PAT_NONE,
16, {0x03, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
/* 04 RECEIVE COPY FAILURE DETAILS (LID1) */
{ctl_receive_copy_failure_details, CTL_SERIDX_RD_CAP,
CTL_CMD_FLAG_OK_ON_BOTH |
- CTL_FLAG_DATA_IN,
+ CTL_FLAG_DATA_IN |
+ CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
CTL_LUN_PAT_NONE,
16, {0x04, 0xff, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
@@ -470,7 +473,8 @@ const struct ctl_cmd_entry ctl_cmd_table_a3[32] =
CTL_CMD_FLAG_OK_ON_STOPPED |
CTL_CMD_FLAG_OK_ON_INOPERABLE |
CTL_CMD_FLAG_OK_ON_SECONDARY |
- CTL_FLAG_DATA_IN,
+ CTL_FLAG_DATA_IN |
+ CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
CTL_LUN_PAT_NONE,
12, {0x0c, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
@@ -479,7 +483,8 @@ const struct ctl_cmd_entry ctl_cmd_table_a3[32] =
CTL_CMD_FLAG_OK_ON_STOPPED |
CTL_CMD_FLAG_OK_ON_INOPERABLE |
CTL_CMD_FLAG_OK_ON_SECONDARY |
- CTL_FLAG_DATA_IN,
+ CTL_FLAG_DATA_IN |
+ CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
CTL_LUN_PAT_NONE,
12, {0x0d, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
diff --git a/sys/cam/scsi/scsi_all.h b/sys/cam/scsi/scsi_all.h
index db2ee80..8eb58fe 100644
--- a/sys/cam/scsi/scsi_all.h
+++ b/sys/cam/scsi/scsi_all.h
@@ -317,6 +317,7 @@ struct scsi_per_res_cap
#define SPRI_ALLOW_2 0x20
#define SPRI_ALLOW_3 0x30
#define SPRI_ALLOW_4 0x40
+#define SPRI_ALLOW_5 0x50
#define SPRI_PTPL_A 0x01
uint8_t type_mask[2];
#define SPRI_TM_WR_EX_AR 0x8000
OpenPOWER on IntegriCloud