2 * Copyright (c) 2016 QLogic Corporation.
6 * See LICENSE.qede_pmd for copyright and licensing details.
9 #ifndef __ECORE_VF_API_H__
10 #define __ECORE_VF_API_H__
12 #include "ecore_sp_api.h"
13 #include "ecore_mcp_api.h"
15 #ifdef CONFIG_ECORE_SRIOV
17 * @brief Read the VF bulletin and act on it if needed
20 * @param p_change - ecore fills 1 iff bulletin board has changed, 0 otherwise.
22 * @return enum _ecore_status
24 enum _ecore_status_t ecore_vf_read_bulletin(struct ecore_hwfn *p_hwfn,
28 * @brief Get link parameters for VF from ecore
31 * @param params - the link params structure to be filled for the VF
33 void ecore_vf_get_link_params(struct ecore_hwfn *p_hwfn,
34 struct ecore_mcp_link_params *params);
37 * @brief Get link state for VF from ecore
40 * @param link - the link state structure to be filled for the VF
42 void ecore_vf_get_link_state(struct ecore_hwfn *p_hwfn,
43 struct ecore_mcp_link_state *link);
46 * @brief Get link capabilities for VF from ecore
49 * @param p_link_caps - the link capabilities structure to be filled for the VF
51 void ecore_vf_get_link_caps(struct ecore_hwfn *p_hwfn,
52 struct ecore_mcp_link_capabilities *p_link_caps);
55 * @brief Get number of Rx queues allocated for VF by ecore
58 * @param num_rxqs - allocated RX queues
60 void ecore_vf_get_num_rxqs(struct ecore_hwfn *p_hwfn,
64 * @brief Get number of Rx queues allocated for VF by ecore
67 * @param num_txqs - allocated RX queues
69 void ecore_vf_get_num_txqs(struct ecore_hwfn *p_hwfn,
73 * @brief Get port mac address for VF
76 * @param port_mac - destination location for port mac
78 void ecore_vf_get_port_mac(struct ecore_hwfn *p_hwfn,
82 * @brief Get number of VLAN filters allocated for VF by ecore
85 * @param num_rxqs - allocated VLAN filters
87 void ecore_vf_get_num_vlan_filters(struct ecore_hwfn *p_hwfn,
88 u8 *num_vlan_filters);
90 void ecore_vf_get_num_sbs(struct ecore_hwfn *p_hwfn,
94 * @brief Get number of MAC filters allocated for VF by ecore
97 * @param num_rxqs - allocated MAC filters
99 void ecore_vf_get_num_mac_filters(struct ecore_hwfn *p_hwfn,
100 u32 *num_mac_filters);
103 * @brief Check if VF can set a MAC address
110 bool ecore_vf_check_mac(struct ecore_hwfn *p_hwfn, u8 *mac);
114 * @brief Copy forced MAC address from bulletin board
118 * @param p_is_forced - out param which indicate in case mac
119 * exist if it forced or not.
121 * @return bool - return true if mac exist and false if
124 bool ecore_vf_bulletin_get_forced_mac(struct ecore_hwfn *hwfn, u8 *dst_mac,
128 * @brief Check if force vlan is set and copy the forced vlan
129 * from bulletin board
135 bool ecore_vf_bulletin_get_forced_vlan(struct ecore_hwfn *hwfn, u16 *dst_pvid);
138 * @brief Check if VF is based on PF whose driver is pre-fp-hsi version;
139 * This affects the fastpath implementation of the driver.
143 * @return bool - true iff PF is pre-fp-hsi version.
145 bool ecore_vf_get_pre_fp_hsi(struct ecore_hwfn *p_hwfn);
150 * @brief Set firmware version information in dev_info from VFs acquire
159 void ecore_vf_get_fw_version(struct ecore_hwfn *p_hwfn,
164 void ecore_vf_bulletin_get_udp_ports(struct ecore_hwfn *p_hwfn,
165 u16 *p_vxlan_port, u16 *p_geneve_port);