aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/iscsi_tcp.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/iscsi_tcp.h')
-rw-r--r--drivers/scsi/iscsi_tcp.h46
1 files changed, 18 insertions, 28 deletions
diff --git a/drivers/scsi/iscsi_tcp.h b/drivers/scsi/iscsi_tcp.h
index 808302832e68..32736831790e 100644
--- a/drivers/scsi/iscsi_tcp.h
+++ b/drivers/scsi/iscsi_tcp.h
@@ -31,26 +31,25 @@
31#define IN_PROGRESS_DDIGEST_RECV 0x3 31#define IN_PROGRESS_DDIGEST_RECV 0x3
32 32
33/* xmit state machine */ 33/* xmit state machine */
34#define XMSTATE_IDLE 0x0 34#define XMSTATE_IDLE 0x0
35#define XMSTATE_R_HDR 0x1 35#define XMSTATE_R_HDR 0x1
36#define XMSTATE_W_HDR 0x2 36#define XMSTATE_W_HDR 0x2
37#define XMSTATE_IMM_HDR 0x4 37#define XMSTATE_IMM_HDR 0x4
38#define XMSTATE_IMM_DATA 0x8 38#define XMSTATE_IMM_DATA 0x8
39#define XMSTATE_UNS_INIT 0x10 39#define XMSTATE_UNS_INIT 0x10
40#define XMSTATE_UNS_HDR 0x20 40#define XMSTATE_UNS_HDR 0x20
41#define XMSTATE_UNS_DATA 0x40 41#define XMSTATE_UNS_DATA 0x40
42#define XMSTATE_SOL_HDR 0x80 42#define XMSTATE_SOL_HDR 0x80
43#define XMSTATE_SOL_DATA 0x100 43#define XMSTATE_SOL_DATA 0x100
44#define XMSTATE_W_PAD 0x200 44#define XMSTATE_W_PAD 0x200
45#define XMSTATE_DATA_DIGEST 0x400 45#define XMSTATE_W_RESEND_PAD 0x400
46 46#define XMSTATE_W_RESEND_DATA_DIGEST 0x800
47#define ISCSI_CONN_RCVBUF_MIN 262144 47
48#define ISCSI_CONN_SNDBUF_MIN 262144
49#define ISCSI_PAD_LEN 4 48#define ISCSI_PAD_LEN 4
50#define ISCSI_R2T_MAX 16
51#define ISCSI_SG_TABLESIZE SG_ALL 49#define ISCSI_SG_TABLESIZE SG_ALL
52#define ISCSI_TCP_MAX_CMD_LEN 16 50#define ISCSI_TCP_MAX_CMD_LEN 16
53 51
52struct crypto_hash;
54struct socket; 53struct socket;
55 54
56/* Socket connection recieve helper */ 55/* Socket connection recieve helper */
@@ -78,17 +77,12 @@ struct iscsi_tcp_conn {
78 char hdrext[4*sizeof(__u16) + 77 char hdrext[4*sizeof(__u16) +
79 sizeof(__u32)]; 78 sizeof(__u32)];
80 int data_copied; 79 int data_copied;
81 char *data; /* data placeholder */
82 int data_size; /* actual recv_dlength */
83 int stop_stage; /* conn_stop() flag: * 80 int stop_stage; /* conn_stop() flag: *
84 * stop to recover, * 81 * stop to recover, *
85 * stop to terminate */ 82 * stop to terminate */
86 /* iSCSI connection-wide sequencing */ 83 /* iSCSI connection-wide sequencing */
87 int hdr_size; /* PDU header size */ 84 int hdr_size; /* PDU header size */
88 85
89 struct crypto_tfm *rx_tfm; /* CRC32C (Rx) */
90 struct crypto_tfm *data_rx_tfm; /* CRC32C (Rx) for data */
91
92 /* control data */ 86 /* control data */
93 struct iscsi_tcp_recv in; /* TCP receive context */ 87 struct iscsi_tcp_recv in; /* TCP receive context */
94 int in_progress; /* connection state machine */ 88 int in_progress; /* connection state machine */
@@ -98,9 +92,9 @@ struct iscsi_tcp_conn {
98 void (*old_state_change)(struct sock *); 92 void (*old_state_change)(struct sock *);
99 void (*old_write_space)(struct sock *); 93 void (*old_write_space)(struct sock *);
100 94
101 /* xmit */ 95 /* data and header digests */
102 struct crypto_tfm *tx_tfm; /* CRC32C (Tx) */ 96 struct hash_desc tx_hash; /* CRC32C (Tx) */
103 struct crypto_tfm *data_tx_tfm; /* CRC32C (Tx) for data */ 97 struct hash_desc rx_hash; /* CRC32C (Rx) */
104 98
105 /* MIB custom statistics */ 99 /* MIB custom statistics */
106 uint32_t sendpage_failures_cnt; 100 uint32_t sendpage_failures_cnt;
@@ -159,19 +153,15 @@ struct iscsi_tcp_cmd_task {
159 struct scatterlist *bad_sg; /* assert statement */ 153 struct scatterlist *bad_sg; /* assert statement */
160 int sg_count; /* SG's to process */ 154 int sg_count; /* SG's to process */
161 uint32_t exp_r2tsn; 155 uint32_t exp_r2tsn;
162 int r2t_data_count; /* R2T Data-Out bytes */
163 int data_offset; 156 int data_offset;
164 struct iscsi_r2t_info *r2t; /* in progress R2T */ 157 struct iscsi_r2t_info *r2t; /* in progress R2T */
165 struct iscsi_queue r2tpool; 158 struct iscsi_queue r2tpool;
166 struct kfifo *r2tqueue; 159 struct kfifo *r2tqueue;
167 struct iscsi_r2t_info **r2ts; 160 struct iscsi_r2t_info **r2ts;
168 uint32_t datadigest; /* for recover digest */
169 int digest_count; 161 int digest_count;
170 uint32_t immdigest; /* for imm data */ 162 uint32_t immdigest; /* for imm data */
171 struct iscsi_buf immbuf; /* for imm data digest */ 163 struct iscsi_buf immbuf; /* for imm data digest */
172 struct iscsi_data_task *dtask; /* data task in progress*/
173 struct iscsi_data_task unsol_dtask; /* unsol data task */ 164 struct iscsi_data_task unsol_dtask; /* unsol data task */
174 int digest_offset; /* for partial buff digest */
175}; 165};
176 166
177#endif /* ISCSI_H */ 167#endif /* ISCSI_H */