1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 #ifndef _QED_ISCSI_IF_H
34 #define _QED_ISCSI_IF_H
35 #include <linux/types.h>
36 #include <linux/qed/qed_if.h>
37
38 typedef int (*iscsi_event_cb_t) (void *context,
39 u8 fw_event_code, void *fw_handle);
40 struct qed_iscsi_stats {
41 u64 iscsi_rx_bytes_cnt;
42 u64 iscsi_rx_packet_cnt;
43 u64 iscsi_rx_new_ooo_isle_events_cnt;
44 u32 iscsi_cmdq_threshold_cnt;
45 u32 iscsi_rq_threshold_cnt;
46 u32 iscsi_immq_threshold_cnt;
47
48 u64 iscsi_rx_dropped_pdus_task_not_valid;
49
50 u64 iscsi_rx_data_pdu_cnt;
51 u64 iscsi_rx_r2t_pdu_cnt;
52 u64 iscsi_rx_total_pdu_cnt;
53
54 u64 iscsi_tx_go_to_slow_start_event_cnt;
55 u64 iscsi_tx_fast_retransmit_event_cnt;
56
57 u64 iscsi_tx_data_pdu_cnt;
58 u64 iscsi_tx_r2t_pdu_cnt;
59 u64 iscsi_tx_total_pdu_cnt;
60
61 u64 iscsi_tx_bytes_cnt;
62 u64 iscsi_tx_packet_cnt;
63 };
64
65 struct qed_dev_iscsi_info {
66 struct qed_dev_info common;
67
68 void __iomem *primary_dbq_rq_addr;
69 void __iomem *secondary_bdq_rq_addr;
70
71 u8 num_cqs;
72 };
73
74 struct qed_iscsi_id_params {
75 u8 mac[ETH_ALEN];
76 u32 ip[4];
77 u16 port;
78 };
79
80 struct qed_iscsi_params_offload {
81 u8 layer_code;
82 dma_addr_t sq_pbl_addr;
83 u32 initial_ack;
84
85 struct qed_iscsi_id_params src;
86 struct qed_iscsi_id_params dst;
87 u16 vlan_id;
88 u8 tcp_flags;
89 u8 ip_version;
90 u8 default_cq;
91
92 u8 ka_max_probe_cnt;
93 u8 dup_ack_theshold;
94 u32 rcv_next;
95 u32 snd_una;
96 u32 snd_next;
97 u32 snd_max;
98 u32 snd_wnd;
99 u32 rcv_wnd;
100 u32 snd_wl1;
101 u32 cwnd;
102 u32 ss_thresh;
103 u16 srtt;
104 u16 rtt_var;
105 u32 ts_recent;
106 u32 ts_recent_age;
107 u32 total_rt;
108 u32 ka_timeout_delta;
109 u32 rt_timeout_delta;
110 u8 dup_ack_cnt;
111 u8 snd_wnd_probe_cnt;
112 u8 ka_probe_cnt;
113 u8 rt_cnt;
114 u32 flow_label;
115 u32 ka_timeout;
116 u32 ka_interval;
117 u32 max_rt_time;
118 u32 initial_rcv_wnd;
119 u8 ttl;
120 u8 tos_or_tc;
121 u16 remote_port;
122 u16 local_port;
123 u16 mss;
124 u8 snd_wnd_scale;
125 u8 rcv_wnd_scale;
126 u16 da_timeout_value;
127 u8 ack_frequency;
128 };
129
130 struct qed_iscsi_params_update {
131 u8 update_flag;
132 #define QED_ISCSI_CONN_HD_EN BIT(0)
133 #define QED_ISCSI_CONN_DD_EN BIT(1)
134 #define QED_ISCSI_CONN_INITIAL_R2T BIT(2)
135 #define QED_ISCSI_CONN_IMMEDIATE_DATA BIT(3)
136
137 u32 max_seq_size;
138 u32 max_recv_pdu_length;
139 u32 max_send_pdu_length;
140 u32 first_seq_length;
141 u32 exp_stat_sn;
142 };
143
144 #define MAX_TID_BLOCKS_ISCSI (512)
145 struct qed_iscsi_tid {
146 u32 size;
147 u32 num_tids_per_block;
148 u8 *blocks[MAX_TID_BLOCKS_ISCSI];
149 };
150
151 struct qed_iscsi_cb_ops {
152 struct qed_common_cb_ops common;
153 };
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217 struct qed_iscsi_ops {
218 const struct qed_common_ops *common;
219
220 const struct qed_ll2_ops *ll2;
221
222 int (*fill_dev_info)(struct qed_dev *cdev,
223 struct qed_dev_iscsi_info *info);
224
225 void (*register_ops)(struct qed_dev *cdev,
226 struct qed_iscsi_cb_ops *ops, void *cookie);
227
228 int (*start)(struct qed_dev *cdev,
229 struct qed_iscsi_tid *tasks,
230 void *event_context, iscsi_event_cb_t async_event_cb);
231
232 int (*stop)(struct qed_dev *cdev);
233
234 int (*acquire_conn)(struct qed_dev *cdev,
235 u32 *handle,
236 u32 *fw_cid, void __iomem **p_doorbell);
237
238 int (*release_conn)(struct qed_dev *cdev, u32 handle);
239
240 int (*offload_conn)(struct qed_dev *cdev,
241 u32 handle,
242 struct qed_iscsi_params_offload *conn_info);
243
244 int (*update_conn)(struct qed_dev *cdev,
245 u32 handle,
246 struct qed_iscsi_params_update *conn_info);
247
248 int (*destroy_conn)(struct qed_dev *cdev, u32 handle, u8 abrt_conn);
249
250 int (*clear_sq)(struct qed_dev *cdev, u32 handle);
251
252 int (*get_stats)(struct qed_dev *cdev,
253 struct qed_iscsi_stats *stats);
254
255 int (*change_mac)(struct qed_dev *cdev, u32 handle, const u8 *mac);
256 };
257
258 const struct qed_iscsi_ops *qed_get_iscsi_ops(void);
259 void qed_put_iscsi_ops(void);
260 #endif