From b25cb2a7e56dd2aa7d3a099585f65ca5eb0ee03f Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 28 Jun 2012 22:27:51 +0000 Subject: [PATCH] scst: Fix MAINTENANCE IN parsing Although I do not know of any initiator that asks for the extended parameter data format when submitting a REPORT TARGET PORT GROUPS command, I think it's a good idea to support that data format (i.e. three most significant bits of the second CDB byte are 001 instead of 000). The attached patch should implement that. Additionally, cmd->op_name is set to something more descriptive than "MAINTENANCE IN" in that patch. Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4385 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_lib.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 0fc7c80b0..1c9a456f1 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -6497,9 +6497,14 @@ out: static int get_cdb_info_min(struct scst_cmd *cmd, const struct scst_sdbops *sdbops) { - switch (cmd->cdb[1]) { + switch (cmd->cdb[1] & 0x1f) { case MI_REPORT_IDENTIFYING_INFORMATION: - case MI_REPORT_TARGET_PGS: /* REPORT TARGET PORT GROUPS */ + cmd->op_name = "REPORT IDENTIFYING INFORMATION"; + cmd->op_flags |= SCST_REG_RESERVE_ALLOWED | + SCST_WRITE_EXCL_ALLOWED | SCST_EXCL_ACCESS_ALLOWED; + break; + case MI_REPORT_TARGET_PGS: + cmd->op_name = "REPORT TARGET PORT GROUPS"; cmd->op_flags |= SCST_REG_RESERVE_ALLOWED | SCST_WRITE_EXCL_ALLOWED | SCST_EXCL_ACCESS_ALLOWED; break;