Skip to content

Commit

Permalink
tcmur: Add emulate XCOPY command support
Browse files Browse the repository at this point in the history
The EXTENDED COPY command provides a means to copy data from one
set of logical units to another set of logical units or to the same
set of logical units. The entity within a SCSI device that manages
the command processing for EXTENDED COPY commands and RECEIVE COPY
RESULTS commands is the copy manager. The copy manager is responsible
for copying data from the source devices to the destination devices.
The copy source and destination devices are logical units that may
reside in different SCSI devices or the same SCSI device. It is
possible that the copy source device, copy destination device, and
the copy manager are the same logical unit.

Currently we are using sync way to do the emulate to simplify the
initial patches, and the async way will be added later as commented
by @liuy.

Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com>
  • Loading branch information
Xiubo Li committed May 20, 2017
1 parent 615a4e2 commit 9c86bd0
Show file tree
Hide file tree
Showing 2 changed files with 683 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scsi_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#define READ_DISC_INFORMATION 0x51
#define MODE_SELECT_10 0x55
#define MODE_SENSE_10 0x5a
#define EXTENDED_COPY 0x83
#define RECEIVE_COPY_RESULTS 0x84 /* RECEIVE COPY STATUS */
#define READ_16 0x88
#define COMPARE_AND_WRITE 0x89
Expand Down Expand Up @@ -100,18 +101,23 @@ enum scsi_protocol {
* Sense codes
*/
#define ASC_NOT_READY_FORMAT_IN_PROGRESS 0x0404
#define ASC_PORT_IN_STANDBY 0x040B
#define ASC_PORT_IN_STANDBY 0x040B
#define ASC_COPY_TARGET_DEVICE_NOT_REACHABLE 0x0D02
#define ASC_INCORRECT_COPY_TARGET_DEVICE_TYPE 0x0D03
#define ASC_READ_ERROR 0x1100
#define ASC_LOGICAL_UNIT_COMMUNICATION_FAILURE 0x0800
#define ASC_WRITE_ERROR 0x0C00
#define ASC_PARAMETER_LIST_LENGTH_ERROR 0x1a00
#define ASC_MISCOMPARE_DURING_VERIFY_OPERATION 0x1d00
#define ASC_LBA_OUT_OF_RANGE 0x2100
#define ASC_INVALID_FIELD_IN_CDB 0x2400
#define ASC_INVALID_FIELD_IN_PARAMETER_LIST 0x2600
#define ASC_UNSUPPORTED_SEGMENT_DESC_TYPE_CODE 0x2609
#define ASC_UNSUPPORTED_TARGET_DESC_TYPE_CODE 0x2607
#define ASC_CANT_WRITE_INCOMPATIBLE_FORMAT 0x3005
#define ASC_SAVING_PARAMETERS_NOT_SUPPORTED 0x3900
#define ASC_INTERNAL_TARGET_FAILURE 0x4400
#define ASC_STPG_CMD_FAILED 0x670A
#define ASC_STPG_CMD_FAILED 0x670A


#define ALUA_ACCESS_STATE_OPTIMIZED 0x0
Expand Down
Loading

0 comments on commit 9c86bd0

Please sign in to comment.