1 /* QLogic qed NIC Driver
2 * Copyright (c) 2015 QLogic Corporation
4 * This software is available under the terms of the GNU General Public License
5 * (GPL) Version 2, available from the file COPYING in the main directory of
9 #ifndef __FCOE_COMMON__
10 #define __FCOE_COMMON__
11 /*********************/
12 /* FCOE FW CONSTANTS */
13 /*********************/
15 #define FC_ABTS_REPLY_MAX_PAYLOAD_LEN 12
16 #define FCOE_MAX_SIZE_FCP_DATA_SUPER (8600)
18 struct fcoe_abts_pkt
{
19 __le32 abts_rsp_fc_payload_lo
;
20 __le16 abts_rsp_rx_id
;
25 /* FCoE additional WQE (Sq/XferQ) information */
26 union fcoe_additional_info_union
{
30 __le32 seq_rec_updated_offset
;
38 union fcoe_cleanup_addr_exp_ro_union
{
39 struct regpair abts_rsp_fc_payload_hi
;
40 struct fcoe_exp_ro exp_ro
;
43 /* FCoE Ramrod Command IDs */
44 enum fcoe_completion_status
{
45 FCOE_COMPLETION_STATUS_SUCCESS
,
46 FCOE_COMPLETION_STATUS_FCOE_VER_ERR
,
47 FCOE_COMPLETION_STATUS_SRC_MAC_ADD_ARR_ERR
,
48 MAX_FCOE_COMPLETION_STATUS
57 /* FCoE connection offload */
58 struct fcoe_conn_offload_ramrod_data
{
59 struct regpair sq_pbl_addr
;
60 struct regpair sq_curr_page_addr
;
61 struct regpair sq_next_page_addr
;
62 struct regpair xferq_pbl_addr
;
63 struct regpair xferq_curr_page_addr
;
64 struct regpair xferq_next_page_addr
;
65 struct regpair respq_pbl_addr
;
66 struct regpair respq_curr_page_addr
;
67 struct regpair respq_next_page_addr
;
68 __le16 dst_mac_addr_lo
;
69 __le16 dst_mac_addr_mid
;
70 __le16 dst_mac_addr_hi
;
71 __le16 src_mac_addr_lo
;
72 __le16 src_mac_addr_mid
;
73 __le16 src_mac_addr_hi
;
74 __le16 tx_max_fc_pay_len
;
75 __le16 e_d_tov_timer_val
;
76 __le16 rx_max_fc_pay_len
;
78 #define FCOE_CONN_OFFLOAD_RAMROD_DATA_VLAN_ID_MASK 0xFFF
79 #define FCOE_CONN_OFFLOAD_RAMROD_DATA_VLAN_ID_SHIFT 0
80 #define FCOE_CONN_OFFLOAD_RAMROD_DATA_CFI_MASK 0x1
81 #define FCOE_CONN_OFFLOAD_RAMROD_DATA_CFI_SHIFT 12
82 #define FCOE_CONN_OFFLOAD_RAMROD_DATA_PRIORITY_MASK 0x7
83 #define FCOE_CONN_OFFLOAD_RAMROD_DATA_PRIORITY_SHIFT 13
85 __le16 rec_rr_tov_timer_val
;
86 struct fc_addr_nw s_id
;
88 struct fc_addr_nw d_id
;
90 #define FCOE_CONN_OFFLOAD_RAMROD_DATA_B_CONT_INCR_SEQ_CNT_MASK 0x1
91 #define FCOE_CONN_OFFLOAD_RAMROD_DATA_B_CONT_INCR_SEQ_CNT_SHIFT 0
92 #define FCOE_CONN_OFFLOAD_RAMROD_DATA_B_CONF_REQ_MASK 0x1
93 #define FCOE_CONN_OFFLOAD_RAMROD_DATA_B_CONF_REQ_SHIFT 1
94 #define FCOE_CONN_OFFLOAD_RAMROD_DATA_B_REC_VALID_MASK 0x1
95 #define FCOE_CONN_OFFLOAD_RAMROD_DATA_B_REC_VALID_SHIFT 2
96 #define FCOE_CONN_OFFLOAD_RAMROD_DATA_B_VLAN_FLAG_MASK 0x1
97 #define FCOE_CONN_OFFLOAD_RAMROD_DATA_B_VLAN_FLAG_SHIFT 3
98 #define FCOE_CONN_OFFLOAD_RAMROD_DATA_MODE_MASK 0x3
99 #define FCOE_CONN_OFFLOAD_RAMROD_DATA_MODE_SHIFT 4
100 #define FCOE_CONN_OFFLOAD_RAMROD_DATA_RESERVED0_MASK 0x3
101 #define FCOE_CONN_OFFLOAD_RAMROD_DATA_RESERVED0_SHIFT 6
107 /* FCoE terminate connection request */
108 struct fcoe_conn_terminate_ramrod_data
{
109 struct regpair terminate_params_addr
;
112 struct fcoe_fast_sgl_ctx
{
113 struct regpair sgl_start_addr
;
114 __le32 sgl_byte_offset
;
115 __le16 task_reuse_cnt
;
116 __le16 init_offset_in_first_sge
;
119 struct fcoe_slow_sgl_ctx
{
120 struct regpair base_sgl_addr
;
122 __le16 remainder_num_sges
;
123 __le16 curr_sgl_index
;
128 struct regpair sge_addr
;
135 union fcoe_data_desc_ctx
{
136 struct fcoe_fast_sgl_ctx fast
;
137 struct fcoe_slow_sgl_ctx slow
;
138 struct fcoe_sge single_sge
;
141 union fcoe_dix_desc_ctx
{
142 struct fcoe_slow_sgl_ctx dix_sgl
;
143 struct fcoe_sge cached_dix_sge
;
146 struct fcoe_fcp_cmd_payload
{
150 struct fcoe_fcp_rsp_payload
{
154 struct fcoe_fcp_xfer_payload
{
158 /* FCoE firmware function init */
159 struct fcoe_init_func_ramrod_data
{
160 struct scsi_init_func_params func_params
;
161 struct scsi_init_func_queues q_params
;
163 __le16 sq_num_pages_in_pbl
;
167 /* FCoE: Mode of the connection: Target or Initiator or both */
168 enum fcoe_mode_type
{
169 FCOE_INITIATOR_MODE
= 0x0,
170 FCOE_TARGET_MODE
= 0x1,
171 FCOE_BOTH_OR_NOT_CHOSEN
= 0x3,
175 struct fcoe_mstorm_fcoe_task_st_ctx_fp
{
177 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_FP_RSRV0_MASK 0x7FFF
178 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_FP_RSRV0_SHIFT 0
179 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_FP_MP_INCLUDE_FC_HEADER_MASK 0x1
180 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_FP_MP_INCLUDE_FC_HEADER_SHIFT 15
181 __le16 difDataResidue
;
183 __le16 single_sge_saved_offset
;
184 __le32 data_2_trns_rem
;
186 union fcoe_dix_desc_ctx dix_desc
;
187 union fcoe_data_desc_ctx data_desc
;
190 struct fcoe_mstorm_fcoe_task_st_ctx_non_fp
{
192 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_HOST_INTERFACE_MASK 0x3
193 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_HOST_INTERFACE_SHIFT 0
194 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_DIF_TO_PEER_MASK 0x1
195 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_DIF_TO_PEER_SHIFT 2
196 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_VALIDATE_DIX_APP_TAG_MASK 0x1
197 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_VALIDATE_DIX_APP_TAG_SHIFT 3
198 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_INTERVAL_SIZE_LOG_MASK 0xF
199 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_INTERVAL_SIZE_LOG_SHIFT 4
200 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_DIX_BLOCK_SIZE_MASK 0x3
201 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_DIX_BLOCK_SIZE_SHIFT 8
202 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_RESERVED_MASK 0x1
203 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_RESERVED_SHIFT 10
204 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_HAS_FIRST_PACKET_ARRIVED_MASK 0x1
205 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_HAS_FIRST_PACKET_ARRIVED_SHIFT 11
206 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_VALIDATE_DIX_REF_TAG_MASK 0x1
207 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_VALIDATE_DIX_REF_TAG_SHIFT 12
208 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_DIX_CACHED_SGE_FLG_MASK 0x1
209 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_DIX_CACHED_SGE_FLG_SHIFT 13
210 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_OFFSET_IN_IO_VALID_MASK 0x1
211 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_OFFSET_IN_IO_VALID_SHIFT 14
212 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_DIF_SUPPORTED_MASK 0x1
213 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_DIF_SUPPORTED_SHIFT 15
215 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_TX_SGL_MODE_MASK 0x7
216 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_TX_SGL_MODE_SHIFT 0
217 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_RX_SGL_MODE_MASK 0x7
218 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_RX_SGL_MODE_SHIFT 3
219 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_RSRV1_MASK 0x3
220 #define FCOE_MSTORM_FCOE_TASK_ST_CTX_NON_FP_RSRV1_SHIFT 6
222 __le32 num_prm_zero_read
;
223 struct regpair rsp_buf_addr
;
226 struct fcoe_rx_stat
{
227 struct regpair fcoe_rx_byte_cnt
;
228 struct regpair fcoe_rx_data_pkt_cnt
;
229 struct regpair fcoe_rx_xfer_pkt_cnt
;
230 struct regpair fcoe_rx_other_pkt_cnt
;
231 __le32 fcoe_silent_drop_pkt_cmdq_full_cnt
;
232 __le32 fcoe_silent_drop_pkt_rq_full_cnt
;
233 __le32 fcoe_silent_drop_pkt_crc_error_cnt
;
234 __le32 fcoe_silent_drop_pkt_task_invalid_cnt
;
235 __le32 fcoe_silent_drop_total_pkt_cnt
;
241 FCOE_SINGLE_FAST_SGE
,
249 struct fcoe_stat_ramrod_data
{
250 struct regpair stat_params_addr
;
253 struct protection_info_ctx
{
255 #define PROTECTION_INFO_CTX_HOST_INTERFACE_MASK 0x3
256 #define PROTECTION_INFO_CTX_HOST_INTERFACE_SHIFT 0
257 #define PROTECTION_INFO_CTX_DIF_TO_PEER_MASK 0x1
258 #define PROTECTION_INFO_CTX_DIF_TO_PEER_SHIFT 2
259 #define PROTECTION_INFO_CTX_VALIDATE_DIX_APP_TAG_MASK 0x1
260 #define PROTECTION_INFO_CTX_VALIDATE_DIX_APP_TAG_SHIFT 3
261 #define PROTECTION_INFO_CTX_INTERVAL_SIZE_LOG_MASK 0xF
262 #define PROTECTION_INFO_CTX_INTERVAL_SIZE_LOG_SHIFT 4
263 #define PROTECTION_INFO_CTX_VALIDATE_DIX_REF_TAG_MASK 0x1
264 #define PROTECTION_INFO_CTX_VALIDATE_DIX_REF_TAG_SHIFT 8
265 #define PROTECTION_INFO_CTX_RESERVED0_MASK 0x7F
266 #define PROTECTION_INFO_CTX_RESERVED0_SHIFT 9
271 union protection_info_union_ctx
{
272 struct protection_info_ctx info
;
276 struct fcp_rsp_payload_padded
{
277 struct fcoe_fcp_rsp_payload rsp_payload
;
281 struct fcp_xfer_payload_padded
{
282 struct fcoe_fcp_xfer_payload xfer_payload
;
286 struct fcoe_tx_data_params
{
290 #define FCOE_TX_DATA_PARAMS_OFFSET_IN_IO_VALID_MASK 0x1
291 #define FCOE_TX_DATA_PARAMS_OFFSET_IN_IO_VALID_SHIFT 0
292 #define FCOE_TX_DATA_PARAMS_DROP_DATA_MASK 0x1
293 #define FCOE_TX_DATA_PARAMS_DROP_DATA_SHIFT 1
294 #define FCOE_TX_DATA_PARAMS_AFTER_SEQ_REC_MASK 0x1
295 #define FCOE_TX_DATA_PARAMS_AFTER_SEQ_REC_SHIFT 2
296 #define FCOE_TX_DATA_PARAMS_RESERVED0_MASK 0x1F
297 #define FCOE_TX_DATA_PARAMS_RESERVED0_SHIFT 3
300 __le16 single_sge_saved_offset
;
301 __le16 next_dif_offset
;
306 struct fcoe_tx_mid_path_params
{
316 struct fcoe_tx_params
{
317 struct fcoe_tx_data_params data
;
318 struct fcoe_tx_mid_path_params mid_path
;
321 union fcoe_tx_info_union_ctx
{
322 struct fcoe_fcp_cmd_payload fcp_cmd_payload
;
323 struct fcp_rsp_payload_padded fcp_rsp_payload
;
324 struct fcp_xfer_payload_padded fcp_xfer_payload
;
325 struct fcoe_tx_params tx_params
;
328 struct ystorm_fcoe_task_st_ctx
{
331 #define YSTORM_FCOE_TASK_ST_CTX_TX_SGL_MODE_MASK 0x7
332 #define YSTORM_FCOE_TASK_ST_CTX_TX_SGL_MODE_SHIFT 0
333 #define YSTORM_FCOE_TASK_ST_CTX_RSRV_MASK 0x1F
334 #define YSTORM_FCOE_TASK_ST_CTX_RSRV_SHIFT 3
336 u8 expect_first_xfer
;
337 __le32 num_pbf_zero_write
;
338 union protection_info_union_ctx protection_info_union
;
339 __le32 data_2_trns_rem
;
340 union fcoe_tx_info_union_ctx tx_info_union
;
341 union fcoe_dix_desc_ctx dix_desc
;
342 union fcoe_data_desc_ctx data_desc
;
345 __le32 task_rety_identifier
;
349 struct ystorm_fcoe_task_ag_ctx
{
354 #define YSTORM_FCOE_TASK_AG_CTX_NIBBLE0_MASK 0xF
355 #define YSTORM_FCOE_TASK_AG_CTX_NIBBLE0_SHIFT 0
356 #define YSTORM_FCOE_TASK_AG_CTX_BIT0_MASK 0x1
357 #define YSTORM_FCOE_TASK_AG_CTX_BIT0_SHIFT 4
358 #define YSTORM_FCOE_TASK_AG_CTX_BIT1_MASK 0x1
359 #define YSTORM_FCOE_TASK_AG_CTX_BIT1_SHIFT 5
360 #define YSTORM_FCOE_TASK_AG_CTX_BIT2_MASK 0x1
361 #define YSTORM_FCOE_TASK_AG_CTX_BIT2_SHIFT 6
362 #define YSTORM_FCOE_TASK_AG_CTX_BIT3_MASK 0x1
363 #define YSTORM_FCOE_TASK_AG_CTX_BIT3_SHIFT 7
365 #define YSTORM_FCOE_TASK_AG_CTX_CF0_MASK 0x3
366 #define YSTORM_FCOE_TASK_AG_CTX_CF0_SHIFT 0
367 #define YSTORM_FCOE_TASK_AG_CTX_CF1_MASK 0x3
368 #define YSTORM_FCOE_TASK_AG_CTX_CF1_SHIFT 2
369 #define YSTORM_FCOE_TASK_AG_CTX_CF2SPECIAL_MASK 0x3
370 #define YSTORM_FCOE_TASK_AG_CTX_CF2SPECIAL_SHIFT 4
371 #define YSTORM_FCOE_TASK_AG_CTX_CF0EN_MASK 0x1
372 #define YSTORM_FCOE_TASK_AG_CTX_CF0EN_SHIFT 6
373 #define YSTORM_FCOE_TASK_AG_CTX_CF1EN_MASK 0x1
374 #define YSTORM_FCOE_TASK_AG_CTX_CF1EN_SHIFT 7
376 #define YSTORM_FCOE_TASK_AG_CTX_BIT4_MASK 0x1
377 #define YSTORM_FCOE_TASK_AG_CTX_BIT4_SHIFT 0
378 #define YSTORM_FCOE_TASK_AG_CTX_RULE0EN_MASK 0x1
379 #define YSTORM_FCOE_TASK_AG_CTX_RULE0EN_SHIFT 1
380 #define YSTORM_FCOE_TASK_AG_CTX_RULE1EN_MASK 0x1
381 #define YSTORM_FCOE_TASK_AG_CTX_RULE1EN_SHIFT 2
382 #define YSTORM_FCOE_TASK_AG_CTX_RULE2EN_MASK 0x1
383 #define YSTORM_FCOE_TASK_AG_CTX_RULE2EN_SHIFT 3
384 #define YSTORM_FCOE_TASK_AG_CTX_RULE3EN_MASK 0x1
385 #define YSTORM_FCOE_TASK_AG_CTX_RULE3EN_SHIFT 4
386 #define YSTORM_FCOE_TASK_AG_CTX_RULE4EN_MASK 0x1
387 #define YSTORM_FCOE_TASK_AG_CTX_RULE4EN_SHIFT 5
388 #define YSTORM_FCOE_TASK_AG_CTX_RULE5EN_MASK 0x1
389 #define YSTORM_FCOE_TASK_AG_CTX_RULE5EN_SHIFT 6
390 #define YSTORM_FCOE_TASK_AG_CTX_RULE6EN_MASK 0x1
391 #define YSTORM_FCOE_TASK_AG_CTX_RULE6EN_SHIFT 7
405 struct tstorm_fcoe_task_ag_ctx
{
410 #define TSTORM_FCOE_TASK_AG_CTX_CONNECTION_TYPE_MASK 0xF
411 #define TSTORM_FCOE_TASK_AG_CTX_CONNECTION_TYPE_SHIFT 0
412 #define TSTORM_FCOE_TASK_AG_CTX_EXIST_IN_QM0_MASK 0x1
413 #define TSTORM_FCOE_TASK_AG_CTX_EXIST_IN_QM0_SHIFT 4
414 #define TSTORM_FCOE_TASK_AG_CTX_BIT1_MASK 0x1
415 #define TSTORM_FCOE_TASK_AG_CTX_BIT1_SHIFT 5
416 #define TSTORM_FCOE_TASK_AG_CTX_WAIT_ABTS_RSP_F_MASK 0x1
417 #define TSTORM_FCOE_TASK_AG_CTX_WAIT_ABTS_RSP_F_SHIFT 6
418 #define TSTORM_FCOE_TASK_AG_CTX_VALID_MASK 0x1
419 #define TSTORM_FCOE_TASK_AG_CTX_VALID_SHIFT 7
421 #define TSTORM_FCOE_TASK_AG_CTX_FALSE_RR_TOV_MASK 0x1
422 #define TSTORM_FCOE_TASK_AG_CTX_FALSE_RR_TOV_SHIFT 0
423 #define TSTORM_FCOE_TASK_AG_CTX_BIT5_MASK 0x1
424 #define TSTORM_FCOE_TASK_AG_CTX_BIT5_SHIFT 1
425 #define TSTORM_FCOE_TASK_AG_CTX_REC_RR_TOV_CF_MASK 0x3
426 #define TSTORM_FCOE_TASK_AG_CTX_REC_RR_TOV_CF_SHIFT 2
427 #define TSTORM_FCOE_TASK_AG_CTX_ED_TOV_CF_MASK 0x3
428 #define TSTORM_FCOE_TASK_AG_CTX_ED_TOV_CF_SHIFT 4
429 #define TSTORM_FCOE_TASK_AG_CTX_CF2_MASK 0x3
430 #define TSTORM_FCOE_TASK_AG_CTX_CF2_SHIFT 6
432 #define TSTORM_FCOE_TASK_AG_CTX_TIMER_STOP_ALL_MASK 0x3
433 #define TSTORM_FCOE_TASK_AG_CTX_TIMER_STOP_ALL_SHIFT 0
434 #define TSTORM_FCOE_TASK_AG_CTX_EX_CLEANUP_CF_MASK 0x3
435 #define TSTORM_FCOE_TASK_AG_CTX_EX_CLEANUP_CF_SHIFT 2
436 #define TSTORM_FCOE_TASK_AG_CTX_SEQ_INIT_CF_MASK 0x3
437 #define TSTORM_FCOE_TASK_AG_CTX_SEQ_INIT_CF_SHIFT 4
438 #define TSTORM_FCOE_TASK_AG_CTX_SEQ_RECOVERY_CF_MASK 0x3
439 #define TSTORM_FCOE_TASK_AG_CTX_SEQ_RECOVERY_CF_SHIFT 6
441 #define TSTORM_FCOE_TASK_AG_CTX_UNSOL_COMP_CF_MASK 0x3
442 #define TSTORM_FCOE_TASK_AG_CTX_UNSOL_COMP_CF_SHIFT 0
443 #define TSTORM_FCOE_TASK_AG_CTX_REC_RR_TOV_CF_EN_MASK 0x1
444 #define TSTORM_FCOE_TASK_AG_CTX_REC_RR_TOV_CF_EN_SHIFT 2
445 #define TSTORM_FCOE_TASK_AG_CTX_ED_TOV_CF_EN_MASK 0x1
446 #define TSTORM_FCOE_TASK_AG_CTX_ED_TOV_CF_EN_SHIFT 3
447 #define TSTORM_FCOE_TASK_AG_CTX_CF2EN_MASK 0x1
448 #define TSTORM_FCOE_TASK_AG_CTX_CF2EN_SHIFT 4
449 #define TSTORM_FCOE_TASK_AG_CTX_TIMER_STOP_ALL_EN_MASK 0x1
450 #define TSTORM_FCOE_TASK_AG_CTX_TIMER_STOP_ALL_EN_SHIFT 5
451 #define TSTORM_FCOE_TASK_AG_CTX_EX_CLEANUP_CF_EN_MASK 0x1
452 #define TSTORM_FCOE_TASK_AG_CTX_EX_CLEANUP_CF_EN_SHIFT 6
453 #define TSTORM_FCOE_TASK_AG_CTX_SEQ_INIT_CF_EN_MASK 0x1
454 #define TSTORM_FCOE_TASK_AG_CTX_SEQ_INIT_CF_EN_SHIFT 7
456 #define TSTORM_FCOE_TASK_AG_CTX_SEQ_RECOVERY_CF_EN_MASK 0x1
457 #define TSTORM_FCOE_TASK_AG_CTX_SEQ_RECOVERY_CF_EN_SHIFT 0
458 #define TSTORM_FCOE_TASK_AG_CTX_UNSOL_COMP_CF_EN_MASK 0x1
459 #define TSTORM_FCOE_TASK_AG_CTX_UNSOL_COMP_CF_EN_SHIFT 1
460 #define TSTORM_FCOE_TASK_AG_CTX_RULE0EN_MASK 0x1
461 #define TSTORM_FCOE_TASK_AG_CTX_RULE0EN_SHIFT 2
462 #define TSTORM_FCOE_TASK_AG_CTX_RULE1EN_MASK 0x1
463 #define TSTORM_FCOE_TASK_AG_CTX_RULE1EN_SHIFT 3
464 #define TSTORM_FCOE_TASK_AG_CTX_RULE2EN_MASK 0x1
465 #define TSTORM_FCOE_TASK_AG_CTX_RULE2EN_SHIFT 4
466 #define TSTORM_FCOE_TASK_AG_CTX_RULE3EN_MASK 0x1
467 #define TSTORM_FCOE_TASK_AG_CTX_RULE3EN_SHIFT 5
468 #define TSTORM_FCOE_TASK_AG_CTX_RULE4EN_MASK 0x1
469 #define TSTORM_FCOE_TASK_AG_CTX_RULE4EN_SHIFT 6
470 #define TSTORM_FCOE_TASK_AG_CTX_RULE5EN_MASK 0x1
471 #define TSTORM_FCOE_TASK_AG_CTX_RULE5EN_SHIFT 7
473 __le16 last_sent_tid
;
474 __le32 rec_rr_tov_exp_timeout
;
480 __le32 data_offset_end_of_seq
;
481 __le32 data_offset_next
;
484 struct fcoe_tstorm_fcoe_task_st_ctx_read_write
{
485 union fcoe_cleanup_addr_exp_ro_union cleanup_addr_exp_ro_union
;
487 #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_RX_SGL_MODE_MASK 0x7
488 #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_RX_SGL_MODE_SHIFT 0
489 #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_EXP_FIRST_FRAME_MASK 0x1
490 #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_EXP_FIRST_FRAME_SHIFT 3
491 #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_SEQ_ACTIVE_MASK 0x1
492 #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_SEQ_ACTIVE_SHIFT 4
493 #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_SEQ_TIMEOUT_MASK 0x1
494 #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_SEQ_TIMEOUT_SHIFT 5
495 #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_SINGLE_PKT_IN_EX_MASK 0x1
496 #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_SINGLE_PKT_IN_EX_SHIFT 6
497 #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_OOO_RX_SEQ_STAT_MASK 0x1
498 #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_OOO_RX_SEQ_STAT_SHIFT 7
499 #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_CQ_ADD_ADV_MASK 0x3
500 #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_CQ_ADD_ADV_SHIFT 8
501 #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_RSRV1_MASK 0x3F
502 #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_RSRV1_SHIFT 10
507 struct fcoe_abts_pkt abts_data
;
508 __le32 e_d_tov_exp_timeout_val
;
509 __le16 ooo_rx_seq_cnt
;
513 struct fcoe_tstorm_fcoe_task_st_ctx_read_only
{
519 __le32 fcp_cmd_trns_size
;
523 struct tstorm_fcoe_task_st_ctx
{
524 struct fcoe_tstorm_fcoe_task_st_ctx_read_write read_write
;
525 struct fcoe_tstorm_fcoe_task_st_ctx_read_only read_only
;
528 struct mstorm_fcoe_task_ag_ctx
{
533 #define MSTORM_FCOE_TASK_AG_CTX_CONNECTION_TYPE_MASK 0xF
534 #define MSTORM_FCOE_TASK_AG_CTX_CONNECTION_TYPE_SHIFT 0
535 #define MSTORM_FCOE_TASK_AG_CTX_EXIST_IN_QM0_MASK 0x1
536 #define MSTORM_FCOE_TASK_AG_CTX_EXIST_IN_QM0_SHIFT 4
537 #define MSTORM_FCOE_TASK_AG_CTX_CQE_PLACED_MASK 0x1
538 #define MSTORM_FCOE_TASK_AG_CTX_CQE_PLACED_SHIFT 5
539 #define MSTORM_FCOE_TASK_AG_CTX_BIT2_MASK 0x1
540 #define MSTORM_FCOE_TASK_AG_CTX_BIT2_SHIFT 6
541 #define MSTORM_FCOE_TASK_AG_CTX_BIT3_MASK 0x1
542 #define MSTORM_FCOE_TASK_AG_CTX_BIT3_SHIFT 7
544 #define MSTORM_FCOE_TASK_AG_CTX_EX_CLEANUP_CF_MASK 0x3
545 #define MSTORM_FCOE_TASK_AG_CTX_EX_CLEANUP_CF_SHIFT 0
546 #define MSTORM_FCOE_TASK_AG_CTX_CF1_MASK 0x3
547 #define MSTORM_FCOE_TASK_AG_CTX_CF1_SHIFT 2
548 #define MSTORM_FCOE_TASK_AG_CTX_CF2_MASK 0x3
549 #define MSTORM_FCOE_TASK_AG_CTX_CF2_SHIFT 4
550 #define MSTORM_FCOE_TASK_AG_CTX_EX_CLEANUP_CF_EN_MASK 0x1
551 #define MSTORM_FCOE_TASK_AG_CTX_EX_CLEANUP_CF_EN_SHIFT 6
552 #define MSTORM_FCOE_TASK_AG_CTX_CF1EN_MASK 0x1
553 #define MSTORM_FCOE_TASK_AG_CTX_CF1EN_SHIFT 7
555 #define MSTORM_FCOE_TASK_AG_CTX_CF2EN_MASK 0x1
556 #define MSTORM_FCOE_TASK_AG_CTX_CF2EN_SHIFT 0
557 #define MSTORM_FCOE_TASK_AG_CTX_RULE0EN_MASK 0x1
558 #define MSTORM_FCOE_TASK_AG_CTX_RULE0EN_SHIFT 1
559 #define MSTORM_FCOE_TASK_AG_CTX_RULE1EN_MASK 0x1
560 #define MSTORM_FCOE_TASK_AG_CTX_RULE1EN_SHIFT 2
561 #define MSTORM_FCOE_TASK_AG_CTX_RULE2EN_MASK 0x1
562 #define MSTORM_FCOE_TASK_AG_CTX_RULE2EN_SHIFT 3
563 #define MSTORM_FCOE_TASK_AG_CTX_RULE3EN_MASK 0x1
564 #define MSTORM_FCOE_TASK_AG_CTX_RULE3EN_SHIFT 4
565 #define MSTORM_FCOE_TASK_AG_CTX_RULE4EN_MASK 0x1
566 #define MSTORM_FCOE_TASK_AG_CTX_RULE4EN_SHIFT 5
567 #define MSTORM_FCOE_TASK_AG_CTX_XFER_PLACEMENT_EN_MASK 0x1
568 #define MSTORM_FCOE_TASK_AG_CTX_XFER_PLACEMENT_EN_SHIFT 6
569 #define MSTORM_FCOE_TASK_AG_CTX_RULE6EN_MASK 0x1
570 #define MSTORM_FCOE_TASK_AG_CTX_RULE6EN_SHIFT 7
572 __le32 received_bytes
;
580 __le32 expected_bytes
;
584 struct mstorm_fcoe_task_st_ctx
{
585 struct fcoe_mstorm_fcoe_task_st_ctx_non_fp non_fp
;
586 struct fcoe_mstorm_fcoe_task_st_ctx_fp fp
;
589 struct ustorm_fcoe_task_ag_ctx
{
594 #define USTORM_FCOE_TASK_AG_CTX_CONNECTION_TYPE_MASK 0xF
595 #define USTORM_FCOE_TASK_AG_CTX_CONNECTION_TYPE_SHIFT 0
596 #define USTORM_FCOE_TASK_AG_CTX_EXIST_IN_QM0_MASK 0x1
597 #define USTORM_FCOE_TASK_AG_CTX_EXIST_IN_QM0_SHIFT 4
598 #define USTORM_FCOE_TASK_AG_CTX_BIT1_MASK 0x1
599 #define USTORM_FCOE_TASK_AG_CTX_BIT1_SHIFT 5
600 #define USTORM_FCOE_TASK_AG_CTX_CF0_MASK 0x3
601 #define USTORM_FCOE_TASK_AG_CTX_CF0_SHIFT 6
603 #define USTORM_FCOE_TASK_AG_CTX_CF1_MASK 0x3
604 #define USTORM_FCOE_TASK_AG_CTX_CF1_SHIFT 0
605 #define USTORM_FCOE_TASK_AG_CTX_CF2_MASK 0x3
606 #define USTORM_FCOE_TASK_AG_CTX_CF2_SHIFT 2
607 #define USTORM_FCOE_TASK_AG_CTX_CF3_MASK 0x3
608 #define USTORM_FCOE_TASK_AG_CTX_CF3_SHIFT 4
609 #define USTORM_FCOE_TASK_AG_CTX_DIF_ERROR_CF_MASK 0x3
610 #define USTORM_FCOE_TASK_AG_CTX_DIF_ERROR_CF_SHIFT 6
612 #define USTORM_FCOE_TASK_AG_CTX_CF0EN_MASK 0x1
613 #define USTORM_FCOE_TASK_AG_CTX_CF0EN_SHIFT 0
614 #define USTORM_FCOE_TASK_AG_CTX_CF1EN_MASK 0x1
615 #define USTORM_FCOE_TASK_AG_CTX_CF1EN_SHIFT 1
616 #define USTORM_FCOE_TASK_AG_CTX_CF2EN_MASK 0x1
617 #define USTORM_FCOE_TASK_AG_CTX_CF2EN_SHIFT 2
618 #define USTORM_FCOE_TASK_AG_CTX_CF3EN_MASK 0x1
619 #define USTORM_FCOE_TASK_AG_CTX_CF3EN_SHIFT 3
620 #define USTORM_FCOE_TASK_AG_CTX_DIF_ERROR_CF_EN_MASK 0x1
621 #define USTORM_FCOE_TASK_AG_CTX_DIF_ERROR_CF_EN_SHIFT 4
622 #define USTORM_FCOE_TASK_AG_CTX_RULE0EN_MASK 0x1
623 #define USTORM_FCOE_TASK_AG_CTX_RULE0EN_SHIFT 5
624 #define USTORM_FCOE_TASK_AG_CTX_RULE1EN_MASK 0x1
625 #define USTORM_FCOE_TASK_AG_CTX_RULE1EN_SHIFT 6
626 #define USTORM_FCOE_TASK_AG_CTX_RULE2EN_MASK 0x1
627 #define USTORM_FCOE_TASK_AG_CTX_RULE2EN_SHIFT 7
629 #define USTORM_FCOE_TASK_AG_CTX_RULE3EN_MASK 0x1
630 #define USTORM_FCOE_TASK_AG_CTX_RULE3EN_SHIFT 0
631 #define USTORM_FCOE_TASK_AG_CTX_RULE4EN_MASK 0x1
632 #define USTORM_FCOE_TASK_AG_CTX_RULE4EN_SHIFT 1
633 #define USTORM_FCOE_TASK_AG_CTX_RULE5EN_MASK 0x1
634 #define USTORM_FCOE_TASK_AG_CTX_RULE5EN_SHIFT 2
635 #define USTORM_FCOE_TASK_AG_CTX_RULE6EN_MASK 0x1
636 #define USTORM_FCOE_TASK_AG_CTX_RULE6EN_SHIFT 3
637 #define USTORM_FCOE_TASK_AG_CTX_DIF_ERROR_TYPE_MASK 0xF
638 #define USTORM_FCOE_TASK_AG_CTX_DIF_ERROR_TYPE_SHIFT 4
639 __le32 dif_err_intervals
;
640 __le32 dif_error_1st_interval
;
641 __le32 global_cq_num
;
647 struct fcoe_task_context
{
648 struct ystorm_fcoe_task_st_ctx ystorm_st_context
;
649 struct tdif_task_context tdif_context
;
650 struct ystorm_fcoe_task_ag_ctx ystorm_ag_context
;
651 struct tstorm_fcoe_task_ag_ctx tstorm_ag_context
;
652 struct timers_context timer_context
;
653 struct tstorm_fcoe_task_st_ctx tstorm_st_context
;
654 struct regpair tstorm_st_padding
[2];
655 struct mstorm_fcoe_task_ag_ctx mstorm_ag_context
;
656 struct mstorm_fcoe_task_st_ctx mstorm_st_context
;
657 struct ustorm_fcoe_task_ag_ctx ustorm_ag_context
;
658 struct rdif_task_context rdif_context
;
661 struct fcoe_tx_stat
{
662 struct regpair fcoe_tx_byte_cnt
;
663 struct regpair fcoe_tx_data_pkt_cnt
;
664 struct regpair fcoe_tx_xfer_pkt_cnt
;
665 struct regpair fcoe_tx_other_pkt_cnt
;
671 #define FCOE_WQE_REQ_TYPE_MASK 0xF
672 #define FCOE_WQE_REQ_TYPE_SHIFT 0
673 #define FCOE_WQE_SGL_MODE_MASK 0x7
674 #define FCOE_WQE_SGL_MODE_SHIFT 4
675 #define FCOE_WQE_CONTINUATION_MASK 0x1
676 #define FCOE_WQE_CONTINUATION_SHIFT 7
677 #define FCOE_WQE_INVALIDATE_PTU_MASK 0x1
678 #define FCOE_WQE_INVALIDATE_PTU_SHIFT 8
679 #define FCOE_WQE_SUPER_IO_MASK 0x1
680 #define FCOE_WQE_SUPER_IO_SHIFT 9
681 #define FCOE_WQE_SEND_AUTO_RSP_MASK 0x1
682 #define FCOE_WQE_SEND_AUTO_RSP_SHIFT 10
683 #define FCOE_WQE_RESERVED0_MASK 0x1F
684 #define FCOE_WQE_RESERVED0_SHIFT 11
685 union fcoe_additional_info_union additional_info_union
;
688 struct xfrqe_prot_flags
{
690 #define XFRQE_PROT_FLAGS_PROT_INTERVAL_SIZE_LOG_MASK 0xF
691 #define XFRQE_PROT_FLAGS_PROT_INTERVAL_SIZE_LOG_SHIFT 0
692 #define XFRQE_PROT_FLAGS_DIF_TO_PEER_MASK 0x1
693 #define XFRQE_PROT_FLAGS_DIF_TO_PEER_SHIFT 4
694 #define XFRQE_PROT_FLAGS_HOST_INTERFACE_MASK 0x3
695 #define XFRQE_PROT_FLAGS_HOST_INTERFACE_SHIFT 5
696 #define XFRQE_PROT_FLAGS_RESERVED_MASK 0x1
697 #define XFRQE_PROT_FLAGS_RESERVED_SHIFT 7
700 struct fcoe_db_data
{
702 #define FCOE_DB_DATA_DEST_MASK 0x3
703 #define FCOE_DB_DATA_DEST_SHIFT 0
704 #define FCOE_DB_DATA_AGG_CMD_MASK 0x3
705 #define FCOE_DB_DATA_AGG_CMD_SHIFT 2
706 #define FCOE_DB_DATA_BYPASS_EN_MASK 0x1
707 #define FCOE_DB_DATA_BYPASS_EN_SHIFT 4
708 #define FCOE_DB_DATA_RESERVED_MASK 0x1
709 #define FCOE_DB_DATA_RESERVED_SHIFT 5
710 #define FCOE_DB_DATA_AGG_VAL_SEL_MASK 0x3
711 #define FCOE_DB_DATA_AGG_VAL_SEL_SHIFT 6
715 #endif /* __FCOE_COMMON__ */