From 9aaa0846dcc36c6b42c9035c109ce372f2849d33 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 4 Jan 2021 03:59:00 +0000 Subject: [PATCH] scst: Add support for the READ and WRITE DYN RUNTIME ATTR commands Signed-off-by: Rob Turk [ bvanassche: moved get_cdb_info_dyn_runtime_attr() definition ] git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9324 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_lib.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index f919cdcf9..a620230e0 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -495,6 +495,8 @@ static int get_cdb_info_mo(struct scst_cmd *cmd, const struct scst_sdbops *sdbops); static int get_cdb_info_var_len(struct scst_cmd *cmd, const struct scst_sdbops *sdbops); +static int get_cdb_info_dyn_runtime_attr(struct scst_cmd *cmd, + const struct scst_sdbops *sdbops); /* * +=====================================-============-======- @@ -1668,6 +1670,18 @@ static const struct scst_sdbops scst_scsi_op_table[] = { .info_op_flags = FLAG_NONE, .info_len_off = 6, .info_len_len = 4, .get_cdb_info = get_cdb_info_len_4}, + {.ops = 0xD1, .devkey = " O ", + .info_op_name = "READ DYN RUNTIME ATTR", + .info_data_direction = SCST_DATA_READ, + .info_op_flags = FLAG_NONE, + .info_len_off = 6, .info_len_len = 4, + .get_cdb_info = get_cdb_info_dyn_runtime_attr}, + {.ops = 0xD2, .devkey = " O ", + .info_op_name = "WRITE DYN RUNTIME ATTR", + .info_data_direction = SCST_DATA_WRITE, + .info_op_flags = FLAG_NONE, + .info_len_off = 6, .info_len_len = 4, + .get_cdb_info = get_cdb_info_dyn_runtime_attr}, {.ops = 0xE7, .devkey = " V ", .info_op_name = "INIT ELEMENT STATUS WRANGE", .info_data_direction = SCST_DATA_NONE, @@ -11784,6 +11798,16 @@ static int get_cdb_info_write_same32(struct scst_cmd *cmd, return get_cdb_info_write_same(cmd, sdbops, cmd->cdb[10] & 1 /*NDOB*/); } +static int get_cdb_info_dyn_runtime_attr(struct scst_cmd *cmd, + const struct scst_sdbops *sdbops) +{ + /* + * Read/write dyn runtime attr commands are non-standard, CDB len is 12 + */ + cmd->cdb_len = 12; + return get_cdb_info_len_4(cmd, sdbops); +} + /** * scst_set_cmd_from_cdb_info() - Parse the SCSI CDB. * @cmd: SCSI command to parse.