iscsi_target_seq_pdu_list.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #ifndef ISCSI_SEQ_AND_PDU_LIST_H
  2. #define ISCSI_SEQ_AND_PDU_LIST_H
  3. /* struct iscsi_pdu->status */
  4. #define DATAOUT_PDU_SENT 1
  5. /* struct iscsi_seq->type */
  6. #define SEQTYPE_IMMEDIATE 1
  7. #define SEQTYPE_UNSOLICITED 2
  8. #define SEQTYPE_NORMAL 3
  9. /* struct iscsi_seq->status */
  10. #define DATAOUT_SEQUENCE_GOT_R2T 1
  11. #define DATAOUT_SEQUENCE_WITHIN_COMMAND_RECOVERY 2
  12. #define DATAOUT_SEQUENCE_COMPLETE 3
  13. /* iscsi_determine_counts_for_list() type */
  14. #define PDULIST_NORMAL 1
  15. #define PDULIST_IMMEDIATE 2
  16. #define PDULIST_UNSOLICITED 3
  17. #define PDULIST_IMMEDIATE_AND_UNSOLICITED 4
  18. /* struct iscsi_pdu->type */
  19. #define PDUTYPE_IMMEDIATE 1
  20. #define PDUTYPE_UNSOLICITED 2
  21. #define PDUTYPE_NORMAL 3
  22. /* struct iscsi_pdu->status */
  23. #define ISCSI_PDU_NOT_RECEIVED 0
  24. #define ISCSI_PDU_RECEIVED_OK 1
  25. #define ISCSI_PDU_CRC_FAILED 2
  26. #define ISCSI_PDU_TIMED_OUT 3
  27. /* struct iscsi_build_list->randomize */
  28. #define RANDOM_DATAIN_PDU_OFFSETS 0x01
  29. #define RANDOM_DATAIN_SEQ_OFFSETS 0x02
  30. #define RANDOM_DATAOUT_PDU_OFFSETS 0x04
  31. #define RANDOM_R2T_OFFSETS 0x08
  32. /* struct iscsi_build_list->data_direction */
  33. #define ISCSI_PDU_READ 0x01
  34. #define ISCSI_PDU_WRITE 0x02
  35. struct iscsi_build_list {
  36. int data_direction;
  37. int randomize;
  38. int type;
  39. int immediate_data_length;
  40. };
  41. struct iscsi_pdu {
  42. int status;
  43. int type;
  44. u8 flags;
  45. u32 data_sn;
  46. u32 length;
  47. u32 offset;
  48. u32 pdu_send_order;
  49. u32 seq_no;
  50. } ____cacheline_aligned;
  51. struct iscsi_seq {
  52. int sent;
  53. int status;
  54. int type;
  55. u32 data_sn;
  56. u32 first_datasn;
  57. u32 last_datasn;
  58. u32 next_burst_len;
  59. u32 pdu_start;
  60. u32 pdu_count;
  61. u32 offset;
  62. u32 orig_offset;
  63. u32 pdu_send_order;
  64. u32 r2t_sn;
  65. u32 seq_send_order;
  66. u32 seq_no;
  67. u32 xfer_len;
  68. } ____cacheline_aligned;
  69. extern int iscsit_build_pdu_and_seq_lists(struct iscsi_cmd *, u32);
  70. extern struct iscsi_pdu *iscsit_get_pdu_holder(struct iscsi_cmd *, u32, u32);
  71. extern struct iscsi_pdu *iscsit_get_pdu_holder_for_seq(struct iscsi_cmd *, struct iscsi_seq *);
  72. extern struct iscsi_seq *iscsit_get_seq_holder(struct iscsi_cmd *, u32, u32);
  73. #endif /* ISCSI_SEQ_AND_PDU_LIST_H */