2 * Copyright (c) 2017-2018 Cavium, Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.
31 #ifndef __ECORE_FCOE_API_H__
32 #define __ECORE_FCOE_API_H__
34 #include "ecore_sp_api.h"
36 #ifndef __EXTRACT__LINUX__C__
37 struct ecore_fcoe_conn {
38 osal_list_entry_t list_entry;
46 dma_addr_t sq_pbl_addr;
47 dma_addr_t sq_curr_page_addr;
48 dma_addr_t sq_next_page_addr;
49 dma_addr_t xferq_pbl_addr;
50 void *xferq_pbl_addr_virt_addr;
51 dma_addr_t xferq_addr[4];
52 void *xferq_addr_virt_addr[4];
53 dma_addr_t confq_pbl_addr;
54 void *confq_pbl_addr_virt_addr;
55 dma_addr_t confq_addr[2];
56 void *confq_addr_virt_addr[2];
58 dma_addr_t terminate_params;
67 u16 tx_max_fc_pay_len;
68 u16 e_d_tov_timer_val;
69 u16 rec_tov_timer_val;
70 u16 rx_max_fc_pay_len;
74 struct fc_addr_nw s_id;
76 struct fc_addr_nw d_id;
82 #ifndef __EXTRACT__LINUX__IF__
83 struct ecore_fcoe_stats {
85 u64 fcoe_rx_data_pkt_cnt;
86 u64 fcoe_rx_xfer_pkt_cnt;
87 u64 fcoe_rx_other_pkt_cnt;
88 u32 fcoe_silent_drop_pkt_cmdq_full_cnt;
89 u32 fcoe_silent_drop_pkt_rq_full_cnt;
90 u32 fcoe_silent_drop_pkt_crc_error_cnt;
91 u32 fcoe_silent_drop_pkt_task_invalid_cnt;
92 u32 fcoe_silent_drop_total_pkt_cnt;
95 u64 fcoe_tx_data_pkt_cnt;
96 u64 fcoe_tx_xfer_pkt_cnt;
97 u64 fcoe_tx_other_pkt_cnt;
102 ecore_fcoe_acquire_connection(struct ecore_hwfn *p_hwfn,
103 struct ecore_fcoe_conn *p_in_conn,
104 struct ecore_fcoe_conn **p_out_conn);
106 void OSAL_IOMEM *ecore_fcoe_get_db_addr(struct ecore_hwfn *p_hwfn,
109 void OSAL_IOMEM *ecore_fcoe_get_global_cmdq_cons(struct ecore_hwfn *p_hwfn,
112 void OSAL_IOMEM *ecore_fcoe_get_primary_bdq_prod(struct ecore_hwfn *p_hwfn,
115 void OSAL_IOMEM *ecore_fcoe_get_secondary_bdq_prod(struct ecore_hwfn *p_hwfn,
119 ecore_fcoe_offload_connection(struct ecore_hwfn *p_hwfn,
120 struct ecore_fcoe_conn *p_conn);
123 ecore_fcoe_terminate_connection(struct ecore_hwfn *p_hwfn,
124 struct ecore_fcoe_conn *p_conn);
126 void ecore_fcoe_release_connection(struct ecore_hwfn *p_hwfn,
127 struct ecore_fcoe_conn *p_conn);
130 ecore_sp_fcoe_func_start(struct ecore_hwfn *p_hwfn,
131 enum spq_mode comp_mode,
132 struct ecore_spq_comp_cb *p_comp_addr);
135 ecore_sp_fcoe_func_stop(struct ecore_hwfn *p_hwfn,
136 struct ecore_ptt *p_ptt,
137 enum spq_mode comp_mode,
138 struct ecore_spq_comp_cb *p_comp_addr);
141 ecore_fcoe_get_stats(struct ecore_hwfn *p_hwfn,
142 struct ecore_fcoe_stats *stats);