Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312655
b: refs/heads/master
c: eba2ca4
h: refs/heads/master
i:
  312653: bf0179c
  312651: 3cb6a26
  312647: 2361dd5
  312639: 0330956
v: v3
  • Loading branch information
Nicholas Bellinger committed Jul 17, 2012
1 parent d0128f8 commit fa4aa18
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3d6d72014f16967ca92765040be30f022c5952e6
refs/heads/master: eba2ca450526c1aaf2bfd363dffd63b024e80ea7
42 changes: 41 additions & 1 deletion trunk/drivers/target/target_core_spc.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <target/target_core_fabric.h>

#include "target_core_internal.h"
#include "target_core_alua.h"
#include "target_core_pr.h"
#include "target_core_ua.h"

Expand Down Expand Up @@ -940,7 +941,8 @@ static int spc_emulate_testunitready(struct se_cmd *cmd)

int spc_parse_cdb(struct se_cmd *cmd, unsigned int *size)
{
struct se_subsystem_dev *su_dev = cmd->se_dev->se_sub_dev;
struct se_device *dev = cmd->se_dev;
struct se_subsystem_dev *su_dev = dev->se_sub_dev;
unsigned char *cdb = cmd->t_task_cdb;

switch (cdb[0]) {
Expand Down Expand Up @@ -1050,6 +1052,44 @@ int spc_parse_cdb(struct se_cmd *cmd, unsigned int *size)
cmd->execute_cmd = spc_emulate_testunitready;
*size = 0;
break;
case MAINTENANCE_IN:
if (dev->transport->get_device_type(dev) != TYPE_ROM) {
/*
* MAINTENANCE_IN from SCC-2
* Check for emulated MI_REPORT_TARGET_PGS
*/
if ((cdb[1] & 0x1f) == MI_REPORT_TARGET_PGS &&
su_dev->t10_alua.alua_type == SPC3_ALUA_EMULATED) {
cmd->execute_cmd =
target_emulate_report_target_port_groups;
}
*size = get_unaligned_be32(&cdb[6]);
} else {
/*
* GPCMD_SEND_KEY from multi media commands
*/
*size = get_unaligned_be16(&cdb[8]);
}
break;
case MAINTENANCE_OUT:
if (dev->transport->get_device_type(dev) != TYPE_ROM) {
/*
* MAINTENANCE_OUT from SCC-2
* Check for emulated MO_SET_TARGET_PGS.
*/
if (cdb[1] == MO_SET_TARGET_PGS &&
su_dev->t10_alua.alua_type == SPC3_ALUA_EMULATED) {
cmd->execute_cmd =
target_emulate_set_target_port_groups;
}
*size = get_unaligned_be32(&cdb[6]);
} else {
/*
* GPCMD_SEND_KEY from multi media commands
*/
*size = get_unaligned_be16(&cdb[8]);
}
break;
default:
pr_warn("TARGET_CORE[%s]: Unsupported SCSI Opcode"
" 0x%02x, sending CHECK_CONDITION.\n",
Expand Down

0 comments on commit fa4aa18

Please sign in to comment.