Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302423
b: refs/heads/master
c: 8da1093
h: refs/heads/master
i:
  302421: 305bb88
  302419: 8c97714
  302415: f812b56
v: v3
  • Loading branch information
mengcong authored and Nicholas Bellinger committed May 17, 2012
1 parent 210dd58 commit 18d3725
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5b9a4d7280e160982a8ea37bc03619f53b5c98b7
refs/heads/master: 8da10935bc8358f03c9d90ed2e4a3bbaa19940ab
32 changes: 32 additions & 0 deletions trunk/drivers/target/target_core_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -2927,6 +2927,38 @@ static int transport_generic_cmd_sequencer(
size = (cdb[7] << 8) | cdb[8];
cmd->se_cmd_flags |= SCF_SCSI_CONTROL_SG_IO_CDB;
break;
case ATA_16:
/* Only support ATA passthrough to pSCSI backends.. */
if (!passthrough)
goto out_unsupported_cdb;

/* T_LENGTH */
switch (cdb[2] & 0x3) {
case 0x0:
sectors = 0;
break;
case 0x1:
sectors = (((cdb[1] & 0x1) ? cdb[3] : 0) << 8) | cdb[4];
break;
case 0x2:
sectors = (((cdb[1] & 0x1) ? cdb[5] : 0) << 8) | cdb[6];
break;
case 0x3:
pr_err("T_LENGTH=0x3 not supported for ATA_16\n");
goto out_invalid_cdb_field;
}

/* BYTE_BLOCK */
if (cdb[2] & 0x4) {
/* BLOCK T_TYPE: 512 or sector */
size = sectors * ((cdb[2] & 0x10) ?
dev->se_sub_dev->se_dev_attrib.block_size : 512);
} else {
/* BYTE */
size = sectors;
}
cmd->se_cmd_flags |= SCF_SCSI_CONTROL_SG_IO_CDB;
break;
default:
pr_warn("TARGET_CORE[%s]: Unsupported SCSI Opcode"
" 0x%02x, sending CHECK_CONDITION.\n",
Expand Down

0 comments on commit 18d3725

Please sign in to comment.