2 * Copyright (c) 2016 QLogic Corporation.
6 * See LICENSE.qede_pmd for copyright and licensing details.
9 #ifndef __ECORE_SP_COMMANDS_H__
10 #define __ECORE_SP_COMMANDS_H__
13 #include "ecore_spq.h"
14 #include "ecore_sp_api.h"
16 #define ECORE_SP_EQ_COMPLETION 0x01
17 #define ECORE_SP_CQE_COMPLETION 0x02
19 struct ecore_sp_init_data
{
20 /* The CID and FID aren't necessarily derived from hwfn,
21 * e.g., in IOV scenarios. CID might defer between SPQ and
27 /* Information regarding operation upon sending & completion */
28 enum spq_mode comp_mode
;
29 struct ecore_spq_comp_cb
*p_comp_data
;
34 * @brief Acquire and initialize and SPQ entry for a given ramrod.
37 * @param pp_ent - will be filled with a pointer to an entry upon success
38 * @param cmd - dependent upon protocol
40 * @param p_data - various configuration required for ramrod
42 * @return ECORE_SUCCESS upon success, otherwise failure.
44 enum _ecore_status_t
ecore_sp_init_request(struct ecore_hwfn
*p_hwfn
,
45 struct ecore_spq_entry
**pp_ent
,
48 struct ecore_sp_init_data
*p_data
);
51 * @brief ecore_sp_pf_start - PF Function Start Ramrod
53 * This ramrod is sent to initialize a physical function (PF). It will
54 * configure the function related parameters and write its completion to the
55 * event ring specified in the parameters.
57 * Ramrods complete on the common event ring for the PF. This ring is
58 * allocated by the driver on host memory and its parameters are written
59 * to the internal RAM of the UStorm by the Function Start Ramrod.
62 * @param p_tunn - pf start tunneling configuration
64 * @param allow_npar_tx_switch - npar tx switching to be used
65 * for vports configured for tx-switching.
67 * @return enum _ecore_status_t
70 enum _ecore_status_t
ecore_sp_pf_start(struct ecore_hwfn
*p_hwfn
,
71 struct ecore_tunn_start_params
*p_tunn
,
72 enum ecore_mf_mode mode
,
73 bool allow_npar_tx_switch
);
76 * @brief ecore_sp_pf_update_tunn_cfg - PF Function Tunnel configuration
79 * This ramrod is sent to update a tunneling configuration
80 * for a physical function (PF).
83 * @param p_tunn - pf update tunneling parameters
84 * @param comp_mode - completion mode
85 * @param p_comp_data - callback function
87 * @return enum _ecore_status_t
91 ecore_sp_pf_update_tunn_cfg(struct ecore_hwfn
*p_hwfn
,
92 struct ecore_tunn_update_params
*p_tunn
,
93 enum spq_mode comp_mode
,
94 struct ecore_spq_comp_cb
*p_comp_data
);
97 * @brief ecore_sp_pf_update - PF Function Update Ramrod
99 * This ramrod updates function-related parameters. Every parameter can be
100 * updated independently, according to configuration flags.
102 * @note Final phase API.
106 * @return enum _ecore_status_t
109 enum _ecore_status_t
ecore_sp_pf_update(struct ecore_hwfn
*p_hwfn
);
112 * @brief ecore_sp_pf_stop - PF Function Stop Ramrod
114 * This ramrod is sent to close a Physical Function (PF). It is the last ramrod
115 * sent and the last completion written to the PFs Event Ring. This ramrod also
116 * deletes the context for the Slowhwfn connection on this PF.
118 * @note Not required for first packet.
122 * @return enum _ecore_status_t
125 enum _ecore_status_t
ecore_sp_pf_stop(struct ecore_hwfn
*p_hwfn
);
128 * @brief ecore_sp_heartbeat_ramrod - Send empty Ramrod
132 * @return enum _ecore_status_t
135 enum _ecore_status_t
ecore_sp_heartbeat_ramrod(struct ecore_hwfn
*p_hwfn
);
137 struct ecore_rl_update_params
{
138 u8 qcn_update_param_flg
;
139 u8 dcqcn_update_param_flg
;
145 u8 rl_dc_qcn_flg
; /* If set, RL will used for DCQCN */
146 u32 rl_bc_rate
; /* Byte Counter Limit */
147 u16 rl_max_rate
; /* Maximum rate in 1.6 Mbps resolution */
148 u16 rl_r_ai
; /* Active increase rate */
149 u16 rl_r_hai
; /* Hyper active increase rate */
150 u16 dcqcn_g
; /* DCQCN Alpha update gain in 1/64K resolution */
151 u32 dcqcn_k_us
; /* DCQCN Alpha update interval */
152 u32 dcqcn_timeuot_us
;
157 * @brief ecore_sp_rl_update - Update rate limiters
162 * @return enum _ecore_status_t
164 enum _ecore_status_t
ecore_sp_rl_update(struct ecore_hwfn
*p_hwfn
,
165 struct ecore_rl_update_params
*params
);
167 #endif /*__ECORE_SP_COMMANDS_H__*/