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