Linux Audio

Check our new training course

Loading...
v5.4
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#include <target/target_core_base.h>
 3
 4#define XCOPY_HDR_LEN			16
 5#define XCOPY_TARGET_DESC_LEN		32
 6#define XCOPY_SEGMENT_DESC_LEN		28
 7#define XCOPY_NAA_IEEE_REGEX_LEN	16
 8#define XCOPY_MAX_SECTORS		1024
 9
10/*
11 * SPC4r37 6.4.6.1
12 * Table 150 — CSCD descriptor ID values
13 */
14#define XCOPY_CSCD_DESC_ID_LIST_OFF_MAX	0x07FF
15
16enum xcopy_origin_list {
17	XCOL_SOURCE_RECV_OP = 0x01,
18	XCOL_DEST_RECV_OP = 0x02,
19};
20
21struct xcopy_pt_cmd;
22
23struct xcopy_op {
24	int op_origin;
25
26	struct se_cmd *xop_se_cmd;
27	struct se_device *src_dev;
28	unsigned char src_tid_wwn[XCOPY_NAA_IEEE_REGEX_LEN];
29	struct se_device *dst_dev;
30	unsigned char dst_tid_wwn[XCOPY_NAA_IEEE_REGEX_LEN];
31	unsigned char local_dev_wwn[XCOPY_NAA_IEEE_REGEX_LEN];
32
33	sector_t src_lba;
34	sector_t dst_lba;
35	unsigned short stdi;
36	unsigned short dtdi;
37	unsigned short nolb;
38	unsigned int dbl;
39
40	struct xcopy_pt_cmd *src_pt_cmd;
41	struct xcopy_pt_cmd *dst_pt_cmd;
42
43	u32 xop_data_nents;
44	struct scatterlist *xop_data_sg;
45	struct work_struct xop_work;
46};
47
48/*
49 * Receive Copy Results Sevice Actions
50 */
51#define RCR_SA_COPY_STATUS		0x00
52#define RCR_SA_RECEIVE_DATA		0x01
53#define RCR_SA_OPERATING_PARAMETERS	0x03
54#define RCR_SA_FAILED_SEGMENT_DETAILS	0x04
55
56/*
57 * Receive Copy Results defs for Operating Parameters
58 */
59#define RCR_OP_MAX_TARGET_DESC_COUNT	0x2
60#define RCR_OP_MAX_SG_DESC_COUNT	0x1
61#define RCR_OP_MAX_DESC_LIST_LEN	1024
62#define RCR_OP_MAX_SEGMENT_LEN		268435456 /* 256 MB */
63#define RCR_OP_TOTAL_CONCURR_COPIES	0x1 /* Must be <= 16384 */
64#define RCR_OP_MAX_CONCURR_COPIES	0x1 /* Must be <= 255 */
65#define RCR_OP_DATA_SEG_GRAN_LOG2	9 /* 512 bytes in log 2 */
66#define RCR_OP_INLINE_DATA_GRAN_LOG2	9 /* 512 bytes in log 2 */
67#define RCR_OP_HELD_DATA_GRAN_LOG2	9 /* 512 bytes in log 2 */
68
69extern int target_xcopy_setup_pt(void);
70extern void target_xcopy_release_pt(void);
71extern sense_reason_t target_do_xcopy(struct se_cmd *);
72extern sense_reason_t target_do_receive_copy_results(struct se_cmd *);
v4.6
 
 
 
 
 1#define XCOPY_TARGET_DESC_LEN		32
 2#define XCOPY_SEGMENT_DESC_LEN		28
 3#define XCOPY_NAA_IEEE_REGEX_LEN	16
 4#define XCOPY_MAX_SECTORS		1024
 
 
 
 
 
 
 5
 6enum xcopy_origin_list {
 7	XCOL_SOURCE_RECV_OP = 0x01,
 8	XCOL_DEST_RECV_OP = 0x02,
 9};
10
11struct xcopy_pt_cmd;
12
13struct xcopy_op {
14	int op_origin;
15
16	struct se_cmd *xop_se_cmd;
17	struct se_device *src_dev;
18	unsigned char src_tid_wwn[XCOPY_NAA_IEEE_REGEX_LEN];
19	struct se_device *dst_dev;
20	unsigned char dst_tid_wwn[XCOPY_NAA_IEEE_REGEX_LEN];
21	unsigned char local_dev_wwn[XCOPY_NAA_IEEE_REGEX_LEN];
22
23	sector_t src_lba;
24	sector_t dst_lba;
25	unsigned short stdi;
26	unsigned short dtdi;
27	unsigned short nolb;
28	unsigned int dbl;
29
30	struct xcopy_pt_cmd *src_pt_cmd;
31	struct xcopy_pt_cmd *dst_pt_cmd;
32
33	u32 xop_data_nents;
34	struct scatterlist *xop_data_sg;
35	struct work_struct xop_work;
36};
37
38/*
39 * Receive Copy Results Sevice Actions
40 */
41#define RCR_SA_COPY_STATUS		0x00
42#define RCR_SA_RECEIVE_DATA		0x01
43#define RCR_SA_OPERATING_PARAMETERS	0x03
44#define RCR_SA_FAILED_SEGMENT_DETAILS	0x04
45
46/*
47 * Receive Copy Results defs for Operating Parameters
48 */
49#define RCR_OP_MAX_TARGET_DESC_COUNT	0x2
50#define RCR_OP_MAX_SG_DESC_COUNT	0x1
51#define RCR_OP_MAX_DESC_LIST_LEN	1024
52#define RCR_OP_MAX_SEGMENT_LEN		268435456 /* 256 MB */
53#define RCR_OP_TOTAL_CONCURR_COPIES	0x1 /* Must be <= 16384 */
54#define RCR_OP_MAX_CONCURR_COPIES	0x1 /* Must be <= 255 */
55#define RCR_OP_DATA_SEG_GRAN_LOG2	9 /* 512 bytes in log 2 */
56#define RCR_OP_INLINE_DATA_GRAN_LOG2	9 /* 512 bytes in log 2 */
57#define RCR_OP_HELD_DATA_GRAN_LOG2	9 /* 512 bytes in log 2 */
58
59extern int target_xcopy_setup_pt(void);
60extern void target_xcopy_release_pt(void);
61extern sense_reason_t target_do_xcopy(struct se_cmd *);
62extern sense_reason_t target_do_receive_copy_results(struct se_cmd *);