target_core_xcopy.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. enum xcopy_origin_list {
  6. XCOL_SOURCE_RECV_OP = 0x01,
  7. XCOL_DEST_RECV_OP = 0x02,
  8. };
  9. struct xcopy_pt_cmd;
  10. struct xcopy_op {
  11. int op_origin;
  12. struct se_cmd *xop_se_cmd;
  13. struct se_device *src_dev;
  14. unsigned char src_tid_wwn[XCOPY_NAA_IEEE_REGEX_LEN];
  15. struct se_device *dst_dev;
  16. unsigned char dst_tid_wwn[XCOPY_NAA_IEEE_REGEX_LEN];
  17. unsigned char local_dev_wwn[XCOPY_NAA_IEEE_REGEX_LEN];
  18. sector_t src_lba;
  19. sector_t dst_lba;
  20. unsigned short stdi;
  21. unsigned short dtdi;
  22. unsigned short nolb;
  23. unsigned int dbl;
  24. struct xcopy_pt_cmd *src_pt_cmd;
  25. struct xcopy_pt_cmd *dst_pt_cmd;
  26. u32 xop_data_nents;
  27. struct scatterlist *xop_data_sg;
  28. struct work_struct xop_work;
  29. };
  30. /*
  31. * Receive Copy Results Sevice Actions
  32. */
  33. #define RCR_SA_COPY_STATUS 0x00
  34. #define RCR_SA_RECEIVE_DATA 0x01
  35. #define RCR_SA_OPERATING_PARAMETERS 0x03
  36. #define RCR_SA_FAILED_SEGMENT_DETAILS 0x04
  37. /*
  38. * Receive Copy Results defs for Operating Parameters
  39. */
  40. #define RCR_OP_MAX_TARGET_DESC_COUNT 0x2
  41. #define RCR_OP_MAX_SG_DESC_COUNT 0x1
  42. #define RCR_OP_MAX_DESC_LIST_LEN 1024
  43. #define RCR_OP_MAX_SEGMENT_LEN 268435456 /* 256 MB */
  44. #define RCR_OP_TOTAL_CONCURR_COPIES 0x1 /* Must be <= 16384 */
  45. #define RCR_OP_MAX_CONCURR_COPIES 0x1 /* Must be <= 255 */
  46. #define RCR_OP_DATA_SEG_GRAN_LOG2 9 /* 512 bytes in log 2 */
  47. #define RCR_OP_INLINE_DATA_GRAN_LOG2 9 /* 512 bytes in log 2 */
  48. #define RCR_OP_HELD_DATA_GRAN_LOG2 9 /* 512 bytes in log 2 */
  49. extern int target_xcopy_setup_pt(void);
  50. extern void target_xcopy_release_pt(void);
  51. extern sense_reason_t target_do_xcopy(struct se_cmd *);
  52. extern sense_reason_t target_do_receive_copy_results(struct se_cmd *);