2 * Copyright (c) 2016 QLogic Corporation.
6 * See LICENSE.qede_pmd for copyright and licensing details.
12 #include "ecore_hsi_common.h"
13 #include "ecore_proto_if.h"
14 #include "ecore_cxt_api.h"
16 /* Tasks segments definitions */
17 #define ECORE_CXT_ISCSI_TID_SEG PROTOCOLID_ISCSI /* 0 */
18 #define ECORE_CXT_FCOE_TID_SEG PROTOCOLID_FCOE /* 1 */
19 #define ECORE_CXT_ROCE_TID_SEG PROTOCOLID_ROCE /* 2 */
21 enum ecore_cxt_elem_type {
27 u32 ecore_cxt_get_proto_cid_count(struct ecore_hwfn *p_hwfn,
28 enum protocol_type type,
31 u32 ecore_cxt_get_proto_tid_count(struct ecore_hwfn *p_hwfn,
32 enum protocol_type type);
34 u32 ecore_cxt_get_proto_cid_start(struct ecore_hwfn *p_hwfn,
35 enum protocol_type type);
36 u32 ecore_cxt_get_srq_count(struct ecore_hwfn *p_hwfn);
39 * @brief ecore_cxt_set_pf_params - Set the PF params for cxt init
43 * @return enum _ecore_status_t
45 enum _ecore_status_t ecore_cxt_set_pf_params(struct ecore_hwfn *p_hwfn);
48 * @brief ecore_cxt_cfg_ilt_compute - compute ILT init parameters
52 * @return enum _ecore_status_t
54 enum _ecore_status_t ecore_cxt_cfg_ilt_compute(struct ecore_hwfn *p_hwfn);
57 * @brief ecore_cxt_mngr_alloc - Allocate and init the context manager struct
61 * @return enum _ecore_status_t
63 enum _ecore_status_t ecore_cxt_mngr_alloc(struct ecore_hwfn *p_hwfn);
66 * @brief ecore_cxt_mngr_free
70 void ecore_cxt_mngr_free(struct ecore_hwfn *p_hwfn);
73 * @brief ecore_cxt_tables_alloc - Allocate ILT shadow, Searcher T2, acquired
78 * @return enum _ecore_status_t
80 enum _ecore_status_t ecore_cxt_tables_alloc(struct ecore_hwfn *p_hwfn);
83 * @brief ecore_cxt_mngr_setup - Reset the acquired CIDs
87 void ecore_cxt_mngr_setup(struct ecore_hwfn *p_hwfn);
90 * @brief ecore_cxt_hw_init_common - Initailze ILT and DQ, common phase, per
95 void ecore_cxt_hw_init_common(struct ecore_hwfn *p_hwfn);
98 * @brief ecore_cxt_hw_init_pf - Initailze ILT and DQ, PF phase, per path.
103 void ecore_cxt_hw_init_pf(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt);
106 * @brief ecore_qm_init_pf - Initailze the QM PF phase, per path
111 void ecore_qm_init_pf(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt);
114 * @brief Reconfigures QM pf on the fly
119 * @return enum _ecore_status_t
121 enum _ecore_status_t ecore_qm_reconf(struct ecore_hwfn *p_hwfn,
122 struct ecore_ptt *p_ptt);
124 #define ECORE_CXT_PF_CID (0xff)
127 * @brief ecore_cxt_release - Release a cid
132 void ecore_cxt_release_cid(struct ecore_hwfn *p_hwfn, u32 cid);
135 * @brief ecore_cxt_release - Release a cid belonging to a vf-queue
139 * @param vfid - engine relative index. ECORE_CXT_PF_CID if belongs to PF
141 void _ecore_cxt_release_cid(struct ecore_hwfn *p_hwfn,
145 * @brief ecore_cxt_acquire - Acquire a new cid of a specific protocol type
151 * @return enum _ecore_status_t
153 enum _ecore_status_t ecore_cxt_acquire_cid(struct ecore_hwfn *p_hwfn,
154 enum protocol_type type,
158 * @brief _ecore_cxt_acquire - Acquire a new cid of a specific protocol type
164 * @param vfid - engine relative index. ECORE_CXT_PF_CID if belongs to PF
166 * @return enum _ecore_status_t
168 enum _ecore_status_t _ecore_cxt_acquire_cid(struct ecore_hwfn *p_hwfn,
169 enum protocol_type type,
170 u32 *p_cid, u8 vfid);
173 * @brief ecore_cxt_get_tid_mem_info - function checks if the
174 * page containing the iid in the ilt is already
175 * allocated, if it is not it allocates the page.
181 * @return enum _ecore_status_t
184 ecore_cxt_dynamic_ilt_alloc(struct ecore_hwfn *p_hwfn,
185 enum ecore_cxt_elem_type elem_type,
189 * @brief ecore_cxt_free_proto_ilt - function frees ilt pages
190 * associated with the protocol passed.
195 * @return enum _ecore_status_t
197 enum _ecore_status_t ecore_cxt_free_proto_ilt(struct ecore_hwfn *p_hwfn,
198 enum protocol_type proto);
200 #define ECORE_CTX_WORKING_MEM 0
201 #define ECORE_CTX_FL_MEM 1
203 #endif /* _ECORE_CID_ */