2 * Copyright (c) 2016 QLogic Corporation.
6 * See LICENSE.qede_pmd for copyright and licensing details.
10 #define __ECORE_VF_H__
12 #include "ecore_status.h"
13 #include "ecore_vf_api.h"
14 #include "ecore_l2_api.h"
15 #include "ecore_vfpf_if.h"
17 /* This data is held in the ecore_hwfn structure for VFs only. */
19 union vfpf_tlvs *vf2pf_request;
20 dma_addr_t vf2pf_request_phys;
21 union pfvf_tlvs *pf2vf_reply;
22 dma_addr_t pf2vf_reply_phys;
24 /* Should be taken whenever the mailbox buffers are accessed */
29 struct ecore_bulletin bulletin;
30 struct ecore_bulletin_content bulletin_shadow;
32 /* we set aside a copy of the acquire response */
33 struct pfvf_acquire_resp_tlv acquire_resp;
35 /* In case PF originates prior to the fp-hsi version comparison,
36 * this has to be propagated as it affects the fastpath.
41 #ifdef CONFIG_ECORE_SRIOV
43 * @brief hw preparation for VF
44 * sends ACQUIRE message
48 * @return enum _ecore_status_t
50 enum _ecore_status_t ecore_vf_hw_prepare(struct ecore_hwfn *p_hwfn);
53 * @brief VF - start the RX Queue by sending a message to the PF
56 * @param cid - zero based within the VF
57 * @param rx_queue_id - zero based within the VF
58 * @param sb - VF status block for this queue
59 * @param sb_index - Index within the status block
60 * @param bd_max_bytes - maximum number of bytes per bd
61 * @param bd_chain_phys_addr - physical address of bd chain
62 * @param cqe_pbl_addr - physical address of pbl
63 * @param cqe_pbl_size - pbl size
64 * @param pp_prod - pointer to the producer to be
67 * @return enum _ecore_status_t
69 enum _ecore_status_t ecore_vf_pf_rxq_start(struct ecore_hwfn *p_hwfn,
74 dma_addr_t bd_chain_phys_addr,
75 dma_addr_t cqe_pbl_addr,
77 void OSAL_IOMEM **pp_prod);
80 * @brief VF - start the TX queue by sending a message to the
84 * @param tx_queue_id - zero based within the VF
85 * @param sb - status block for this queue
86 * @param sb_index - index within the status block
87 * @param bd_chain_phys_addr - physical address of tx chain
88 * @param pp_doorbell - pointer to address to which to
89 * write the doorbell too..
91 * @return enum _ecore_status_t
93 enum _ecore_status_t ecore_vf_pf_txq_start(struct ecore_hwfn *p_hwfn,
99 void OSAL_IOMEM **pp_doorbell);
102 * @brief VF - stop the RX queue by sending a message to the PF
106 * @param cqe_completion
108 * @return enum _ecore_status_t
110 enum _ecore_status_t ecore_vf_pf_rxq_stop(struct ecore_hwfn *p_hwfn,
112 bool cqe_completion);
115 * @brief VF - stop the TX queue by sending a message to the PF
120 * @return enum _ecore_status_t
122 enum _ecore_status_t ecore_vf_pf_txq_stop(struct ecore_hwfn *p_hwfn,
127 * @brief VF - update the RX queue by sending a message to the
133 * @param init_sge_ring
134 * @param comp_cqe_flg
135 * @param comp_event_flg
137 * @return enum _ecore_status_t
139 enum _ecore_status_t ecore_vf_pf_rxqs_update(
140 struct ecore_hwfn *p_hwfn,
148 * @brief VF - send a vport update command
153 * @return enum _ecore_status_t
156 ecore_vf_pf_vport_update(struct ecore_hwfn *p_hwfn,
157 struct ecore_sp_vport_update_params *p_params);
160 * @brief VF - send a close message to PF
164 * @return enum _ecore_status
166 enum _ecore_status_t ecore_vf_pf_reset(struct ecore_hwfn *p_hwfn);
169 * @brief VF - free vf`s memories
173 * @return enum _ecore_status
175 enum _ecore_status_t ecore_vf_pf_release(struct ecore_hwfn *p_hwfn);
178 * @brief ecore_vf_get_igu_sb_id - Get the IGU SB ID for a given
179 * sb_id. For VFs igu sbs don't have to be contiguous
186 u16 ecore_vf_get_igu_sb_id(struct ecore_hwfn *p_hwfn,
191 * @brief ecore_vf_pf_vport_start - perform vport start for VF.
196 * @param inner_vlan_removal
198 * @param max_buffers_per_cqe,
199 * @param only_untagged - default behavior regarding vlan acceptance
201 * @return enum _ecore_status
203 enum _ecore_status_t ecore_vf_pf_vport_start(
204 struct ecore_hwfn *p_hwfn,
207 u8 inner_vlan_removal,
208 enum ecore_tpa_mode tpa_mode,
209 u8 max_buffers_per_cqe,
213 * @brief ecore_vf_pf_vport_stop - stop the VF's vport
217 * @return enum _ecore_status
219 enum _ecore_status_t ecore_vf_pf_vport_stop(struct ecore_hwfn *p_hwfn);
221 enum _ecore_status_t ecore_vf_pf_filter_ucast(
222 struct ecore_hwfn *p_hwfn,
223 struct ecore_filter_ucast *p_param);
225 void ecore_vf_pf_filter_mcast(struct ecore_hwfn *p_hwfn,
226 struct ecore_filter_mcast *p_filter_cmd);
229 * @brief ecore_vf_pf_int_cleanup - clean the SB of the VF
233 * @return enum _ecore_status
235 enum _ecore_status_t ecore_vf_pf_int_cleanup(struct ecore_hwfn *p_hwfn);
238 * @brief - return the link params in a given bulletin board
241 * @param p_params - pointer to a struct to fill with link params
244 void __ecore_vf_get_link_params(struct ecore_hwfn *p_hwfn,
245 struct ecore_mcp_link_params *p_params,
246 struct ecore_bulletin_content *p_bulletin);
249 * @brief - return the link state in a given bulletin board
252 * @param p_link - pointer to a struct to fill with link state
255 void __ecore_vf_get_link_state(struct ecore_hwfn *p_hwfn,
256 struct ecore_mcp_link_state *p_link,
257 struct ecore_bulletin_content *p_bulletin);
260 * @brief - return the link capabilities in a given bulletin board
263 * @param p_link - pointer to a struct to fill with link capabilities
266 void __ecore_vf_get_link_caps(struct ecore_hwfn *p_hwfn,
267 struct ecore_mcp_link_capabilities *p_link_caps,
268 struct ecore_bulletin_content *p_bulletin);
271 #endif /* __ECORE_VF_H__ */