Merge tag 'v3.3.7' into 3.3/master
[zen-stable.git] / drivers / target / iscsi / iscsi_target_seq_pdu_list.h
blob0d52a10e3069476f2e7aaf82edc20e2c35eb7f79
1 #ifndef ISCSI_SEQ_AND_PDU_LIST_H
2 #define ISCSI_SEQ_AND_PDU_LIST_H
4 /* struct iscsi_pdu->status */
5 #define DATAOUT_PDU_SENT 1
7 /* struct iscsi_seq->type */
8 #define SEQTYPE_IMMEDIATE 1
9 #define SEQTYPE_UNSOLICITED 2
10 #define SEQTYPE_NORMAL 3
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
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
23 /* struct iscsi_pdu->type */
24 #define PDUTYPE_IMMEDIATE 1
25 #define PDUTYPE_UNSOLICITED 2
26 #define PDUTYPE_NORMAL 3
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
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
40 /* struct iscsi_build_list->data_direction */
41 #define ISCSI_PDU_READ 0x01
42 #define ISCSI_PDU_WRITE 0x02
44 struct iscsi_build_list {
45 int data_direction;
46 int randomize;
47 int type;
48 int immediate_data_length;
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;
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;
81 extern int iscsit_do_build_list(struct iscsi_cmd *, struct iscsi_build_list *);
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);
86 #endif /* ISCSI_SEQ_AND_PDU_LIST_H */