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);
40 * @brief ecore_cxt_qm_iids - fills the cid/tid counts for the QM configuration
43 * @param iids [out], a structure holding all the counters
45 void ecore_cxt_qm_iids(struct ecore_hwfn *p_hwfn,
46 struct ecore_qm_iids *iids);
50 * @brief ecore_cxt_set_pf_params - Set the PF params for cxt init
54 * @return enum _ecore_status_t
56 enum _ecore_status_t ecore_cxt_set_pf_params(struct ecore_hwfn *p_hwfn);
59 * @brief ecore_cxt_cfg_ilt_compute - compute ILT init parameters
63 * @return enum _ecore_status_t
65 enum _ecore_status_t ecore_cxt_cfg_ilt_compute(struct ecore_hwfn *p_hwfn);
68 * @brief ecore_cxt_mngr_alloc - Allocate and init the context manager struct
72 * @return enum _ecore_status_t
74 enum _ecore_status_t ecore_cxt_mngr_alloc(struct ecore_hwfn *p_hwfn);
77 * @brief ecore_cxt_mngr_free
81 void ecore_cxt_mngr_free(struct ecore_hwfn *p_hwfn);
84 * @brief ecore_cxt_tables_alloc - Allocate ILT shadow, Searcher T2, acquired
89 * @return enum _ecore_status_t
91 enum _ecore_status_t ecore_cxt_tables_alloc(struct ecore_hwfn *p_hwfn);
94 * @brief ecore_cxt_mngr_setup - Reset the acquired CIDs
98 void ecore_cxt_mngr_setup(struct ecore_hwfn *p_hwfn);
101 * @brief ecore_cxt_hw_init_common - Initailze ILT and DQ, common phase, per
106 void ecore_cxt_hw_init_common(struct ecore_hwfn *p_hwfn);
109 * @brief ecore_cxt_hw_init_pf - Initailze ILT and DQ, PF phase, per path.
113 void ecore_cxt_hw_init_pf(struct ecore_hwfn *p_hwfn);
116 * @brief ecore_qm_init_pf - Initailze the QM PF phase, per path
120 void ecore_qm_init_pf(struct ecore_hwfn *p_hwfn);
123 * @brief Reconfigures QM pf on the fly
128 * @return enum _ecore_status_t
130 enum _ecore_status_t ecore_qm_reconf(struct ecore_hwfn *p_hwfn,
131 struct ecore_ptt *p_ptt);
134 * @brief ecore_cxt_release - Release a cid
139 void ecore_cxt_release_cid(struct ecore_hwfn *p_hwfn,
143 * @brief ecore_cxt_get_tid_mem_info - function checks if the
144 * page containing the iid in the ilt is already
145 * allocated, if it is not it allocates the page.
151 * @return enum _ecore_status_t
154 ecore_cxt_dynamic_ilt_alloc(struct ecore_hwfn *p_hwfn,
155 enum ecore_cxt_elem_type elem_type,
159 * @brief ecore_cxt_free_proto_ilt - function frees ilt pages
160 * associated with the protocol passed.
165 * @return enum _ecore_status_t
167 enum _ecore_status_t ecore_cxt_free_proto_ilt(struct ecore_hwfn *p_hwfn,
168 enum protocol_type proto);
170 #define ECORE_CTX_WORKING_MEM 0
171 #define ECORE_CTX_FL_MEM 1
172 enum _ecore_status_t ecore_cxt_get_task_ctx(struct ecore_hwfn *p_hwfn,
177 #endif /* _ECORE_CID_ */