18c2ecf20Sopenharmony_ci/* bnx2x_sriov.h: QLogic Everest network driver.
28c2ecf20Sopenharmony_ci *
38c2ecf20Sopenharmony_ci * Copyright 2009-2013 Broadcom Corporation
48c2ecf20Sopenharmony_ci * Copyright 2014 QLogic Corporation
58c2ecf20Sopenharmony_ci * All rights reserved
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Unless you and QLogic execute a separate written software license
88c2ecf20Sopenharmony_ci * agreement governing use of this software, this software is licensed to you
98c2ecf20Sopenharmony_ci * under the terms of the GNU General Public License version 2, available
108c2ecf20Sopenharmony_ci * at http://www.gnu.org/licenses/old-licenses/gpl-2.0.html (the "GPL").
118c2ecf20Sopenharmony_ci *
128c2ecf20Sopenharmony_ci * Notwithstanding the above, under no circumstances may you combine this
138c2ecf20Sopenharmony_ci * software in any way with any other QLogic software provided under a
148c2ecf20Sopenharmony_ci * license other than the GPL, without QLogic's express prior written
158c2ecf20Sopenharmony_ci * consent.
168c2ecf20Sopenharmony_ci *
178c2ecf20Sopenharmony_ci * Maintained by: Ariel Elior <ariel.elior@qlogic.com>
188c2ecf20Sopenharmony_ci * Written by: Shmulik Ravid
198c2ecf20Sopenharmony_ci *	       Ariel Elior <ariel.elior@qlogic.com>
208c2ecf20Sopenharmony_ci */
218c2ecf20Sopenharmony_ci#ifndef BNX2X_SRIOV_H
228c2ecf20Sopenharmony_ci#define BNX2X_SRIOV_H
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci#include "bnx2x_vfpf.h"
258c2ecf20Sopenharmony_ci#include "bnx2x.h"
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_cienum sample_bulletin_result {
288c2ecf20Sopenharmony_ci	   PFVF_BULLETIN_UNCHANGED,
298c2ecf20Sopenharmony_ci	   PFVF_BULLETIN_UPDATED,
308c2ecf20Sopenharmony_ci	   PFVF_BULLETIN_CRC_ERR
318c2ecf20Sopenharmony_ci};
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci#ifdef CONFIG_BNX2X_SRIOV
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ciextern struct workqueue_struct *bnx2x_iov_wq;
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci/* The bnx2x device structure holds vfdb structure described below.
388c2ecf20Sopenharmony_ci * The VF array is indexed by the relative vfid.
398c2ecf20Sopenharmony_ci */
408c2ecf20Sopenharmony_ci#define BNX2X_VF_MAX_QUEUES		16
418c2ecf20Sopenharmony_ci#define BNX2X_VF_MAX_TPA_AGG_QUEUES	8
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_cistruct bnx2x_sriov {
448c2ecf20Sopenharmony_ci	u32 first_vf_in_pf;
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci	/* standard SRIOV capability fields, mostly for debugging */
478c2ecf20Sopenharmony_ci	int pos;		/* capability position */
488c2ecf20Sopenharmony_ci	int nres;		/* number of resources */
498c2ecf20Sopenharmony_ci	u32 cap;		/* SR-IOV Capabilities */
508c2ecf20Sopenharmony_ci	u16 ctrl;		/* SR-IOV Control */
518c2ecf20Sopenharmony_ci	u16 total;		/* total VFs associated with the PF */
528c2ecf20Sopenharmony_ci	u16 initial;		/* initial VFs associated with the PF */
538c2ecf20Sopenharmony_ci	u16 nr_virtfn;		/* number of VFs available */
548c2ecf20Sopenharmony_ci	u16 offset;		/* first VF Routing ID offset */
558c2ecf20Sopenharmony_ci	u16 stride;		/* following VF stride */
568c2ecf20Sopenharmony_ci	u32 pgsz;		/* page size for BAR alignment */
578c2ecf20Sopenharmony_ci	u8 link;		/* Function Dependency Link */
588c2ecf20Sopenharmony_ci};
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci/* bars */
618c2ecf20Sopenharmony_cistruct bnx2x_vf_bar {
628c2ecf20Sopenharmony_ci	u64 bar;
638c2ecf20Sopenharmony_ci	u32 size;
648c2ecf20Sopenharmony_ci};
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_cistruct bnx2x_vf_bar_info {
678c2ecf20Sopenharmony_ci	struct bnx2x_vf_bar bars[PCI_SRIOV_NUM_BARS];
688c2ecf20Sopenharmony_ci	u8 nr_bars;
698c2ecf20Sopenharmony_ci};
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci/* vf queue (used both for rx or tx) */
728c2ecf20Sopenharmony_cistruct bnx2x_vf_queue {
738c2ecf20Sopenharmony_ci	struct eth_context		*cxt;
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci	/* MACs object */
768c2ecf20Sopenharmony_ci	struct bnx2x_vlan_mac_obj	mac_obj;
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ci	/* VLANs object */
798c2ecf20Sopenharmony_ci	struct bnx2x_vlan_mac_obj	vlan_obj;
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci	/* VLAN-MACs object */
828c2ecf20Sopenharmony_ci	struct bnx2x_vlan_mac_obj	vlan_mac_obj;
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ci	unsigned long accept_flags;	/* last accept flags configured */
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci	/* Queue Slow-path State object */
878c2ecf20Sopenharmony_ci	struct bnx2x_queue_sp_obj	sp_obj;
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci	u32 cid;
908c2ecf20Sopenharmony_ci	u16 index;
918c2ecf20Sopenharmony_ci	u16 sb_idx;
928c2ecf20Sopenharmony_ci	bool is_leading;
938c2ecf20Sopenharmony_ci	bool sp_initialized;
948c2ecf20Sopenharmony_ci};
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci/* struct bnx2x_vf_queue_construct_params - prepare queue construction
978c2ecf20Sopenharmony_ci * parameters: q-init, q-setup and SB index
988c2ecf20Sopenharmony_ci */
998c2ecf20Sopenharmony_cistruct bnx2x_vf_queue_construct_params {
1008c2ecf20Sopenharmony_ci	struct bnx2x_queue_state_params		qstate;
1018c2ecf20Sopenharmony_ci	struct bnx2x_queue_setup_params		prep_qsetup;
1028c2ecf20Sopenharmony_ci};
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci/* forward */
1058c2ecf20Sopenharmony_cistruct bnx2x_virtf;
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_ci/* VFOP definitions */
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_cistruct bnx2x_vf_mac_vlan_filter {
1108c2ecf20Sopenharmony_ci	int type;
1118c2ecf20Sopenharmony_ci#define BNX2X_VF_FILTER_MAC	BIT(0)
1128c2ecf20Sopenharmony_ci#define BNX2X_VF_FILTER_VLAN	BIT(1)
1138c2ecf20Sopenharmony_ci#define BNX2X_VF_FILTER_VLAN_MAC \
1148c2ecf20Sopenharmony_ci	(BNX2X_VF_FILTER_MAC | BNX2X_VF_FILTER_VLAN) /*shortcut*/
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci	bool add;
1178c2ecf20Sopenharmony_ci	bool applied;
1188c2ecf20Sopenharmony_ci	u8 *mac;
1198c2ecf20Sopenharmony_ci	u16 vid;
1208c2ecf20Sopenharmony_ci};
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_cistruct bnx2x_vf_mac_vlan_filters {
1238c2ecf20Sopenharmony_ci	int count;
1248c2ecf20Sopenharmony_ci	struct bnx2x_vf_mac_vlan_filter filters[];
1258c2ecf20Sopenharmony_ci};
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ci/* vf context */
1288c2ecf20Sopenharmony_cistruct bnx2x_virtf {
1298c2ecf20Sopenharmony_ci	u16 cfg_flags;
1308c2ecf20Sopenharmony_ci#define VF_CFG_STATS_COALESCE	0x1
1318c2ecf20Sopenharmony_ci#define VF_CFG_EXT_BULLETIN	0x2
1328c2ecf20Sopenharmony_ci#define VF_CFG_VLAN_FILTER	0x4
1338c2ecf20Sopenharmony_ci	u8 link_cfg;		/* IFLA_VF_LINK_STATE_AUTO
1348c2ecf20Sopenharmony_ci				 * IFLA_VF_LINK_STATE_ENABLE
1358c2ecf20Sopenharmony_ci				 * IFLA_VF_LINK_STATE_DISABLE
1368c2ecf20Sopenharmony_ci				 */
1378c2ecf20Sopenharmony_ci	u8 state;
1388c2ecf20Sopenharmony_ci#define VF_FREE		0	/* VF ready to be acquired holds no resc */
1398c2ecf20Sopenharmony_ci#define VF_ACQUIRED	1	/* VF acquired, but not initialized */
1408c2ecf20Sopenharmony_ci#define VF_ENABLED	2	/* VF Enabled */
1418c2ecf20Sopenharmony_ci#define VF_RESET	3	/* VF FLR'd, pending cleanup */
1428c2ecf20Sopenharmony_ci#define VF_LOST		4	/* Recovery while VFs are loaded */
1438c2ecf20Sopenharmony_ci
1448c2ecf20Sopenharmony_ci	bool flr_clnup_stage;	/* true during flr cleanup */
1458c2ecf20Sopenharmony_ci	bool malicious;		/* true if FW indicated so, until FLR */
1468c2ecf20Sopenharmony_ci	/* 1(true) if spoof check is enabled */
1478c2ecf20Sopenharmony_ci	u8 spoofchk;
1488c2ecf20Sopenharmony_ci
1498c2ecf20Sopenharmony_ci	/* dma */
1508c2ecf20Sopenharmony_ci	dma_addr_t fw_stat_map;
1518c2ecf20Sopenharmony_ci	u16 stats_stride;
1528c2ecf20Sopenharmony_ci	dma_addr_t bulletin_map;
1538c2ecf20Sopenharmony_ci
1548c2ecf20Sopenharmony_ci	/* Allocated resources counters. Before the VF is acquired, the
1558c2ecf20Sopenharmony_ci	 * counters hold the following values:
1568c2ecf20Sopenharmony_ci	 *
1578c2ecf20Sopenharmony_ci	 * - xxq_count = 0 as the queues memory is not allocated yet.
1588c2ecf20Sopenharmony_ci	 *
1598c2ecf20Sopenharmony_ci	 * - sb_count  = The number of status blocks configured for this VF in
1608c2ecf20Sopenharmony_ci	 *		 the IGU CAM. Initially read during probe.
1618c2ecf20Sopenharmony_ci	 *
1628c2ecf20Sopenharmony_ci	 * - xx_rules_count = The number of rules statically and equally
1638c2ecf20Sopenharmony_ci	 *		      allocated for each VF, during PF load.
1648c2ecf20Sopenharmony_ci	 */
1658c2ecf20Sopenharmony_ci	struct vf_pf_resc_request	alloc_resc;
1668c2ecf20Sopenharmony_ci#define vf_rxq_count(vf)		((vf)->alloc_resc.num_rxqs)
1678c2ecf20Sopenharmony_ci#define vf_txq_count(vf)		((vf)->alloc_resc.num_txqs)
1688c2ecf20Sopenharmony_ci#define vf_sb_count(vf)			((vf)->alloc_resc.num_sbs)
1698c2ecf20Sopenharmony_ci#define vf_mac_rules_cnt(vf)		((vf)->alloc_resc.num_mac_filters)
1708c2ecf20Sopenharmony_ci#define vf_vlan_rules_cnt(vf)		((vf)->alloc_resc.num_vlan_filters)
1718c2ecf20Sopenharmony_ci#define vf_mc_rules_cnt(vf)		((vf)->alloc_resc.num_mc_filters)
1728c2ecf20Sopenharmony_ci
1738c2ecf20Sopenharmony_ci	u8 sb_count;	/* actual number of SBs */
1748c2ecf20Sopenharmony_ci	u8 igu_base_id;	/* base igu status block id */
1758c2ecf20Sopenharmony_ci
1768c2ecf20Sopenharmony_ci	struct bnx2x_vf_queue	*vfqs;
1778c2ecf20Sopenharmony_ci#define LEADING_IDX			0
1788c2ecf20Sopenharmony_ci#define bnx2x_vfq_is_leading(vfq)	((vfq)->index == LEADING_IDX)
1798c2ecf20Sopenharmony_ci#define bnx2x_vfq(vf, nr, var)		((vf)->vfqs[(nr)].var)
1808c2ecf20Sopenharmony_ci#define bnx2x_leading_vfq(vf, var)	((vf)->vfqs[LEADING_IDX].var)
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_ci	u8 index;	/* index in the vf array */
1838c2ecf20Sopenharmony_ci	u8 abs_vfid;
1848c2ecf20Sopenharmony_ci	u8 sp_cl_id;
1858c2ecf20Sopenharmony_ci	u32 error;	/* 0 means all's-well */
1868c2ecf20Sopenharmony_ci
1878c2ecf20Sopenharmony_ci	/* BDF */
1888c2ecf20Sopenharmony_ci	unsigned int domain;
1898c2ecf20Sopenharmony_ci	unsigned int bus;
1908c2ecf20Sopenharmony_ci	unsigned int devfn;
1918c2ecf20Sopenharmony_ci
1928c2ecf20Sopenharmony_ci	/* bars */
1938c2ecf20Sopenharmony_ci	struct bnx2x_vf_bar bars[PCI_SRIOV_NUM_BARS];
1948c2ecf20Sopenharmony_ci
1958c2ecf20Sopenharmony_ci	/* set-mac ramrod state 1-pending, 0-done */
1968c2ecf20Sopenharmony_ci	unsigned long	filter_state;
1978c2ecf20Sopenharmony_ci
1988c2ecf20Sopenharmony_ci	/* leading rss client id ~~ the client id of the first rxq, must be
1998c2ecf20Sopenharmony_ci	 * set for each txq.
2008c2ecf20Sopenharmony_ci	 */
2018c2ecf20Sopenharmony_ci	int leading_rss;
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_ci	/* MCAST object */
2048c2ecf20Sopenharmony_ci	struct bnx2x_mcast_obj		mcast_obj;
2058c2ecf20Sopenharmony_ci
2068c2ecf20Sopenharmony_ci	/* RSS configuration object */
2078c2ecf20Sopenharmony_ci	struct bnx2x_rss_config_obj     rss_conf_obj;
2088c2ecf20Sopenharmony_ci
2098c2ecf20Sopenharmony_ci	/* slow-path operations */
2108c2ecf20Sopenharmony_ci	struct mutex			op_mutex; /* one vfop at a time mutex */
2118c2ecf20Sopenharmony_ci	enum channel_tlvs		op_current;
2128c2ecf20Sopenharmony_ci
2138c2ecf20Sopenharmony_ci	u8 fp_hsi;
2148c2ecf20Sopenharmony_ci
2158c2ecf20Sopenharmony_ci	struct bnx2x_credit_pool_obj	vf_vlans_pool;
2168c2ecf20Sopenharmony_ci	struct bnx2x_credit_pool_obj	vf_macs_pool;
2178c2ecf20Sopenharmony_ci};
2188c2ecf20Sopenharmony_ci
2198c2ecf20Sopenharmony_ci#define BNX2X_NR_VIRTFN(bp)	((bp)->vfdb->sriov.nr_virtfn)
2208c2ecf20Sopenharmony_ci
2218c2ecf20Sopenharmony_ci#define for_each_vf(bp, var) \
2228c2ecf20Sopenharmony_ci		for ((var) = 0; (var) < BNX2X_NR_VIRTFN(bp); (var)++)
2238c2ecf20Sopenharmony_ci
2248c2ecf20Sopenharmony_ci#define for_each_vfq(vf, var) \
2258c2ecf20Sopenharmony_ci		for ((var) = 0; (var) < vf_rxq_count(vf); (var)++)
2268c2ecf20Sopenharmony_ci
2278c2ecf20Sopenharmony_ci#define for_each_vf_sb(vf, var) \
2288c2ecf20Sopenharmony_ci		for ((var) = 0; (var) < vf_sb_count(vf); (var)++)
2298c2ecf20Sopenharmony_ci
2308c2ecf20Sopenharmony_ci#define is_vf_multi(vf)	(vf_rxq_count(vf) > 1)
2318c2ecf20Sopenharmony_ci
2328c2ecf20Sopenharmony_ci#define HW_VF_HANDLE(bp, abs_vfid) \
2338c2ecf20Sopenharmony_ci	(u16)(BP_ABS_FUNC((bp)) | (1<<3) |  ((u16)(abs_vfid) << 4))
2348c2ecf20Sopenharmony_ci
2358c2ecf20Sopenharmony_ci#define FW_PF_MAX_HANDLE	8
2368c2ecf20Sopenharmony_ci
2378c2ecf20Sopenharmony_ci#define FW_VF_HANDLE(abs_vfid)	\
2388c2ecf20Sopenharmony_ci	(abs_vfid + FW_PF_MAX_HANDLE)
2398c2ecf20Sopenharmony_ci
2408c2ecf20Sopenharmony_ci#define GET_NUM_VFS_PER_PATH(bp)	64 /* use max possible value */
2418c2ecf20Sopenharmony_ci#define GET_NUM_VFS_PER_PF(bp)		((bp)->vfdb ? (bp)->vfdb->sriov.total \
2428c2ecf20Sopenharmony_ci						    : 0)
2438c2ecf20Sopenharmony_ci#define VF_MAC_CREDIT_CNT		1
2448c2ecf20Sopenharmony_ci#define VF_VLAN_CREDIT_CNT		2 /* VLAN0 + 'real' VLAN */
2458c2ecf20Sopenharmony_ci
2468c2ecf20Sopenharmony_ci/* locking and unlocking the channel mutex */
2478c2ecf20Sopenharmony_civoid bnx2x_lock_vf_pf_channel(struct bnx2x *bp, struct bnx2x_virtf *vf,
2488c2ecf20Sopenharmony_ci			      enum channel_tlvs tlv);
2498c2ecf20Sopenharmony_ci
2508c2ecf20Sopenharmony_civoid bnx2x_unlock_vf_pf_channel(struct bnx2x *bp, struct bnx2x_virtf *vf,
2518c2ecf20Sopenharmony_ci				enum channel_tlvs expected_tlv);
2528c2ecf20Sopenharmony_ci
2538c2ecf20Sopenharmony_ci/* VF mail box (aka vf-pf channel) */
2548c2ecf20Sopenharmony_ci
2558c2ecf20Sopenharmony_ci/* a container for the bi-directional vf<-->pf messages.
2568c2ecf20Sopenharmony_ci *  The actual response will be placed according to the offset parameter
2578c2ecf20Sopenharmony_ci *  provided in the request
2588c2ecf20Sopenharmony_ci */
2598c2ecf20Sopenharmony_ci
2608c2ecf20Sopenharmony_ci#define MBX_MSG_ALIGN	8
2618c2ecf20Sopenharmony_ci#define MBX_MSG_ALIGNED_SIZE	(roundup(sizeof(struct bnx2x_vf_mbx_msg), \
2628c2ecf20Sopenharmony_ci				MBX_MSG_ALIGN))
2638c2ecf20Sopenharmony_ci
2648c2ecf20Sopenharmony_cistruct bnx2x_vf_mbx_msg {
2658c2ecf20Sopenharmony_ci	union vfpf_tlvs req;
2668c2ecf20Sopenharmony_ci	union pfvf_tlvs resp;
2678c2ecf20Sopenharmony_ci};
2688c2ecf20Sopenharmony_ci
2698c2ecf20Sopenharmony_cistruct bnx2x_vf_mbx {
2708c2ecf20Sopenharmony_ci	struct bnx2x_vf_mbx_msg *msg;
2718c2ecf20Sopenharmony_ci	dma_addr_t msg_mapping;
2728c2ecf20Sopenharmony_ci
2738c2ecf20Sopenharmony_ci	/* VF GPA address */
2748c2ecf20Sopenharmony_ci	u32 vf_addr_lo;
2758c2ecf20Sopenharmony_ci	u32 vf_addr_hi;
2768c2ecf20Sopenharmony_ci
2778c2ecf20Sopenharmony_ci	struct vfpf_first_tlv first_tlv;	/* saved VF request header */
2788c2ecf20Sopenharmony_ci};
2798c2ecf20Sopenharmony_ci
2808c2ecf20Sopenharmony_cistruct bnx2x_vf_sp {
2818c2ecf20Sopenharmony_ci	union {
2828c2ecf20Sopenharmony_ci		struct eth_classify_rules_ramrod_data	e2;
2838c2ecf20Sopenharmony_ci	} mac_rdata;
2848c2ecf20Sopenharmony_ci
2858c2ecf20Sopenharmony_ci	union {
2868c2ecf20Sopenharmony_ci		struct eth_classify_rules_ramrod_data	e2;
2878c2ecf20Sopenharmony_ci	} vlan_rdata;
2888c2ecf20Sopenharmony_ci
2898c2ecf20Sopenharmony_ci	union {
2908c2ecf20Sopenharmony_ci		struct eth_classify_rules_ramrod_data	e2;
2918c2ecf20Sopenharmony_ci	} vlan_mac_rdata;
2928c2ecf20Sopenharmony_ci
2938c2ecf20Sopenharmony_ci	union {
2948c2ecf20Sopenharmony_ci		struct eth_filter_rules_ramrod_data	e2;
2958c2ecf20Sopenharmony_ci	} rx_mode_rdata;
2968c2ecf20Sopenharmony_ci
2978c2ecf20Sopenharmony_ci	union {
2988c2ecf20Sopenharmony_ci		struct eth_multicast_rules_ramrod_data  e2;
2998c2ecf20Sopenharmony_ci	} mcast_rdata;
3008c2ecf20Sopenharmony_ci
3018c2ecf20Sopenharmony_ci	union {
3028c2ecf20Sopenharmony_ci		struct client_init_ramrod_data  init_data;
3038c2ecf20Sopenharmony_ci		struct client_update_ramrod_data update_data;
3048c2ecf20Sopenharmony_ci	} q_data;
3058c2ecf20Sopenharmony_ci
3068c2ecf20Sopenharmony_ci	union {
3078c2ecf20Sopenharmony_ci		struct eth_rss_update_ramrod_data e2;
3088c2ecf20Sopenharmony_ci	} rss_rdata;
3098c2ecf20Sopenharmony_ci};
3108c2ecf20Sopenharmony_ci
3118c2ecf20Sopenharmony_cistruct hw_dma {
3128c2ecf20Sopenharmony_ci	void *addr;
3138c2ecf20Sopenharmony_ci	dma_addr_t mapping;
3148c2ecf20Sopenharmony_ci	size_t size;
3158c2ecf20Sopenharmony_ci};
3168c2ecf20Sopenharmony_ci
3178c2ecf20Sopenharmony_cistruct bnx2x_vfdb {
3188c2ecf20Sopenharmony_ci#define BP_VFDB(bp)		((bp)->vfdb)
3198c2ecf20Sopenharmony_ci	/* vf array */
3208c2ecf20Sopenharmony_ci	struct bnx2x_virtf	*vfs;
3218c2ecf20Sopenharmony_ci#define BP_VF(bp, idx)		((BP_VFDB(bp) && (bp)->vfdb->vfs) ? \
3228c2ecf20Sopenharmony_ci					&((bp)->vfdb->vfs[idx]) : NULL)
3238c2ecf20Sopenharmony_ci#define bnx2x_vf(bp, idx, var)	((bp)->vfdb->vfs[idx].var)
3248c2ecf20Sopenharmony_ci
3258c2ecf20Sopenharmony_ci	/* queue array - for all vfs */
3268c2ecf20Sopenharmony_ci	struct bnx2x_vf_queue *vfqs;
3278c2ecf20Sopenharmony_ci
3288c2ecf20Sopenharmony_ci	/* vf HW contexts */
3298c2ecf20Sopenharmony_ci	struct hw_dma		context[BNX2X_VF_CIDS/ILT_PAGE_CIDS];
3308c2ecf20Sopenharmony_ci#define	BP_VF_CXT_PAGE(bp, i)	(&(bp)->vfdb->context[i])
3318c2ecf20Sopenharmony_ci
3328c2ecf20Sopenharmony_ci	/* SR-IOV information */
3338c2ecf20Sopenharmony_ci	struct bnx2x_sriov	sriov;
3348c2ecf20Sopenharmony_ci	struct hw_dma		mbx_dma;
3358c2ecf20Sopenharmony_ci#define BP_VF_MBX_DMA(bp)	(&((bp)->vfdb->mbx_dma))
3368c2ecf20Sopenharmony_ci	struct bnx2x_vf_mbx	mbxs[BNX2X_MAX_NUM_OF_VFS];
3378c2ecf20Sopenharmony_ci#define BP_VF_MBX(bp, vfid)	(&((bp)->vfdb->mbxs[vfid]))
3388c2ecf20Sopenharmony_ci
3398c2ecf20Sopenharmony_ci	struct hw_dma		bulletin_dma;
3408c2ecf20Sopenharmony_ci#define BP_VF_BULLETIN_DMA(bp)	(&((bp)->vfdb->bulletin_dma))
3418c2ecf20Sopenharmony_ci#define	BP_VF_BULLETIN(bp, vf) \
3428c2ecf20Sopenharmony_ci	(((struct pf_vf_bulletin_content *)(BP_VF_BULLETIN_DMA(bp)->addr)) \
3438c2ecf20Sopenharmony_ci	 + (vf))
3448c2ecf20Sopenharmony_ci
3458c2ecf20Sopenharmony_ci	struct hw_dma		sp_dma;
3468c2ecf20Sopenharmony_ci#define bnx2x_vf_sp(bp, vf, field) ((bp)->vfdb->sp_dma.addr +		\
3478c2ecf20Sopenharmony_ci		(vf)->index * sizeof(struct bnx2x_vf_sp) +		\
3488c2ecf20Sopenharmony_ci		offsetof(struct bnx2x_vf_sp, field))
3498c2ecf20Sopenharmony_ci#define bnx2x_vf_sp_map(bp, vf, field) ((bp)->vfdb->sp_dma.mapping +	\
3508c2ecf20Sopenharmony_ci		(vf)->index * sizeof(struct bnx2x_vf_sp) +		\
3518c2ecf20Sopenharmony_ci		offsetof(struct bnx2x_vf_sp, field))
3528c2ecf20Sopenharmony_ci
3538c2ecf20Sopenharmony_ci#define FLRD_VFS_DWORDS (BNX2X_MAX_NUM_OF_VFS / 32)
3548c2ecf20Sopenharmony_ci	u32 flrd_vfs[FLRD_VFS_DWORDS];
3558c2ecf20Sopenharmony_ci
3568c2ecf20Sopenharmony_ci	/* the number of msix vectors belonging to this PF designated for VFs */
3578c2ecf20Sopenharmony_ci	u16 vf_sbs_pool;
3588c2ecf20Sopenharmony_ci	u16 first_vf_igu_entry;
3598c2ecf20Sopenharmony_ci
3608c2ecf20Sopenharmony_ci	/* sp_rtnl synchronization */
3618c2ecf20Sopenharmony_ci	struct mutex			event_mutex;
3628c2ecf20Sopenharmony_ci	u64				event_occur;
3638c2ecf20Sopenharmony_ci
3648c2ecf20Sopenharmony_ci	/* bulletin board update synchronization */
3658c2ecf20Sopenharmony_ci	struct mutex			bulletin_mutex;
3668c2ecf20Sopenharmony_ci};
3678c2ecf20Sopenharmony_ci
3688c2ecf20Sopenharmony_ci/* queue access */
3698c2ecf20Sopenharmony_cistatic inline struct bnx2x_vf_queue *vfq_get(struct bnx2x_virtf *vf, u8 index)
3708c2ecf20Sopenharmony_ci{
3718c2ecf20Sopenharmony_ci	return &(vf->vfqs[index]);
3728c2ecf20Sopenharmony_ci}
3738c2ecf20Sopenharmony_ci
3748c2ecf20Sopenharmony_ci/* FW ids */
3758c2ecf20Sopenharmony_cistatic inline u8 vf_igu_sb(struct bnx2x_virtf *vf, u16 sb_idx)
3768c2ecf20Sopenharmony_ci{
3778c2ecf20Sopenharmony_ci	return vf->igu_base_id + sb_idx;
3788c2ecf20Sopenharmony_ci}
3798c2ecf20Sopenharmony_ci
3808c2ecf20Sopenharmony_cistatic inline u8 vf_hc_qzone(struct bnx2x_virtf *vf, u16 sb_idx)
3818c2ecf20Sopenharmony_ci{
3828c2ecf20Sopenharmony_ci	return vf_igu_sb(vf, sb_idx);
3838c2ecf20Sopenharmony_ci}
3848c2ecf20Sopenharmony_ci
3858c2ecf20Sopenharmony_cistatic u8 vfq_cl_id(struct bnx2x_virtf *vf, struct bnx2x_vf_queue *q)
3868c2ecf20Sopenharmony_ci{
3878c2ecf20Sopenharmony_ci	return vf->igu_base_id + q->index;
3888c2ecf20Sopenharmony_ci}
3898c2ecf20Sopenharmony_ci
3908c2ecf20Sopenharmony_cistatic inline u8 vfq_stat_id(struct bnx2x_virtf *vf, struct bnx2x_vf_queue *q)
3918c2ecf20Sopenharmony_ci{
3928c2ecf20Sopenharmony_ci	if (vf->cfg_flags & VF_CFG_STATS_COALESCE)
3938c2ecf20Sopenharmony_ci		return vf->leading_rss;
3948c2ecf20Sopenharmony_ci	else
3958c2ecf20Sopenharmony_ci		return vfq_cl_id(vf, q);
3968c2ecf20Sopenharmony_ci}
3978c2ecf20Sopenharmony_ci
3988c2ecf20Sopenharmony_cistatic inline u8 vfq_qzone_id(struct bnx2x_virtf *vf, struct bnx2x_vf_queue *q)
3998c2ecf20Sopenharmony_ci{
4008c2ecf20Sopenharmony_ci	return vfq_cl_id(vf, q);
4018c2ecf20Sopenharmony_ci}
4028c2ecf20Sopenharmony_ci
4038c2ecf20Sopenharmony_ci/* global iov routines */
4048c2ecf20Sopenharmony_ciint bnx2x_iov_init_ilt(struct bnx2x *bp, u16 line);
4058c2ecf20Sopenharmony_ciint bnx2x_iov_init_one(struct bnx2x *bp, int int_mode_param, int num_vfs_param);
4068c2ecf20Sopenharmony_civoid bnx2x_iov_remove_one(struct bnx2x *bp);
4078c2ecf20Sopenharmony_civoid bnx2x_iov_free_mem(struct bnx2x *bp);
4088c2ecf20Sopenharmony_ciint bnx2x_iov_alloc_mem(struct bnx2x *bp);
4098c2ecf20Sopenharmony_ciint bnx2x_iov_nic_init(struct bnx2x *bp);
4108c2ecf20Sopenharmony_ciint bnx2x_iov_chip_cleanup(struct bnx2x *bp);
4118c2ecf20Sopenharmony_civoid bnx2x_iov_init_dq(struct bnx2x *bp);
4128c2ecf20Sopenharmony_civoid bnx2x_iov_init_dmae(struct bnx2x *bp);
4138c2ecf20Sopenharmony_civoid bnx2x_iov_set_queue_sp_obj(struct bnx2x *bp, int vf_cid,
4148c2ecf20Sopenharmony_ci				struct bnx2x_queue_sp_obj **q_obj);
4158c2ecf20Sopenharmony_ciint bnx2x_iov_eq_sp_event(struct bnx2x *bp, union event_ring_elem *elem);
4168c2ecf20Sopenharmony_civoid bnx2x_iov_adjust_stats_req(struct bnx2x *bp);
4178c2ecf20Sopenharmony_civoid bnx2x_iov_storm_stats_update(struct bnx2x *bp);
4188c2ecf20Sopenharmony_ci/* global vf mailbox routines */
4198c2ecf20Sopenharmony_civoid bnx2x_vf_mbx(struct bnx2x *bp);
4208c2ecf20Sopenharmony_civoid bnx2x_vf_mbx_schedule(struct bnx2x *bp,
4218c2ecf20Sopenharmony_ci			   struct vf_pf_event_data *vfpf_event);
4228c2ecf20Sopenharmony_civoid bnx2x_vf_enable_mbx(struct bnx2x *bp, u8 abs_vfid);
4238c2ecf20Sopenharmony_ci
4248c2ecf20Sopenharmony_ci/* CORE VF API */
4258c2ecf20Sopenharmony_citypedef u8 bnx2x_mac_addr_t[ETH_ALEN];
4268c2ecf20Sopenharmony_ci
4278c2ecf20Sopenharmony_ci/* acquire */
4288c2ecf20Sopenharmony_ciint bnx2x_vf_acquire(struct bnx2x *bp, struct bnx2x_virtf *vf,
4298c2ecf20Sopenharmony_ci		     struct vf_pf_resc_request *resc);
4308c2ecf20Sopenharmony_ci/* init */
4318c2ecf20Sopenharmony_ciint bnx2x_vf_init(struct bnx2x *bp, struct bnx2x_virtf *vf,
4328c2ecf20Sopenharmony_ci		  dma_addr_t *sb_map);
4338c2ecf20Sopenharmony_ci
4348c2ecf20Sopenharmony_ci/* VFOP queue construction helpers */
4358c2ecf20Sopenharmony_civoid bnx2x_vfop_qctor_dump_tx(struct bnx2x *bp, struct bnx2x_virtf *vf,
4368c2ecf20Sopenharmony_ci			    struct bnx2x_queue_init_params *init_params,
4378c2ecf20Sopenharmony_ci			    struct bnx2x_queue_setup_params *setup_params,
4388c2ecf20Sopenharmony_ci			    u16 q_idx, u16 sb_idx);
4398c2ecf20Sopenharmony_ci
4408c2ecf20Sopenharmony_civoid bnx2x_vfop_qctor_dump_rx(struct bnx2x *bp, struct bnx2x_virtf *vf,
4418c2ecf20Sopenharmony_ci			    struct bnx2x_queue_init_params *init_params,
4428c2ecf20Sopenharmony_ci			    struct bnx2x_queue_setup_params *setup_params,
4438c2ecf20Sopenharmony_ci			    u16 q_idx, u16 sb_idx);
4448c2ecf20Sopenharmony_ci
4458c2ecf20Sopenharmony_civoid bnx2x_vfop_qctor_prep(struct bnx2x *bp,
4468c2ecf20Sopenharmony_ci			   struct bnx2x_virtf *vf,
4478c2ecf20Sopenharmony_ci			   struct bnx2x_vf_queue *q,
4488c2ecf20Sopenharmony_ci			   struct bnx2x_vf_queue_construct_params *p,
4498c2ecf20Sopenharmony_ci			   unsigned long q_type);
4508c2ecf20Sopenharmony_ci
4518c2ecf20Sopenharmony_ciint bnx2x_vf_mac_vlan_config_list(struct bnx2x *bp, struct bnx2x_virtf *vf,
4528c2ecf20Sopenharmony_ci				  struct bnx2x_vf_mac_vlan_filters *filters,
4538c2ecf20Sopenharmony_ci				  int qid, bool drv_only);
4548c2ecf20Sopenharmony_ci
4558c2ecf20Sopenharmony_ciint bnx2x_vf_queue_setup(struct bnx2x *bp, struct bnx2x_virtf *vf, int qid,
4568c2ecf20Sopenharmony_ci			 struct bnx2x_vf_queue_construct_params *qctor);
4578c2ecf20Sopenharmony_ci
4588c2ecf20Sopenharmony_ciint bnx2x_vf_queue_teardown(struct bnx2x *bp, struct bnx2x_virtf *vf, int qid);
4598c2ecf20Sopenharmony_ci
4608c2ecf20Sopenharmony_ciint bnx2x_vf_mcast(struct bnx2x *bp, struct bnx2x_virtf *vf,
4618c2ecf20Sopenharmony_ci		   bnx2x_mac_addr_t *mcasts, int mc_num, bool drv_only);
4628c2ecf20Sopenharmony_ci
4638c2ecf20Sopenharmony_ciint bnx2x_vf_rxmode(struct bnx2x *bp, struct bnx2x_virtf *vf,
4648c2ecf20Sopenharmony_ci		    int qid, unsigned long accept_flags);
4658c2ecf20Sopenharmony_ci
4668c2ecf20Sopenharmony_ciint bnx2x_vf_close(struct bnx2x *bp, struct bnx2x_virtf *vf);
4678c2ecf20Sopenharmony_ci
4688c2ecf20Sopenharmony_ciint bnx2x_vf_free(struct bnx2x *bp, struct bnx2x_virtf *vf);
4698c2ecf20Sopenharmony_ci
4708c2ecf20Sopenharmony_ciint bnx2x_vf_rss_update(struct bnx2x *bp, struct bnx2x_virtf *vf,
4718c2ecf20Sopenharmony_ci			struct bnx2x_config_rss_params *rss);
4728c2ecf20Sopenharmony_ci
4738c2ecf20Sopenharmony_ciint bnx2x_vf_tpa_update(struct bnx2x *bp, struct bnx2x_virtf *vf,
4748c2ecf20Sopenharmony_ci			struct vfpf_tpa_tlv *tlv,
4758c2ecf20Sopenharmony_ci			struct bnx2x_queue_update_tpa_params *params);
4768c2ecf20Sopenharmony_ci
4778c2ecf20Sopenharmony_ci/* VF release ~ VF close + VF release-resources
4788c2ecf20Sopenharmony_ci *
4798c2ecf20Sopenharmony_ci * Release is the ultimate SW shutdown and is called whenever an
4808c2ecf20Sopenharmony_ci * irrecoverable error is encountered.
4818c2ecf20Sopenharmony_ci */
4828c2ecf20Sopenharmony_ciint bnx2x_vf_release(struct bnx2x *bp, struct bnx2x_virtf *vf);
4838c2ecf20Sopenharmony_ciint bnx2x_vf_idx_by_abs_fid(struct bnx2x *bp, u16 abs_vfid);
4848c2ecf20Sopenharmony_ciu8 bnx2x_vf_max_queue_cnt(struct bnx2x *bp, struct bnx2x_virtf *vf);
4858c2ecf20Sopenharmony_ci
4868c2ecf20Sopenharmony_ci/* FLR routines */
4878c2ecf20Sopenharmony_ci
4888c2ecf20Sopenharmony_ci/* VF FLR helpers */
4898c2ecf20Sopenharmony_ciint bnx2x_vf_flr_clnup_epilog(struct bnx2x *bp, u8 abs_vfid);
4908c2ecf20Sopenharmony_civoid bnx2x_vf_enable_access(struct bnx2x *bp, u8 abs_vfid);
4918c2ecf20Sopenharmony_ci
4928c2ecf20Sopenharmony_ci/* Handles an FLR (or VF_DISABLE) notification form the MCP */
4938c2ecf20Sopenharmony_civoid bnx2x_vf_handle_flr_event(struct bnx2x *bp);
4948c2ecf20Sopenharmony_ci
4958c2ecf20Sopenharmony_cibool bnx2x_tlv_supported(u16 tlvtype);
4968c2ecf20Sopenharmony_ci
4978c2ecf20Sopenharmony_ciu32 bnx2x_crc_vf_bulletin(struct pf_vf_bulletin_content *bulletin);
4988c2ecf20Sopenharmony_ciint bnx2x_post_vf_bulletin(struct bnx2x *bp, int vf);
4998c2ecf20Sopenharmony_civoid bnx2x_vf_bulletin_finalize(struct pf_vf_bulletin_content *bulletin,
5008c2ecf20Sopenharmony_ci				bool support_long);
5018c2ecf20Sopenharmony_ci
5028c2ecf20Sopenharmony_cienum sample_bulletin_result bnx2x_sample_bulletin(struct bnx2x *bp);
5038c2ecf20Sopenharmony_ci
5048c2ecf20Sopenharmony_ci/* VF side vfpf channel functions */
5058c2ecf20Sopenharmony_ciint bnx2x_vfpf_acquire(struct bnx2x *bp, u8 tx_count, u8 rx_count);
5068c2ecf20Sopenharmony_ciint bnx2x_vfpf_release(struct bnx2x *bp);
5078c2ecf20Sopenharmony_ciint bnx2x_vfpf_release(struct bnx2x *bp);
5088c2ecf20Sopenharmony_ciint bnx2x_vfpf_init(struct bnx2x *bp);
5098c2ecf20Sopenharmony_civoid bnx2x_vfpf_close_vf(struct bnx2x *bp);
5108c2ecf20Sopenharmony_ciint bnx2x_vfpf_setup_q(struct bnx2x *bp, struct bnx2x_fastpath *fp,
5118c2ecf20Sopenharmony_ci		       bool is_leading);
5128c2ecf20Sopenharmony_ciint bnx2x_vfpf_config_mac(struct bnx2x *bp, u8 *addr, u8 vf_qid, bool set);
5138c2ecf20Sopenharmony_ciint bnx2x_vfpf_config_rss(struct bnx2x *bp,
5148c2ecf20Sopenharmony_ci			  struct bnx2x_config_rss_params *params);
5158c2ecf20Sopenharmony_ciint bnx2x_vfpf_set_mcast(struct net_device *dev);
5168c2ecf20Sopenharmony_ciint bnx2x_vfpf_storm_rx_mode(struct bnx2x *bp);
5178c2ecf20Sopenharmony_ci
5188c2ecf20Sopenharmony_cistatic inline void bnx2x_vf_fill_fw_str(struct bnx2x *bp, char *buf,
5198c2ecf20Sopenharmony_ci					size_t buf_len)
5208c2ecf20Sopenharmony_ci{
5218c2ecf20Sopenharmony_ci	strlcpy(buf, bp->acquire_resp.pfdev_info.fw_ver, buf_len);
5228c2ecf20Sopenharmony_ci}
5238c2ecf20Sopenharmony_ci
5248c2ecf20Sopenharmony_cistatic inline int bnx2x_vf_ustorm_prods_offset(struct bnx2x *bp,
5258c2ecf20Sopenharmony_ci					       struct bnx2x_fastpath *fp)
5268c2ecf20Sopenharmony_ci{
5278c2ecf20Sopenharmony_ci	return PXP_VF_ADDR_USDM_QUEUES_START +
5288c2ecf20Sopenharmony_ci		bp->acquire_resp.resc.hw_qid[fp->index] *
5298c2ecf20Sopenharmony_ci		sizeof(struct ustorm_queue_zone_data);
5308c2ecf20Sopenharmony_ci}
5318c2ecf20Sopenharmony_ci
5328c2ecf20Sopenharmony_cienum sample_bulletin_result bnx2x_sample_bulletin(struct bnx2x *bp);
5338c2ecf20Sopenharmony_civoid bnx2x_timer_sriov(struct bnx2x *bp);
5348c2ecf20Sopenharmony_civoid __iomem *bnx2x_vf_doorbells(struct bnx2x *bp);
5358c2ecf20Sopenharmony_civoid bnx2x_vf_pci_dealloc(struct bnx2x *bp);
5368c2ecf20Sopenharmony_ciint bnx2x_vf_pci_alloc(struct bnx2x *bp);
5378c2ecf20Sopenharmony_ciint bnx2x_enable_sriov(struct bnx2x *bp);
5388c2ecf20Sopenharmony_civoid bnx2x_disable_sriov(struct bnx2x *bp);
5398c2ecf20Sopenharmony_cistatic inline int bnx2x_vf_headroom(struct bnx2x *bp)
5408c2ecf20Sopenharmony_ci{
5418c2ecf20Sopenharmony_ci	return bp->vfdb->sriov.nr_virtfn * BNX2X_CIDS_PER_VF;
5428c2ecf20Sopenharmony_ci}
5438c2ecf20Sopenharmony_civoid bnx2x_pf_set_vfs_vlan(struct bnx2x *bp);
5448c2ecf20Sopenharmony_ciint bnx2x_sriov_configure(struct pci_dev *dev, int num_vfs);
5458c2ecf20Sopenharmony_civoid bnx2x_iov_channel_down(struct bnx2x *bp);
5468c2ecf20Sopenharmony_ci
5478c2ecf20Sopenharmony_civoid bnx2x_iov_task(struct work_struct *work);
5488c2ecf20Sopenharmony_ci
5498c2ecf20Sopenharmony_civoid bnx2x_schedule_iov_task(struct bnx2x *bp, enum bnx2x_iov_flag flag);
5508c2ecf20Sopenharmony_ci
5518c2ecf20Sopenharmony_civoid bnx2x_iov_link_update(struct bnx2x *bp);
5528c2ecf20Sopenharmony_ciint bnx2x_iov_link_update_vf(struct bnx2x *bp, int idx);
5538c2ecf20Sopenharmony_ci
5548c2ecf20Sopenharmony_ciint bnx2x_set_vf_link_state(struct net_device *dev, int vf, int link_state);
5558c2ecf20Sopenharmony_ci
5568c2ecf20Sopenharmony_ciint bnx2x_vfpf_update_vlan(struct bnx2x *bp, u16 vid, u8 vf_qid, bool add);
5578c2ecf20Sopenharmony_ci#else /* CONFIG_BNX2X_SRIOV */
5588c2ecf20Sopenharmony_ci
5598c2ecf20Sopenharmony_ci#define GET_NUM_VFS_PER_PATH(bp)	0
5608c2ecf20Sopenharmony_ci#define GET_NUM_VFS_PER_PF(bp)		0
5618c2ecf20Sopenharmony_ci#define VF_MAC_CREDIT_CNT		0
5628c2ecf20Sopenharmony_ci#define VF_VLAN_CREDIT_CNT		0
5638c2ecf20Sopenharmony_ci
5648c2ecf20Sopenharmony_cistatic inline void bnx2x_iov_set_queue_sp_obj(struct bnx2x *bp, int vf_cid,
5658c2ecf20Sopenharmony_ci				struct bnx2x_queue_sp_obj **q_obj) {}
5668c2ecf20Sopenharmony_cistatic inline void bnx2x_vf_handle_flr_event(struct bnx2x *bp) {}
5678c2ecf20Sopenharmony_cistatic inline int bnx2x_iov_eq_sp_event(struct bnx2x *bp,
5688c2ecf20Sopenharmony_ci					union event_ring_elem *elem) {return 1; }
5698c2ecf20Sopenharmony_cistatic inline void bnx2x_vf_mbx(struct bnx2x *bp) {}
5708c2ecf20Sopenharmony_cistatic inline void bnx2x_vf_mbx_schedule(struct bnx2x *bp,
5718c2ecf20Sopenharmony_ci					 struct vf_pf_event_data *vfpf_event) {}
5728c2ecf20Sopenharmony_cistatic inline int bnx2x_iov_init_ilt(struct bnx2x *bp, u16 line) {return line; }
5738c2ecf20Sopenharmony_cistatic inline void bnx2x_iov_init_dq(struct bnx2x *bp) {}
5748c2ecf20Sopenharmony_cistatic inline int bnx2x_iov_alloc_mem(struct bnx2x *bp) {return 0; }
5758c2ecf20Sopenharmony_cistatic inline void bnx2x_iov_free_mem(struct bnx2x *bp) {}
5768c2ecf20Sopenharmony_cistatic inline int bnx2x_iov_chip_cleanup(struct bnx2x *bp) {return 0; }
5778c2ecf20Sopenharmony_cistatic inline void bnx2x_iov_init_dmae(struct bnx2x *bp) {}
5788c2ecf20Sopenharmony_cistatic inline int bnx2x_iov_init_one(struct bnx2x *bp, int int_mode_param,
5798c2ecf20Sopenharmony_ci				     int num_vfs_param) {return 0; }
5808c2ecf20Sopenharmony_cistatic inline void bnx2x_iov_remove_one(struct bnx2x *bp) {}
5818c2ecf20Sopenharmony_cistatic inline int bnx2x_enable_sriov(struct bnx2x *bp) {return 0; }
5828c2ecf20Sopenharmony_cistatic inline void bnx2x_disable_sriov(struct bnx2x *bp) {}
5838c2ecf20Sopenharmony_cistatic inline int bnx2x_vfpf_acquire(struct bnx2x *bp,
5848c2ecf20Sopenharmony_ci				     u8 tx_count, u8 rx_count) {return 0; }
5858c2ecf20Sopenharmony_cistatic inline int bnx2x_vfpf_release(struct bnx2x *bp) {return 0; }
5868c2ecf20Sopenharmony_cistatic inline int bnx2x_vfpf_init(struct bnx2x *bp) {return 0; }
5878c2ecf20Sopenharmony_cistatic inline void bnx2x_vfpf_close_vf(struct bnx2x *bp) {}
5888c2ecf20Sopenharmony_cistatic inline int bnx2x_vfpf_setup_q(struct bnx2x *bp, struct bnx2x_fastpath *fp, bool is_leading) {return 0; }
5898c2ecf20Sopenharmony_cistatic inline int bnx2x_vfpf_config_mac(struct bnx2x *bp, u8 *addr,
5908c2ecf20Sopenharmony_ci					u8 vf_qid, bool set) {return 0; }
5918c2ecf20Sopenharmony_cistatic inline int bnx2x_vfpf_config_rss(struct bnx2x *bp,
5928c2ecf20Sopenharmony_ci					struct bnx2x_config_rss_params *params) {return 0; }
5938c2ecf20Sopenharmony_cistatic inline int bnx2x_vfpf_set_mcast(struct net_device *dev) {return 0; }
5948c2ecf20Sopenharmony_cistatic inline int bnx2x_vfpf_storm_rx_mode(struct bnx2x *bp) {return 0; }
5958c2ecf20Sopenharmony_cistatic inline int bnx2x_iov_nic_init(struct bnx2x *bp) {return 0; }
5968c2ecf20Sopenharmony_cistatic inline int bnx2x_vf_headroom(struct bnx2x *bp) {return 0; }
5978c2ecf20Sopenharmony_cistatic inline void bnx2x_iov_adjust_stats_req(struct bnx2x *bp) {}
5988c2ecf20Sopenharmony_cistatic inline void bnx2x_vf_fill_fw_str(struct bnx2x *bp, char *buf,
5998c2ecf20Sopenharmony_ci					size_t buf_len) {}
6008c2ecf20Sopenharmony_cistatic inline int bnx2x_vf_ustorm_prods_offset(struct bnx2x *bp,
6018c2ecf20Sopenharmony_ci					       struct bnx2x_fastpath *fp) {return 0; }
6028c2ecf20Sopenharmony_cistatic inline enum sample_bulletin_result bnx2x_sample_bulletin(struct bnx2x *bp)
6038c2ecf20Sopenharmony_ci{
6048c2ecf20Sopenharmony_ci	return PFVF_BULLETIN_UNCHANGED;
6058c2ecf20Sopenharmony_ci}
6068c2ecf20Sopenharmony_cistatic inline void bnx2x_timer_sriov(struct bnx2x *bp) {}
6078c2ecf20Sopenharmony_ci
6088c2ecf20Sopenharmony_cistatic inline void __iomem *bnx2x_vf_doorbells(struct bnx2x *bp)
6098c2ecf20Sopenharmony_ci{
6108c2ecf20Sopenharmony_ci	return NULL;
6118c2ecf20Sopenharmony_ci}
6128c2ecf20Sopenharmony_ci
6138c2ecf20Sopenharmony_cistatic inline void bnx2x_vf_pci_dealloc(struct bnx2x *bp) {}
6148c2ecf20Sopenharmony_cistatic inline int bnx2x_vf_pci_alloc(struct bnx2x *bp) {return 0; }
6158c2ecf20Sopenharmony_cistatic inline void bnx2x_pf_set_vfs_vlan(struct bnx2x *bp) {}
6168c2ecf20Sopenharmony_cistatic inline int bnx2x_sriov_configure(struct pci_dev *dev, int num_vfs) {return 0; }
6178c2ecf20Sopenharmony_cistatic inline void bnx2x_iov_channel_down(struct bnx2x *bp) {}
6188c2ecf20Sopenharmony_ci
6198c2ecf20Sopenharmony_cistatic inline void bnx2x_iov_task(struct work_struct *work) {}
6208c2ecf20Sopenharmony_cistatic inline void bnx2x_schedule_iov_task(struct bnx2x *bp, enum bnx2x_iov_flag flag) {}
6218c2ecf20Sopenharmony_cistatic inline void bnx2x_iov_link_update(struct bnx2x *bp) {}
6228c2ecf20Sopenharmony_cistatic inline int bnx2x_iov_link_update_vf(struct bnx2x *bp, int idx) {return 0; }
6238c2ecf20Sopenharmony_ci
6248c2ecf20Sopenharmony_cistatic inline int bnx2x_set_vf_link_state(struct net_device *dev, int vf,
6258c2ecf20Sopenharmony_ci					  int link_state) {return 0; }
6268c2ecf20Sopenharmony_cistruct pf_vf_bulletin_content;
6278c2ecf20Sopenharmony_cistatic inline void bnx2x_vf_bulletin_finalize(struct pf_vf_bulletin_content *bulletin,
6288c2ecf20Sopenharmony_ci					      bool support_long) {}
6298c2ecf20Sopenharmony_ci
6308c2ecf20Sopenharmony_cistatic inline int bnx2x_vfpf_update_vlan(struct bnx2x *bp, u16 vid, u8 vf_qid, bool add) {return 0; }
6318c2ecf20Sopenharmony_ci
6328c2ecf20Sopenharmony_ci#endif /* CONFIG_BNX2X_SRIOV */
6338c2ecf20Sopenharmony_ci#endif /* bnx2x_sriov.h */
634