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 enum ecore_cxt_elem_type {
21 u32 ecore_cxt_get_proto_cid_count(struct ecore_hwfn *p_hwfn,
22 enum protocol_type type, u32 *vf_cid);
24 u32 ecore_cxt_get_proto_cid_start(struct ecore_hwfn *p_hwfn,
25 enum protocol_type type);
28 * @brief ecore_cxt_qm_iids - fills the cid/tid counts for the QM configuration
31 * @param iids [out], a structure holding all the counters
33 void ecore_cxt_qm_iids(struct ecore_hwfn *p_hwfn, struct ecore_qm_iids *iids);
36 * @brief ecore_cxt_set_pf_params - Set the PF params for cxt init
40 * @return enum _ecore_status_t
42 enum _ecore_status_t ecore_cxt_set_pf_params(struct ecore_hwfn *p_hwfn);
45 * @brief ecore_cxt_set_proto_cid_count - Set the max cids per protocol for cxt
50 * @param cid_cnt - number of pf cids
51 * @param vf_cid_cnt - number of vf cids
53 void ecore_cxt_set_proto_cid_count(struct ecore_hwfn *p_hwfn,
54 enum protocol_type type,
55 u32 cid_cnt, u32 vf_cid_cnt);
57 * @brief ecore_cxt_cfg_ilt_compute - compute ILT init parameters
61 * @return enum _ecore_status_t
63 enum _ecore_status_t ecore_cxt_cfg_ilt_compute(struct ecore_hwfn *p_hwfn);
66 * @brief ecore_cxt_mngr_alloc - Allocate and init the context manager struct
70 * @return enum _ecore_status_t
72 enum _ecore_status_t ecore_cxt_mngr_alloc(struct ecore_hwfn *p_hwfn);
75 * @brief ecore_cxt_mngr_free
79 void ecore_cxt_mngr_free(struct ecore_hwfn *p_hwfn);
82 * @brief ecore_cxt_tables_alloc - Allocate ILT shadow, Searcher T2, acquired
87 * @return enum _ecore_status_t
89 enum _ecore_status_t ecore_cxt_tables_alloc(struct ecore_hwfn *p_hwfn);
92 * @brief ecore_cxt_mngr_setup - Reset the acquired CIDs
96 void ecore_cxt_mngr_setup(struct ecore_hwfn *p_hwfn);
99 * @brief ecore_cxt_hw_init_common - Initailze ILT and DQ, common phase, per
104 void ecore_cxt_hw_init_common(struct ecore_hwfn *p_hwfn);
107 * @brief ecore_cxt_hw_init_pf - Initailze ILT and DQ, PF phase, per path.
111 void ecore_cxt_hw_init_pf(struct ecore_hwfn *p_hwfn);
114 * @brief ecore_qm_init_pf - Initailze the QM PF phase, per path
118 void ecore_qm_init_pf(struct ecore_hwfn *p_hwfn);
121 * @brief Reconfigures QM pf on the fly
126 * @return enum _ecore_status_t
128 enum _ecore_status_t ecore_qm_reconf(struct ecore_hwfn *p_hwfn,
129 struct ecore_ptt *p_ptt);
132 * @brief ecore_cxt_release - Release a cid
137 void ecore_cxt_release_cid(struct ecore_hwfn *p_hwfn, u32 cid);
140 * @brief ecore_cxt_free_proto_ilt - function frees ilt pages
141 * associated with the protocol passed.
146 * @return enum _ecore_status_t
148 enum _ecore_status_t ecore_cxt_free_proto_ilt(struct ecore_hwfn *p_hwfn,
149 enum protocol_type proto);
151 #define ECORE_CTX_WORKING_MEM 0
152 #define ECORE_CTX_FL_MEM 1
153 enum _ecore_status_t ecore_cxt_get_task_ctx(struct ecore_hwfn *p_hwfn,
155 u8 ctx_type, void **task_ctx);
157 #endif /* _ECORE_CID_ */