Let REPORT SUPPORTED OPERATION CODES be handled by dev handler as well

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5489 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2014-04-28 22:30:03 +00:00
parent 7c4b3c0d0c
commit 8a53a54081
2 changed files with 8 additions and 13 deletions

View File

@@ -7143,8 +7143,9 @@ static int get_cdb_info_min(struct scst_cmd *cmd,
break;
case MI_REPORT_SUPPORTED_OPERATION_CODES:
cmd->op_name = "REPORT SUPPORTED OPERATION CODES";
cmd->op_flags |= SCST_WRITE_EXCL_ALLOWED |
SCST_LOCAL_CMD | SCST_FULLY_LOCAL_CMD;
cmd->op_flags |= SCST_WRITE_EXCL_ALLOWED;
if (cmd->devt->get_supported_opcodes != NULL)
cmd->op_flags |= SCST_LOCAL_CMD | SCST_FULLY_LOCAL_CMD;
break;
case MI_REPORT_SUPPORTED_TASK_MANAGEMENT_FUNCTIONS:
cmd->op_name = "REPORT SUPPORTED TASK MANAGEMENT FUNCTIONS";

View File

@@ -2134,21 +2134,15 @@ static int scst_report_supported_opcodes(struct scst_cmd *cmd)
int req_sa = get_unaligned_be16(&cmd->cdb[4]);
const struct scst_opcode_descriptor *op = NULL;
const struct scst_opcode_descriptor **supp_opcodes = NULL;
int supp_opcodes_cnt;
int supp_opcodes_cnt, rc;
TRACE_ENTRY();
if (cmd->devt->get_supported_opcodes == NULL) {
TRACE(TRACE_MINOR, "REPORT SUPPORTED OPCODES not supported by "
"dev handler %s", cmd->devt->name);
scst_set_cmd_error(cmd, SCST_LOAD_SENSE(scst_sense_invalid_opcode));
/* get_cdb_info_min() ensures that get_supported_opcodes is not NULL here */
rc = cmd->devt->get_supported_opcodes(cmd, &supp_opcodes, &supp_opcodes_cnt);
if (rc != 0)
goto out_compl;
} else {
int rc = cmd->devt->get_supported_opcodes(cmd, &supp_opcodes,
&supp_opcodes_cnt);
if (rc != 0)
goto out_compl;
}
TRACE_DBG("cmd %p, options %d, req_opcode %x, req_sa %x, rctd %d",
cmd, options, req_opcode, req_sa, rctd);