Fix ALLOW COMMANDS field of PERSISTENT RESERVE IN REPORT CAPABILITIES handling according to SPC-4 suggestions

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4395 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2012-07-06 19:57:48 +00:00
parent 64be93db95
commit df4d0f9dad
2 changed files with 19 additions and 8 deletions
+18 -7
View File
@@ -455,7 +455,8 @@ static const struct scst_sdbops scst_scsi_op_table[] = {
{.ops = 0x1A, .devkey = "OMOOOOOOOOOOOOOO",
.info_op_name = "MODE SENSE(6)",
.info_data_direction = SCST_DATA_READ,
.info_op_flags = SCST_SMALL_TIMEOUT,
.info_op_flags = SCST_SMALL_TIMEOUT |
SCST_WRITE_EXCL_ALLOWED,
.info_len_off = 4, .info_len_len = 1,
.get_cdb_info = get_cdb_info_len_1},
{.ops = 0x1B, .devkey = " O ",
@@ -481,7 +482,7 @@ static const struct scst_sdbops scst_scsi_op_table[] = {
{.ops = 0x1C, .devkey = "OOOOOOOOOOOOOOOO",
.info_op_name = "RECEIVE DIAGNOSTIC RESULTS",
.info_data_direction = SCST_DATA_READ,
.info_op_flags = FLAG_NONE,
.info_op_flags = SCST_WRITE_EXCL_ALLOWED,
.info_len_off = 3, .info_len_len = 2,
.get_cdb_info = get_cdb_info_len_2},
{.ops = 0x1D, .devkey = "MMMMMMMMMMMMMMMM",
@@ -674,7 +675,8 @@ static const struct scst_sdbops scst_scsi_op_table[] = {
{.ops = 0x3C, .devkey = "OOOOOOOOOOOOOOOO",
.info_op_name = "READ BUFFER",
.info_data_direction = SCST_DATA_READ,
.info_op_flags = SCST_SMALL_TIMEOUT,
.info_op_flags = SCST_SMALL_TIMEOUT |
SCST_WRITE_EXCL_ALLOWED,
.info_len_off = 5, .info_len_len = 2,
.get_cdb_info = get_cdb_info_len_2},
{.ops = 0x3D, .devkey = " O O ",
@@ -866,7 +868,8 @@ static const struct scst_sdbops scst_scsi_op_table[] = {
{.ops = 0x5A, .devkey = "OOOOOOOOOOOOOOOO",
.info_op_name = "MODE SENSE(10)",
.info_data_direction = SCST_DATA_READ,
.info_op_flags = SCST_SMALL_TIMEOUT,
.info_op_flags = SCST_SMALL_TIMEOUT |
SCST_WRITE_EXCL_ALLOWED,
.info_len_off = 7, .info_len_len = 2,
.get_cdb_info = get_cdb_info_len_2},
{.ops = 0x5B, .devkey = " O ",
@@ -929,7 +932,7 @@ static const struct scst_sdbops scst_scsi_op_table[] = {
{.ops = 0x84, .devkey = "OOOOOOOOOOOOOOOO",
.info_op_name = "RECEIVE COPY RESULT",
.info_data_direction = SCST_DATA_WRITE,
.info_op_flags = FLAG_NONE,
.info_op_flags = SCST_WRITE_EXCL_ALLOWED|SCST_EXCL_ACCESS_ALLOWED,
.info_len_off = 10, .info_len_len = 4,
.get_cdb_info = get_cdb_info_len_4},
{.ops = 0x85, .devkey = "O O O ",
@@ -975,7 +978,7 @@ static const struct scst_sdbops scst_scsi_op_table[] = {
{.ops = 0x8C, .devkey = " OOOOOOOOO ",
.info_op_name = "READ ATTRIBUTE",
.info_data_direction = SCST_DATA_READ,
.info_op_flags = FLAG_NONE,
.info_op_flags = SCST_WRITE_EXCL_ALLOWED,
.info_len_off = 10, .info_len_len = 4,
.get_cdb_info = get_cdb_info_len_4},
{.ops = 0x8D, .devkey = " OOOOOOOOO ",
@@ -1201,7 +1204,7 @@ static const struct scst_sdbops scst_scsi_op_table[] = {
.info_op_flags = FLAG_NONE,
.info_len_off = 9, .info_len_len = 2,
.get_cdb_info = get_cdb_info_len_2},
{.ops = 0xB7, .devkey = " O ",
{.ops = 0xB7, .devkey = "O O ",
.info_op_name = "READ DEFECT DATA(12)",
.info_data_direction = SCST_DATA_READ,
.info_op_flags = SCST_WRITE_EXCL_ALLOWED,
@@ -6540,6 +6543,14 @@ static int get_cdb_info_min(struct scst_cmd *cmd,
cmd->op_flags |= SCST_REG_RESERVE_ALLOWED |
SCST_WRITE_EXCL_ALLOWED | SCST_EXCL_ACCESS_ALLOWED;
break;
case MI_REPORT_SUPPORTED_OPERATION_CODES:
cmd->op_name = "REPORT SUPPORTED OPERATION CODES";
cmd->op_flags |= SCST_WRITE_EXCL_ALLOWED;
break;
case MI_REPORT_SUPPORTED_TASK_MANAGEMENT_FUNCTIONS:
cmd->op_name = "REPORT SUPPORTED TASK MANAGEMENT FUNCTIONS";
cmd->op_flags |= SCST_WRITE_EXCL_ALLOWED;
break;
default:
break;
}
+1 -1
View File
@@ -2523,7 +2523,7 @@ void scst_pr_report_caps(struct scst_cmd *cmd, uint8_t *buffer, int buffer_size)
buffer[1] = 8;
buffer[2] = crh << 4 | sip_c << 3 | atp_c << 2 | ptpl_c;
buffer[3] = (1 << 7) | (dev->pr_aptpl > 0 ? 1 : 0);
buffer[3] = (1 << 7) | (4 << 4) | (dev->pr_aptpl > 0 ? 1 : 0);
/* All commands supported */
buffer[4] = 0xEA;