1
2
3
4
5
6#ifndef __QEDF_HSI__
7#define __QEDF_HSI__
8
9
10
11#include <linux/qed/common_hsi.h>
12
13
14
15
16#include <linux/qed/storage_common.h>
17
18
19
20
21#include <linux/qed/fcoe_common.h>
22
23
24
25
26
27struct fcoe_abts_info {
28 u8 r_ctl ;
29 u8 reserved0;
30 __le16 rx_id;
31 __le32 reserved2[2];
32 __le32 fc_payload[3] ;
33};
34
35
36
37
38
39enum fcoe_class_type {
40 FCOE_TASK_CLASS_TYPE_3,
41 FCOE_TASK_CLASS_TYPE_2,
42 MAX_FCOE_CLASS_TYPE
43};
44
45
46
47
48
49struct fcoe_cmdqe_control {
50 __le16 conn_id;
51 u8 num_additional_cmdqes;
52 u8 cmdType;
53
54#define FCOE_CMDQE_CONTROL_ABTSREQCMD_MASK 0x1
55#define FCOE_CMDQE_CONTROL_ABTSREQCMD_SHIFT 0
56#define FCOE_CMDQE_CONTROL_RESERVED1_MASK 0x7F
57#define FCOE_CMDQE_CONTROL_RESERVED1_SHIFT 1
58 u8 reserved2[4];
59};
60
61
62
63
64struct fcoe_cmdqe {
65 struct fcoe_cmdqe_control hdr;
66 u8 fc_header[24];
67 __le32 fcp_cmd_payload[8];
68};
69
70
71
72
73
74
75struct fcoe_fcp_rsp_flags {
76 u8 flags;
77#define FCOE_FCP_RSP_FLAGS_FCP_RSP_LEN_VALID_MASK 0x1
78#define FCOE_FCP_RSP_FLAGS_FCP_RSP_LEN_VALID_SHIFT 0
79#define FCOE_FCP_RSP_FLAGS_FCP_SNS_LEN_VALID_MASK 0x1
80#define FCOE_FCP_RSP_FLAGS_FCP_SNS_LEN_VALID_SHIFT 1
81#define FCOE_FCP_RSP_FLAGS_FCP_RESID_OVER_MASK 0x1
82#define FCOE_FCP_RSP_FLAGS_FCP_RESID_OVER_SHIFT 2
83#define FCOE_FCP_RSP_FLAGS_FCP_RESID_UNDER_MASK 0x1
84#define FCOE_FCP_RSP_FLAGS_FCP_RESID_UNDER_SHIFT 3
85#define FCOE_FCP_RSP_FLAGS_FCP_CONF_REQ_MASK 0x1
86#define FCOE_FCP_RSP_FLAGS_FCP_CONF_REQ_SHIFT 4
87#define FCOE_FCP_RSP_FLAGS_FCP_BIDI_FLAGS_MASK 0x7
88#define FCOE_FCP_RSP_FLAGS_FCP_BIDI_FLAGS_SHIFT 5
89};
90
91
92
93
94struct fcoe_cqe_rsp_info {
95 struct fcoe_fcp_rsp_flags rsp_flags;
96 u8 scsi_status_code;
97 __le16 retry_delay_timer;
98 __le32 fcp_resid;
99 __le32 fcp_sns_len;
100 __le32 fcp_rsp_len;
101 __le16 rx_id;
102 u8 fw_error_flags;
103#define FCOE_CQE_RSP_INFO_FW_UNDERRUN_MASK 0x1
104#define FCOE_CQE_RSP_INFO_FW_UNDERRUN_SHIFT 0
105#define FCOE_CQE_RSP_INFO_RESREVED_MASK 0x7F
106#define FCOE_CQE_RSP_INFO_RESREVED_SHIFT 1
107 u8 reserved;
108 __le32 fw_residual ;
109};
110
111
112
113
114struct fcoe_cqe_target_info {
115 __le16 rx_id;
116 __le16 reserved0;
117 __le32 reserved1[5];
118};
119
120
121
122
123struct fcoe_err_report_entry {
124 __le32 err_warn_bitmap_lo ;
125 __le32 err_warn_bitmap_hi ;
126
127 __le32 tx_buf_off;
128
129 __le32 rx_buf_off;
130 __le16 rx_id ;
131 __le16 reserved1;
132 __le32 reserved2;
133};
134
135
136
137
138struct fcoe_cqe_midpath_info {
139 __le32 data_placement_size;
140 __le16 rx_id;
141 __le16 reserved0;
142 __le32 reserved1[4];
143};
144
145
146
147
148struct fcoe_unsolic_info {
149
150 struct scsi_bd bd_info;
151 __le16 conn_id ;
152 __le16 pkt_len ;
153 u8 reserved1[4];
154};
155
156
157
158
159struct fcoe_warning_report_entry {
160
161 struct scsi_bd bd_info;
162
163 __le32 buf_off;
164 __le16 rx_id ;
165 __le16 reserved1;
166};
167
168
169
170
171union fcoe_cqe_info {
172 struct fcoe_cqe_rsp_info rsp_info ;
173
174 struct fcoe_cqe_target_info target_info;
175
176 struct fcoe_err_report_entry err_info;
177 struct fcoe_abts_info abts_info ;
178
179 struct fcoe_cqe_midpath_info midpath_info;
180
181 struct fcoe_unsolic_info unsolic_info;
182
183 struct fcoe_warning_report_entry warn_info;
184};
185
186
187
188
189struct fcoe_cqe {
190 __le32 cqe_data;
191
192#define FCOE_CQE_TASK_ID_MASK 0xFFFF
193#define FCOE_CQE_TASK_ID_SHIFT 0
194
195
196
197
198
199#define FCOE_CQE_CQE_TYPE_MASK 0xF
200#define FCOE_CQE_CQE_TYPE_SHIFT 16
201#define FCOE_CQE_RESERVED0_MASK 0xFFF
202#define FCOE_CQE_RESERVED0_SHIFT 20
203 __le16 reserved1;
204 __le16 fw_cq_prod;
205 union fcoe_cqe_info cqe_info;
206};
207
208
209
210
211enum fcoe_cqe_type {
212
213 FCOE_GOOD_COMPLETION_CQE_TYPE,
214 FCOE_UNSOLIC_CQE_TYPE ,
215 FCOE_ERROR_DETECTION_CQE_TYPE ,
216 FCOE_WARNING_CQE_TYPE ,
217 FCOE_EXCH_CLEANUP_CQE_TYPE ,
218 FCOE_ABTS_CQE_TYPE ,
219 FCOE_DUMMY_CQE_TYPE ,
220
221 FCOE_LOCAL_COMP_CQE_TYPE,
222 MAX_FCOE_CQE_TYPE
223};
224
225
226
227
228enum fcoe_fp_error_warning_code {
229 FCOE_ERROR_CODE_XFER_OOO_RO ,
230 FCOE_ERROR_CODE_XFER_RO_NOT_ALIGNED,
231 FCOE_ERROR_CODE_XFER_NULL_BURST_LEN,
232 FCOE_ERROR_CODE_XFER_RO_GREATER_THAN_DATA2TRNS,
233 FCOE_ERROR_CODE_XFER_INVALID_PAYLOAD_SIZE,
234 FCOE_ERROR_CODE_XFER_TASK_TYPE_NOT_WRITE,
235 FCOE_ERROR_CODE_XFER_PEND_XFER_SET,
236 FCOE_ERROR_CODE_XFER_OPENED_SEQ,
237 FCOE_ERROR_CODE_XFER_FCTL,
238 FCOE_ERROR_CODE_FCP_RSP_BIDI_FLAGS_SET ,
239 FCOE_ERROR_CODE_FCP_RSP_INVALID_LENGTH_FIELD,
240 FCOE_ERROR_CODE_FCP_RSP_INVALID_SNS_FIELD,
241 FCOE_ERROR_CODE_FCP_RSP_INVALID_PAYLOAD_SIZE,
242 FCOE_ERROR_CODE_FCP_RSP_PEND_XFER_SET,
243 FCOE_ERROR_CODE_FCP_RSP_OPENED_SEQ,
244 FCOE_ERROR_CODE_FCP_RSP_FCTL,
245 FCOE_ERROR_CODE_FCP_RSP_LAST_SEQ_RESET,
246 FCOE_ERROR_CODE_FCP_RSP_CONF_REQ_NOT_SUPPORTED_YET,
247 FCOE_ERROR_CODE_DATA_OOO_RO ,
248 FCOE_ERROR_CODE_DATA_EXCEEDS_DEFINED_MAX_FRAME_SIZE,
249 FCOE_ERROR_CODE_DATA_EXCEEDS_DATA2TRNS,
250 FCOE_ERROR_CODE_DATA_SOFI3_SEQ_ACTIVE_SET,
251 FCOE_ERROR_CODE_DATA_SOFN_SEQ_ACTIVE_RESET,
252 FCOE_ERROR_CODE_DATA_EOFN_END_SEQ_SET,
253 FCOE_ERROR_CODE_DATA_EOFT_END_SEQ_RESET,
254 FCOE_ERROR_CODE_DATA_TASK_TYPE_NOT_READ,
255 FCOE_ERROR_CODE_DATA_FCTL_INITIATIR,
256 FCOE_ERROR_CODE_MIDPATH_INVALID_TYPE ,
257 FCOE_ERROR_CODE_MIDPATH_SOFI3_SEQ_ACTIVE_SET,
258 FCOE_ERROR_CODE_MIDPATH_SOFN_SEQ_ACTIVE_RESET,
259 FCOE_ERROR_CODE_MIDPATH_EOFN_END_SEQ_SET,
260 FCOE_ERROR_CODE_MIDPATH_EOFT_END_SEQ_RESET,
261 FCOE_ERROR_CODE_MIDPATH_REPLY_FCTL,
262 FCOE_ERROR_CODE_MIDPATH_INVALID_REPLY,
263 FCOE_ERROR_CODE_MIDPATH_ELS_REPLY_RCTL,
264 FCOE_ERROR_CODE_COMMON_MIDDLE_FRAME_WITH_PAD ,
265 FCOE_ERROR_CODE_COMMON_SEQ_INIT_IN_TCE,
266 FCOE_ERROR_CODE_COMMON_FC_HDR_RX_ID_MISMATCH,
267 FCOE_ERROR_CODE_COMMON_INCORRECT_SEQ_CNT,
268 FCOE_ERROR_CODE_COMMON_DATA_FC_HDR_FCP_TYPE_MISMATCH,
269 FCOE_ERROR_CODE_COMMON_DATA_NO_MORE_SGES,
270 FCOE_ERROR_CODE_COMMON_OPTIONAL_FC_HDR,
271 FCOE_ERROR_CODE_COMMON_READ_TCE_OX_ID_TOO_BIG,
272 FCOE_ERROR_CODE_COMMON_DATA_WAS_NOT_TRANSMITTED,
273 FCOE_ERROR_CODE_COMMON_TASK_DDF_RCTL_INFO_FIELD,
274 FCOE_ERROR_CODE_COMMON_TASK_INVALID_RCTL,
275 FCOE_ERROR_CODE_COMMON_TASK_RCTL_GENERAL_MISMATCH,
276 FCOE_ERROR_CODE_E_D_TOV_TIMER_EXPIRATION ,
277 FCOE_WARNING_CODE_REC_TOV_TIMER_EXPIRATION ,
278 FCOE_ERROR_CODE_RR_TOV_TIMER_EXPIRATION ,
279
280 FCOE_ERROR_CODE_ABTS_REPLY_UNEXPECTED,
281 FCOE_ERROR_CODE_TARGET_MODE_FCP_RSP,
282 FCOE_ERROR_CODE_TARGET_MODE_FCP_XFER,
283 FCOE_ERROR_CODE_TARGET_MODE_DATA_TASK_TYPE_NOT_WRITE,
284 FCOE_ERROR_CODE_DATA_FCTL_TARGET,
285 FCOE_ERROR_CODE_TARGET_DATA_SIZE_NO_MATCH_XFER,
286 FCOE_ERROR_CODE_TARGET_DIF_CRC_CHECKSUM_ERROR,
287 FCOE_ERROR_CODE_TARGET_DIF_REF_TAG_ERROR,
288 FCOE_ERROR_CODE_TARGET_DIF_APP_TAG_ERROR,
289 MAX_FCOE_FP_ERROR_WARNING_CODE
290};
291
292
293
294
295
296struct fcoe_respqe {
297 __le16 ox_id ;
298 __le16 rx_id ;
299 __le32 additional_info;
300
301#define FCOE_RESPQE_PARAM_MASK 0xFFFFFF
302#define FCOE_RESPQE_PARAM_SHIFT 0
303
304#define FCOE_RESPQE_TARGET_AUTO_RSP_MASK 0xFF
305#define FCOE_RESPQE_TARGET_AUTO_RSP_SHIFT 24
306};
307
308
309
310
311
312enum fcoe_sp_error_code {
313
314 FCOE_ERROR_CODE_SLOW_PATH_TOO_MANY_FUNCS,
315 FCOE_ERROR_SLOW_PATH_CODE_NO_LICENSE,
316 MAX_FCOE_SP_ERROR_CODE
317};
318
319
320
321
322enum fcoe_task_tx_state {
323
324 FCOE_TASK_TX_STATE_NORMAL,
325
326 FCOE_TASK_TX_STATE_UNSOLICITED_COMPLETED,
327
328
329
330
331 FCOE_TASK_TX_STATE_CLEAN_REQ,
332 FCOE_TASK_TX_STATE_ABTS ,
333
334 FCOE_TASK_TX_STATE_EXCLEANUP,
335
336
337
338
339 FCOE_TASK_TX_STATE_EXCLEANUP_TARGET_WRITE_CONT,
340
341 FCOE_TASK_TX_STATE_EXCLEANUP_TARGET_WRITE,
342
343 FCOE_TASK_TX_STATE_EXCLEANUP_TARGET_READ_OR_RSP,
344
345 FCOE_TASK_TX_STATE_EXCLEANUP_TARGET_WRITE_LAST_CYCLE,
346
347 FCOE_TASK_TX_STATE_SEQRECOVERY,
348 MAX_FCOE_TASK_TX_STATE
349};
350
351#endif
352