1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright (c) 2016 - 2018 Cavium Inc.
7 #ifndef __ECORE_VF_API_H__
8 #define __ECORE_VF_API_H__
10 #include "ecore_sp_api.h"
11 #include "ecore_mcp_api.h"
13 #ifdef CONFIG_ECORE_SRIOV
15 * @brief Read the VF bulletin and act on it if needed
18 * @param p_change - ecore fills 1 iff bulletin board has changed, 0 otherwise.
20 * @return enum _ecore_status
22 enum _ecore_status_t ecore_vf_read_bulletin(struct ecore_hwfn *p_hwfn,
26 * @brief Get link parameters for VF from ecore
29 * @param params - the link params structure to be filled for the VF
31 void ecore_vf_get_link_params(struct ecore_hwfn *p_hwfn,
32 struct ecore_mcp_link_params *params);
35 * @brief Get link state for VF from ecore
38 * @param link - the link state structure to be filled for the VF
40 void ecore_vf_get_link_state(struct ecore_hwfn *p_hwfn,
41 struct ecore_mcp_link_state *link);
44 * @brief Get link capabilities for VF from ecore
47 * @param p_link_caps - the link capabilities structure to be filled for the VF
49 void ecore_vf_get_link_caps(struct ecore_hwfn *p_hwfn,
50 struct ecore_mcp_link_capabilities *p_link_caps);
53 * @brief Get number of Rx queues allocated for VF by ecore
56 * @param num_rxqs - allocated RX queues
58 void ecore_vf_get_num_rxqs(struct ecore_hwfn *p_hwfn,
62 * @brief Get number of Rx queues allocated for VF by ecore
65 * @param num_txqs - allocated RX queues
67 void ecore_vf_get_num_txqs(struct ecore_hwfn *p_hwfn,
71 * @brief Get port mac address for VF
74 * @param port_mac - destination location for port mac
76 void ecore_vf_get_port_mac(struct ecore_hwfn *p_hwfn,
80 * @brief Get number of VLAN filters allocated for VF by ecore
83 * @param num_rxqs - allocated VLAN filters
85 void ecore_vf_get_num_vlan_filters(struct ecore_hwfn *p_hwfn,
86 u8 *num_vlan_filters);
88 void ecore_vf_get_num_sbs(struct ecore_hwfn *p_hwfn,
92 * @brief Get number of MAC filters allocated for VF by ecore
95 * @param num_rxqs - allocated MAC filters
97 void ecore_vf_get_num_mac_filters(struct ecore_hwfn *p_hwfn,
98 u32 *num_mac_filters);
101 * @brief Check if VF can set a MAC address
108 bool ecore_vf_check_mac(struct ecore_hwfn *p_hwfn, u8 *mac);
112 * @brief Copy forced MAC address from bulletin board
116 * @param p_is_forced - out param which indicate in case mac
117 * exist if it forced or not.
119 * @return bool - return true if mac exist and false if
122 bool ecore_vf_bulletin_get_forced_mac(struct ecore_hwfn *hwfn, u8 *dst_mac,
126 * @brief Check if force vlan is set and copy the forced vlan
127 * from bulletin board
133 bool ecore_vf_bulletin_get_forced_vlan(struct ecore_hwfn *hwfn, u16 *dst_pvid);
136 * @brief Check if VF is based on PF whose driver is pre-fp-hsi version;
137 * This affects the fastpath implementation of the driver.
141 * @return bool - true iff PF is pre-fp-hsi version.
143 bool ecore_vf_get_pre_fp_hsi(struct ecore_hwfn *p_hwfn);
148 * @brief Set firmware version information in dev_info from VFs acquire
157 void ecore_vf_get_fw_version(struct ecore_hwfn *p_hwfn,
162 void ecore_vf_bulletin_get_udp_ports(struct ecore_hwfn *p_hwfn,
163 u16 *p_vxlan_port, u16 *p_geneve_port);
165 #ifdef CONFIG_ECORE_SW_CHANNEL
167 * @brief set the VF to use a SW/HW channel when communicating with PF.
168 * NOTICE: today the likely first place to call this from VF
169 * would be OSAL_VF_FILL_ACQUIRE_RESC_REQ(); Might want to consider
170 * something a bit more appropriate.
173 * @param b_is_hw - true iff VF is to use a HW-channel
175 void ecore_vf_set_hw_channel(struct ecore_hwfn *p_hwfn, bool b_is_hw);