4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, v.1, (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://opensource.org/licenses/CDDL-1.0.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2014-2017 Cavium, Inc.
24 * The contents of this file are subject to the terms of the Common Development
25 * and Distribution License, v.1, (the "License").
27 * You may not use this file except in compliance with the License.
29 * You can obtain a copy of the License at available
30 * at http://opensource.org/licenses/CDDL-1.0
32 * See the License for the specific language governing permissions and
33 * limitations under the License.
36 #ifndef __ECORE_FCOE_API_H__
37 #define __ECORE_FCOE_API_H__
39 #include "ecore_sp_api.h"
41 struct ecore_fcoe_conn
{
42 osal_list_entry_t list_entry
;
50 dma_addr_t sq_pbl_addr
;
51 dma_addr_t sq_curr_page_addr
;
52 dma_addr_t sq_next_page_addr
;
53 dma_addr_t xferq_pbl_addr
;
54 void *xferq_pbl_addr_virt_addr
;
55 dma_addr_t xferq_addr
[4];
56 void *xferq_addr_virt_addr
[4];
57 dma_addr_t confq_pbl_addr
;
58 void *confq_pbl_addr_virt_addr
;
59 dma_addr_t confq_addr
[2];
60 void *confq_addr_virt_addr
[2];
62 dma_addr_t terminate_params
;
71 u16 tx_max_fc_pay_len
;
72 u16 e_d_tov_timer_val
;
73 u16 rec_tov_timer_val
;
74 u16 rx_max_fc_pay_len
;
78 struct fc_addr_nw s_id
;
80 struct fc_addr_nw d_id
;
85 #ifndef __EXTRACT__LINUX__
86 struct ecore_fcoe_stats
{
88 u64 fcoe_rx_data_pkt_cnt
;
89 u64 fcoe_rx_xfer_pkt_cnt
;
90 u64 fcoe_rx_other_pkt_cnt
;
91 u32 fcoe_silent_drop_pkt_cmdq_full_cnt
;
92 u32 fcoe_silent_drop_pkt_rq_full_cnt
;
93 u32 fcoe_silent_drop_pkt_crc_error_cnt
;
94 u32 fcoe_silent_drop_pkt_task_invalid_cnt
;
95 u32 fcoe_silent_drop_total_pkt_cnt
;
98 u64 fcoe_tx_data_pkt_cnt
;
99 u64 fcoe_tx_xfer_pkt_cnt
;
100 u64 fcoe_tx_other_pkt_cnt
;
105 ecore_fcoe_acquire_connection(struct ecore_hwfn
*p_hwfn
,
106 struct ecore_fcoe_conn
*p_in_conn
,
107 struct ecore_fcoe_conn
**p_out_conn
);
109 void OSAL_IOMEM
*ecore_fcoe_get_db_addr(struct ecore_hwfn
*p_hwfn
,
112 void OSAL_IOMEM
*ecore_fcoe_get_global_cmdq_cons(struct ecore_hwfn
*p_hwfn
,
115 void OSAL_IOMEM
*ecore_fcoe_get_primary_bdq_prod(struct ecore_hwfn
*p_hwfn
,
118 void OSAL_IOMEM
*ecore_fcoe_get_secondary_bdq_prod(struct ecore_hwfn
*p_hwfn
,
122 ecore_fcoe_offload_connection(struct ecore_hwfn
*p_hwfn
,
123 struct ecore_fcoe_conn
*p_conn
);
126 ecore_fcoe_terminate_connection(struct ecore_hwfn
*p_hwfn
,
127 struct ecore_fcoe_conn
*p_conn
);
129 void ecore_fcoe_release_connection(struct ecore_hwfn
*p_hwfn
,
130 struct ecore_fcoe_conn
*p_conn
);
133 ecore_sp_fcoe_func_start(struct ecore_hwfn
*p_hwfn
,
134 enum spq_mode comp_mode
,
135 struct ecore_spq_comp_cb
*p_comp_addr
);
138 ecore_sp_fcoe_func_stop(struct ecore_hwfn
*p_hwfn
,
139 enum spq_mode comp_mode
,
140 struct ecore_spq_comp_cb
*p_comp_addr
);
143 ecore_fcoe_get_stats(struct ecore_hwfn
*p_hwfn
,
144 struct ecore_fcoe_stats
*stats
);