162306a36Sopenharmony_ci/* bnx2x_sriov.h: QLogic Everest network driver.
262306a36Sopenharmony_ci *
362306a36Sopenharmony_ci * Copyright 2009-2013 Broadcom Corporation
462306a36Sopenharmony_ci * Copyright 2014 QLogic Corporation
562306a36Sopenharmony_ci * All rights reserved
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci * Unless you and QLogic execute a separate written software license
862306a36Sopenharmony_ci * agreement governing use of this software, this software is licensed to you
962306a36Sopenharmony_ci * under the terms of the GNU General Public License version 2, available
1062306a36Sopenharmony_ci * at http://www.gnu.org/licenses/old-licenses/gpl-2.0.html (the "GPL").
1162306a36Sopenharmony_ci *
1262306a36Sopenharmony_ci * Notwithstanding the above, under no circumstances may you combine this
1362306a36Sopenharmony_ci * software in any way with any other QLogic software provided under a
1462306a36Sopenharmony_ci * license other than the GPL, without QLogic's express prior written
1562306a36Sopenharmony_ci * consent.
1662306a36Sopenharmony_ci *
1762306a36Sopenharmony_ci * Maintained by: Ariel Elior <ariel.elior@qlogic.com>
1862306a36Sopenharmony_ci * Written by: Shmulik Ravid
1962306a36Sopenharmony_ci *	       Ariel Elior <ariel.elior@qlogic.com>
2062306a36Sopenharmony_ci */
2162306a36Sopenharmony_ci#ifndef BNX2X_SRIOV_H
2262306a36Sopenharmony_ci#define BNX2X_SRIOV_H
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci#include "bnx2x_vfpf.h"
2562306a36Sopenharmony_ci#include "bnx2x.h"
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_cienum sample_bulletin_result {
2862306a36Sopenharmony_ci	   PFVF_BULLETIN_UNCHANGED,
2962306a36Sopenharmony_ci	   PFVF_BULLETIN_UPDATED,
3062306a36Sopenharmony_ci	   PFVF_BULLETIN_CRC_ERR
3162306a36Sopenharmony_ci};
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_ci#ifdef CONFIG_BNX2X_SRIOV
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ciextern struct workqueue_struct *bnx2x_iov_wq;
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci/* The bnx2x device structure holds vfdb structure described below.
3862306a36Sopenharmony_ci * The VF array is indexed by the relative vfid.
3962306a36Sopenharmony_ci */
4062306a36Sopenharmony_ci#define BNX2X_VF_MAX_QUEUES		16
4162306a36Sopenharmony_ci#define BNX2X_VF_MAX_TPA_AGG_QUEUES	8
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_cistruct bnx2x_sriov {
4462306a36Sopenharmony_ci	u32 first_vf_in_pf;
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci	/* standard SRIOV capability fields, mostly for debugging */
4762306a36Sopenharmony_ci	int pos;		/* capability position */
4862306a36Sopenharmony_ci	int nres;		/* number of resources */
4962306a36Sopenharmony_ci	u32 cap;		/* SR-IOV Capabilities */
5062306a36Sopenharmony_ci	u16 ctrl;		/* SR-IOV Control */
5162306a36Sopenharmony_ci	u16 total;		/* total VFs associated with the PF */
5262306a36Sopenharmony_ci	u16 initial;		/* initial VFs associated with the PF */
5362306a36Sopenharmony_ci	u16 nr_virtfn;		/* number of VFs available */
5462306a36Sopenharmony_ci	u16 offset;		/* first VF Routing ID offset */
5562306a36Sopenharmony_ci	u16 stride;		/* following VF stride */
5662306a36Sopenharmony_ci	u32 pgsz;		/* page size for BAR alignment */
5762306a36Sopenharmony_ci	u8 link;		/* Function Dependency Link */
5862306a36Sopenharmony_ci};
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_ci/* bars */
6162306a36Sopenharmony_cistruct bnx2x_vf_bar {
6262306a36Sopenharmony_ci	u64 bar;
6362306a36Sopenharmony_ci	u32 size;
6462306a36Sopenharmony_ci};
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_cistruct bnx2x_vf_bar_info {
6762306a36Sopenharmony_ci	struct bnx2x_vf_bar bars[PCI_SRIOV_NUM_BARS];
6862306a36Sopenharmony_ci	u8 nr_bars;
6962306a36Sopenharmony_ci};
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_ci/* vf queue (used both for rx or tx) */
7262306a36Sopenharmony_cistruct bnx2x_vf_queue {
7362306a36Sopenharmony_ci	struct eth_context		*cxt;
7462306a36Sopenharmony_ci
7562306a36Sopenharmony_ci	/* MACs object */
7662306a36Sopenharmony_ci	struct bnx2x_vlan_mac_obj	mac_obj;
7762306a36Sopenharmony_ci
7862306a36Sopenharmony_ci	/* VLANs object */
7962306a36Sopenharmony_ci	struct bnx2x_vlan_mac_obj	vlan_obj;
8062306a36Sopenharmony_ci
8162306a36Sopenharmony_ci	/* VLAN-MACs object */
8262306a36Sopenharmony_ci	struct bnx2x_vlan_mac_obj	vlan_mac_obj;
8362306a36Sopenharmony_ci
8462306a36Sopenharmony_ci	unsigned long accept_flags;	/* last accept flags configured */
8562306a36Sopenharmony_ci
8662306a36Sopenharmony_ci	/* Queue Slow-path State object */
8762306a36Sopenharmony_ci	struct bnx2x_queue_sp_obj	sp_obj;
8862306a36Sopenharmony_ci
8962306a36Sopenharmony_ci	u32 cid;
9062306a36Sopenharmony_ci	u16 index;
9162306a36Sopenharmony_ci	u16 sb_idx;
9262306a36Sopenharmony_ci	bool is_leading;
9362306a36Sopenharmony_ci	bool sp_initialized;
9462306a36Sopenharmony_ci};
9562306a36Sopenharmony_ci
9662306a36Sopenharmony_ci/* struct bnx2x_vf_queue_construct_params - prepare queue construction
9762306a36Sopenharmony_ci * parameters: q-init, q-setup and SB index
9862306a36Sopenharmony_ci */
9962306a36Sopenharmony_cistruct bnx2x_vf_queue_construct_params {
10062306a36Sopenharmony_ci	struct bnx2x_queue_state_params		qstate;
10162306a36Sopenharmony_ci	struct bnx2x_queue_setup_params		prep_qsetup;
10262306a36Sopenharmony_ci};
10362306a36Sopenharmony_ci
10462306a36Sopenharmony_ci/* forward */
10562306a36Sopenharmony_cistruct bnx2x_virtf;
10662306a36Sopenharmony_ci
10762306a36Sopenharmony_ci/* VFOP definitions */
10862306a36Sopenharmony_ci
10962306a36Sopenharmony_cistruct bnx2x_vf_mac_vlan_filter {
11062306a36Sopenharmony_ci	int type;
11162306a36Sopenharmony_ci#define BNX2X_VF_FILTER_MAC	BIT(0)
11262306a36Sopenharmony_ci#define BNX2X_VF_FILTER_VLAN	BIT(1)
11362306a36Sopenharmony_ci#define BNX2X_VF_FILTER_VLAN_MAC \
11462306a36Sopenharmony_ci	(BNX2X_VF_FILTER_MAC | BNX2X_VF_FILTER_VLAN) /*shortcut*/
11562306a36Sopenharmony_ci
11662306a36Sopenharmony_ci	bool add;
11762306a36Sopenharmony_ci	bool applied;
11862306a36Sopenharmony_ci	u8 *mac;
11962306a36Sopenharmony_ci	u16 vid;
12062306a36Sopenharmony_ci};
12162306a36Sopenharmony_ci
12262306a36Sopenharmony_cistruct bnx2x_vf_mac_vlan_filters {
12362306a36Sopenharmony_ci	int count;
12462306a36Sopenharmony_ci	struct bnx2x_vf_mac_vlan_filter filters[];
12562306a36Sopenharmony_ci};
12662306a36Sopenharmony_ci
12762306a36Sopenharmony_ci/* vf context */
12862306a36Sopenharmony_cistruct bnx2x_virtf {
12962306a36Sopenharmony_ci	u16 cfg_flags;
13062306a36Sopenharmony_ci#define VF_CFG_STATS_COALESCE	0x1
13162306a36Sopenharmony_ci#define VF_CFG_EXT_BULLETIN	0x2
13262306a36Sopenharmony_ci#define VF_CFG_VLAN_FILTER	0x4
13362306a36Sopenharmony_ci	u8 link_cfg;		/* IFLA_VF_LINK_STATE_AUTO
13462306a36Sopenharmony_ci				 * IFLA_VF_LINK_STATE_ENABLE
13562306a36Sopenharmony_ci				 * IFLA_VF_LINK_STATE_DISABLE
13662306a36Sopenharmony_ci				 */
13762306a36Sopenharmony_ci	u8 state;
13862306a36Sopenharmony_ci#define VF_FREE		0	/* VF ready to be acquired holds no resc */
13962306a36Sopenharmony_ci#define VF_ACQUIRED	1	/* VF acquired, but not initialized */
14062306a36Sopenharmony_ci#define VF_ENABLED	2	/* VF Enabled */
14162306a36Sopenharmony_ci#define VF_RESET	3	/* VF FLR'd, pending cleanup */
14262306a36Sopenharmony_ci#define VF_LOST		4	/* Recovery while VFs are loaded */
14362306a36Sopenharmony_ci
14462306a36Sopenharmony_ci	bool flr_clnup_stage;	/* true during flr cleanup */
14562306a36Sopenharmony_ci	bool malicious;		/* true if FW indicated so, until FLR */
14662306a36Sopenharmony_ci	/* 1(true) if spoof check is enabled */
14762306a36Sopenharmony_ci	u8 spoofchk;
14862306a36Sopenharmony_ci
14962306a36Sopenharmony_ci	/* dma */
15062306a36Sopenharmony_ci	dma_addr_t fw_stat_map;
15162306a36Sopenharmony_ci	u16 stats_stride;
15262306a36Sopenharmony_ci	dma_addr_t bulletin_map;
15362306a36Sopenharmony_ci
15462306a36Sopenharmony_ci	/* Allocated resources counters. Before the VF is acquired, the
15562306a36Sopenharmony_ci	 * counters hold the following values:
15662306a36Sopenharmony_ci	 *
15762306a36Sopenharmony_ci	 * - xxq_count = 0 as the queues memory is not allocated yet.
15862306a36Sopenharmony_ci	 *
15962306a36Sopenharmony_ci	 * - sb_count  = The number of status blocks configured for this VF in
16062306a36Sopenharmony_ci	 *		 the IGU CAM. Initially read during probe.
16162306a36Sopenharmony_ci	 *
16262306a36Sopenharmony_ci	 * - xx_rules_count = The number of rules statically and equally
16362306a36Sopenharmony_ci	 *		      allocated for each VF, during PF load.
16462306a36Sopenharmony_ci	 */
16562306a36Sopenharmony_ci	struct vf_pf_resc_request	alloc_resc;
16662306a36Sopenharmony_ci#define vf_rxq_count(vf)		((vf)->alloc_resc.num_rxqs)
16762306a36Sopenharmony_ci#define vf_txq_count(vf)		((vf)->alloc_resc.num_txqs)
16862306a36Sopenharmony_ci#define vf_sb_count(vf)			((vf)->alloc_resc.num_sbs)
16962306a36Sopenharmony_ci#define vf_mac_rules_cnt(vf)		((vf)->alloc_resc.num_mac_filters)
17062306a36Sopenharmony_ci#define vf_vlan_rules_cnt(vf)		((vf)->alloc_resc.num_vlan_filters)
17162306a36Sopenharmony_ci#define vf_mc_rules_cnt(vf)		((vf)->alloc_resc.num_mc_filters)
17262306a36Sopenharmony_ci
17362306a36Sopenharmony_ci	u8 sb_count;	/* actual number of SBs */
17462306a36Sopenharmony_ci	u8 igu_base_id;	/* base igu status block id */
17562306a36Sopenharmony_ci
17662306a36Sopenharmony_ci	struct bnx2x_vf_queue	*vfqs;
17762306a36Sopenharmony_ci#define LEADING_IDX			0
17862306a36Sopenharmony_ci#define bnx2x_vfq_is_leading(vfq)	((vfq)->index == LEADING_IDX)
17962306a36Sopenharmony_ci#define bnx2x_vfq(vf, nr, var)		((vf)->vfqs[(nr)].var)
18062306a36Sopenharmony_ci#define bnx2x_leading_vfq(vf, var)	((vf)->vfqs[LEADING_IDX].var)
18162306a36Sopenharmony_ci
18262306a36Sopenharmony_ci	u8 index;	/* index in the vf array */
18362306a36Sopenharmony_ci	u8 abs_vfid;
18462306a36Sopenharmony_ci	u8 sp_cl_id;
18562306a36Sopenharmony_ci	u32 error;	/* 0 means all's-well */
18662306a36Sopenharmony_ci
18762306a36Sopenharmony_ci	/* BDF */
18862306a36Sopenharmony_ci	unsigned int domain;
18962306a36Sopenharmony_ci	unsigned int bus;
19062306a36Sopenharmony_ci	unsigned int devfn;
19162306a36Sopenharmony_ci
19262306a36Sopenharmony_ci	/* bars */
19362306a36Sopenharmony_ci	struct bnx2x_vf_bar bars[PCI_SRIOV_NUM_BARS];
19462306a36Sopenharmony_ci
19562306a36Sopenharmony_ci	/* set-mac ramrod state 1-pending, 0-done */
19662306a36Sopenharmony_ci	unsigned long	filter_state;
19762306a36Sopenharmony_ci
19862306a36Sopenharmony_ci	/* leading rss client id ~~ the client id of the first rxq, must be
19962306a36Sopenharmony_ci	 * set for each txq.
20062306a36Sopenharmony_ci	 */
20162306a36Sopenharmony_ci	int leading_rss;
20262306a36Sopenharmony_ci
20362306a36Sopenharmony_ci	/* MCAST object */
20462306a36Sopenharmony_ci	struct bnx2x_mcast_obj		mcast_obj;
20562306a36Sopenharmony_ci
20662306a36Sopenharmony_ci	/* RSS configuration object */
20762306a36Sopenharmony_ci	struct bnx2x_rss_config_obj     rss_conf_obj;
20862306a36Sopenharmony_ci
20962306a36Sopenharmony_ci	/* slow-path operations */
21062306a36Sopenharmony_ci	struct mutex			op_mutex; /* one vfop at a time mutex */
21162306a36Sopenharmony_ci	enum channel_tlvs		op_current;
21262306a36Sopenharmony_ci
21362306a36Sopenharmony_ci	u8 fp_hsi;
21462306a36Sopenharmony_ci
21562306a36Sopenharmony_ci	struct bnx2x_credit_pool_obj	vf_vlans_pool;
21662306a36Sopenharmony_ci	struct bnx2x_credit_pool_obj	vf_macs_pool;
21762306a36Sopenharmony_ci};
21862306a36Sopenharmony_ci
21962306a36Sopenharmony_ci#define BNX2X_NR_VIRTFN(bp)	((bp)->vfdb->sriov.nr_virtfn)
22062306a36Sopenharmony_ci
22162306a36Sopenharmony_ci#define for_each_vf(bp, var) \
22262306a36Sopenharmony_ci		for ((var) = 0; (var) < BNX2X_NR_VIRTFN(bp); (var)++)
22362306a36Sopenharmony_ci
22462306a36Sopenharmony_ci#define for_each_vfq(vf, var) \
22562306a36Sopenharmony_ci		for ((var) = 0; (var) < vf_rxq_count(vf); (var)++)
22662306a36Sopenharmony_ci
22762306a36Sopenharmony_ci#define for_each_vf_sb(vf, var) \
22862306a36Sopenharmony_ci		for ((var) = 0; (var) < vf_sb_count(vf); (var)++)
22962306a36Sopenharmony_ci
23062306a36Sopenharmony_ci#define is_vf_multi(vf)	(vf_rxq_count(vf) > 1)
23162306a36Sopenharmony_ci
23262306a36Sopenharmony_ci#define HW_VF_HANDLE(bp, abs_vfid) \
23362306a36Sopenharmony_ci	(u16)(BP_ABS_FUNC((bp)) | (1<<3) |  ((u16)(abs_vfid) << 4))
23462306a36Sopenharmony_ci
23562306a36Sopenharmony_ci#define FW_PF_MAX_HANDLE	8
23662306a36Sopenharmony_ci
23762306a36Sopenharmony_ci#define FW_VF_HANDLE(abs_vfid)	\
23862306a36Sopenharmony_ci	(abs_vfid + FW_PF_MAX_HANDLE)
23962306a36Sopenharmony_ci
24062306a36Sopenharmony_ci#define GET_NUM_VFS_PER_PATH(bp)	64 /* use max possible value */
24162306a36Sopenharmony_ci#define GET_NUM_VFS_PER_PF(bp)		((bp)->vfdb ? (bp)->vfdb->sriov.total \
24262306a36Sopenharmony_ci						    : 0)
24362306a36Sopenharmony_ci#define VF_MAC_CREDIT_CNT		1
24462306a36Sopenharmony_ci#define VF_VLAN_CREDIT_CNT		2 /* VLAN0 + 'real' VLAN */
24562306a36Sopenharmony_ci
24662306a36Sopenharmony_ci/* locking and unlocking the channel mutex */
24762306a36Sopenharmony_civoid bnx2x_lock_vf_pf_channel(struct bnx2x *bp, struct bnx2x_virtf *vf,
24862306a36Sopenharmony_ci			      enum channel_tlvs tlv);
24962306a36Sopenharmony_ci
25062306a36Sopenharmony_civoid bnx2x_unlock_vf_pf_channel(struct bnx2x *bp, struct bnx2x_virtf *vf,
25162306a36Sopenharmony_ci				enum channel_tlvs expected_tlv);
25262306a36Sopenharmony_ci
25362306a36Sopenharmony_ci/* VF mail box (aka vf-pf channel) */
25462306a36Sopenharmony_ci
25562306a36Sopenharmony_ci/* a container for the bi-directional vf<-->pf messages.
25662306a36Sopenharmony_ci *  The actual response will be placed according to the offset parameter
25762306a36Sopenharmony_ci *  provided in the request
25862306a36Sopenharmony_ci */
25962306a36Sopenharmony_ci
26062306a36Sopenharmony_ci#define MBX_MSG_ALIGN	8
26162306a36Sopenharmony_ci#define MBX_MSG_ALIGNED_SIZE	(roundup(sizeof(struct bnx2x_vf_mbx_msg), \
26262306a36Sopenharmony_ci				MBX_MSG_ALIGN))
26362306a36Sopenharmony_ci
26462306a36Sopenharmony_cistruct bnx2x_vf_mbx_msg {
26562306a36Sopenharmony_ci	union vfpf_tlvs req;
26662306a36Sopenharmony_ci	union pfvf_tlvs resp;
26762306a36Sopenharmony_ci};
26862306a36Sopenharmony_ci
26962306a36Sopenharmony_cistruct bnx2x_vf_mbx {
27062306a36Sopenharmony_ci	struct bnx2x_vf_mbx_msg *msg;
27162306a36Sopenharmony_ci	dma_addr_t msg_mapping;
27262306a36Sopenharmony_ci
27362306a36Sopenharmony_ci	/* VF GPA address */
27462306a36Sopenharmony_ci	u32 vf_addr_lo;
27562306a36Sopenharmony_ci	u32 vf_addr_hi;
27662306a36Sopenharmony_ci
27762306a36Sopenharmony_ci	struct vfpf_first_tlv first_tlv;	/* saved VF request header */
27862306a36Sopenharmony_ci};
27962306a36Sopenharmony_ci
28062306a36Sopenharmony_cistruct bnx2x_vf_sp {
28162306a36Sopenharmony_ci	union {
28262306a36Sopenharmony_ci		struct eth_classify_rules_ramrod_data	e2;
28362306a36Sopenharmony_ci	} mac_rdata;
28462306a36Sopenharmony_ci
28562306a36Sopenharmony_ci	union {
28662306a36Sopenharmony_ci		struct eth_classify_rules_ramrod_data	e2;
28762306a36Sopenharmony_ci	} vlan_rdata;
28862306a36Sopenharmony_ci
28962306a36Sopenharmony_ci	union {
29062306a36Sopenharmony_ci		struct eth_classify_rules_ramrod_data	e2;
29162306a36Sopenharmony_ci	} vlan_mac_rdata;
29262306a36Sopenharmony_ci
29362306a36Sopenharmony_ci	union {
29462306a36Sopenharmony_ci		struct eth_filter_rules_ramrod_data	e2;
29562306a36Sopenharmony_ci	} rx_mode_rdata;
29662306a36Sopenharmony_ci
29762306a36Sopenharmony_ci	union {
29862306a36Sopenharmony_ci		struct eth_multicast_rules_ramrod_data  e2;
29962306a36Sopenharmony_ci	} mcast_rdata;
30062306a36Sopenharmony_ci
30162306a36Sopenharmony_ci	union {
30262306a36Sopenharmony_ci		struct client_init_ramrod_data  init_data;
30362306a36Sopenharmony_ci		struct client_update_ramrod_data update_data;
30462306a36Sopenharmony_ci	} q_data;
30562306a36Sopenharmony_ci
30662306a36Sopenharmony_ci	union {
30762306a36Sopenharmony_ci		struct eth_rss_update_ramrod_data e2;
30862306a36Sopenharmony_ci	} rss_rdata;
30962306a36Sopenharmony_ci};
31062306a36Sopenharmony_ci
31162306a36Sopenharmony_cistruct hw_dma {
31262306a36Sopenharmony_ci	void *addr;
31362306a36Sopenharmony_ci	dma_addr_t mapping;
31462306a36Sopenharmony_ci	size_t size;
31562306a36Sopenharmony_ci};
31662306a36Sopenharmony_ci
31762306a36Sopenharmony_cistruct bnx2x_vfdb {
31862306a36Sopenharmony_ci#define BP_VFDB(bp)		((bp)->vfdb)
31962306a36Sopenharmony_ci	/* vf array */
32062306a36Sopenharmony_ci	struct bnx2x_virtf	*vfs;
32162306a36Sopenharmony_ci#define BP_VF(bp, idx)		((BP_VFDB(bp) && (bp)->vfdb->vfs) ? \
32262306a36Sopenharmony_ci					&((bp)->vfdb->vfs[idx]) : NULL)
32362306a36Sopenharmony_ci#define bnx2x_vf(bp, idx, var)	((bp)->vfdb->vfs[idx].var)
32462306a36Sopenharmony_ci
32562306a36Sopenharmony_ci	/* queue array - for all vfs */
32662306a36Sopenharmony_ci	struct bnx2x_vf_queue *vfqs;
32762306a36Sopenharmony_ci
32862306a36Sopenharmony_ci	/* vf HW contexts */
32962306a36Sopenharmony_ci	struct hw_dma		context[BNX2X_VF_CIDS/ILT_PAGE_CIDS];
33062306a36Sopenharmony_ci#define	BP_VF_CXT_PAGE(bp, i)	(&(bp)->vfdb->context[i])
33162306a36Sopenharmony_ci
33262306a36Sopenharmony_ci	/* SR-IOV information */
33362306a36Sopenharmony_ci	struct bnx2x_sriov	sriov;
33462306a36Sopenharmony_ci	struct hw_dma		mbx_dma;
33562306a36Sopenharmony_ci#define BP_VF_MBX_DMA(bp)	(&((bp)->vfdb->mbx_dma))
33662306a36Sopenharmony_ci	struct bnx2x_vf_mbx	mbxs[BNX2X_MAX_NUM_OF_VFS];
33762306a36Sopenharmony_ci#define BP_VF_MBX(bp, vfid)	(&((bp)->vfdb->mbxs[vfid]))
33862306a36Sopenharmony_ci
33962306a36Sopenharmony_ci	struct hw_dma		bulletin_dma;
34062306a36Sopenharmony_ci#define BP_VF_BULLETIN_DMA(bp)	(&((bp)->vfdb->bulletin_dma))
34162306a36Sopenharmony_ci#define	BP_VF_BULLETIN(bp, vf) \
34262306a36Sopenharmony_ci	(((struct pf_vf_bulletin_content *)(BP_VF_BULLETIN_DMA(bp)->addr)) \
34362306a36Sopenharmony_ci	 + (vf))
34462306a36Sopenharmony_ci
34562306a36Sopenharmony_ci	struct hw_dma		sp_dma;
34662306a36Sopenharmony_ci#define bnx2x_vf_sp(bp, vf, field) ((bp)->vfdb->sp_dma.addr +		\
34762306a36Sopenharmony_ci		(vf)->index * sizeof(struct bnx2x_vf_sp) +		\
34862306a36Sopenharmony_ci		offsetof(struct bnx2x_vf_sp, field))
34962306a36Sopenharmony_ci#define bnx2x_vf_sp_map(bp, vf, field) ((bp)->vfdb->sp_dma.mapping +	\
35062306a36Sopenharmony_ci		(vf)->index * sizeof(struct bnx2x_vf_sp) +		\
35162306a36Sopenharmony_ci		offsetof(struct bnx2x_vf_sp, field))
35262306a36Sopenharmony_ci
35362306a36Sopenharmony_ci#define FLRD_VFS_DWORDS (BNX2X_MAX_NUM_OF_VFS / 32)
35462306a36Sopenharmony_ci	u32 flrd_vfs[FLRD_VFS_DWORDS];
35562306a36Sopenharmony_ci
35662306a36Sopenharmony_ci	/* the number of msix vectors belonging to this PF designated for VFs */
35762306a36Sopenharmony_ci	u16 vf_sbs_pool;
35862306a36Sopenharmony_ci	u16 first_vf_igu_entry;
35962306a36Sopenharmony_ci
36062306a36Sopenharmony_ci	/* sp_rtnl synchronization */
36162306a36Sopenharmony_ci	struct mutex			event_mutex;
36262306a36Sopenharmony_ci	u64				event_occur;
36362306a36Sopenharmony_ci
36462306a36Sopenharmony_ci	/* bulletin board update synchronization */
36562306a36Sopenharmony_ci	struct mutex			bulletin_mutex;
36662306a36Sopenharmony_ci};
36762306a36Sopenharmony_ci
36862306a36Sopenharmony_ci/* queue access */
36962306a36Sopenharmony_cistatic inline struct bnx2x_vf_queue *vfq_get(struct bnx2x_virtf *vf, u8 index)
37062306a36Sopenharmony_ci{
37162306a36Sopenharmony_ci	return &(vf->vfqs[index]);
37262306a36Sopenharmony_ci}
37362306a36Sopenharmony_ci
37462306a36Sopenharmony_ci/* FW ids */
37562306a36Sopenharmony_cistatic inline u8 vf_igu_sb(struct bnx2x_virtf *vf, u16 sb_idx)
37662306a36Sopenharmony_ci{
37762306a36Sopenharmony_ci	return vf->igu_base_id + sb_idx;
37862306a36Sopenharmony_ci}
37962306a36Sopenharmony_ci
38062306a36Sopenharmony_cistatic inline u8 vf_hc_qzone(struct bnx2x_virtf *vf, u16 sb_idx)
38162306a36Sopenharmony_ci{
38262306a36Sopenharmony_ci	return vf_igu_sb(vf, sb_idx);
38362306a36Sopenharmony_ci}
38462306a36Sopenharmony_ci
38562306a36Sopenharmony_cistatic u8 vfq_cl_id(struct bnx2x_virtf *vf, struct bnx2x_vf_queue *q)
38662306a36Sopenharmony_ci{
38762306a36Sopenharmony_ci	return vf->igu_base_id + q->index;
38862306a36Sopenharmony_ci}
38962306a36Sopenharmony_ci
39062306a36Sopenharmony_cistatic inline u8 vfq_stat_id(struct bnx2x_virtf *vf, struct bnx2x_vf_queue *q)
39162306a36Sopenharmony_ci{
39262306a36Sopenharmony_ci	if (vf->cfg_flags & VF_CFG_STATS_COALESCE)
39362306a36Sopenharmony_ci		return vf->leading_rss;
39462306a36Sopenharmony_ci	else
39562306a36Sopenharmony_ci		return vfq_cl_id(vf, q);
39662306a36Sopenharmony_ci}
39762306a36Sopenharmony_ci
39862306a36Sopenharmony_cistatic inline u8 vfq_qzone_id(struct bnx2x_virtf *vf, struct bnx2x_vf_queue *q)
39962306a36Sopenharmony_ci{
40062306a36Sopenharmony_ci	return vfq_cl_id(vf, q);
40162306a36Sopenharmony_ci}
40262306a36Sopenharmony_ci
40362306a36Sopenharmony_ci/* global iov routines */
40462306a36Sopenharmony_ciint bnx2x_iov_init_ilt(struct bnx2x *bp, u16 line);
40562306a36Sopenharmony_ciint bnx2x_iov_init_one(struct bnx2x *bp, int int_mode_param, int num_vfs_param);
40662306a36Sopenharmony_civoid bnx2x_iov_remove_one(struct bnx2x *bp);
40762306a36Sopenharmony_civoid bnx2x_iov_free_mem(struct bnx2x *bp);
40862306a36Sopenharmony_ciint bnx2x_iov_alloc_mem(struct bnx2x *bp);
40962306a36Sopenharmony_ciint bnx2x_iov_nic_init(struct bnx2x *bp);
41062306a36Sopenharmony_ciint bnx2x_iov_chip_cleanup(struct bnx2x *bp);
41162306a36Sopenharmony_civoid bnx2x_iov_init_dq(struct bnx2x *bp);
41262306a36Sopenharmony_civoid bnx2x_iov_init_dmae(struct bnx2x *bp);
41362306a36Sopenharmony_civoid bnx2x_iov_set_queue_sp_obj(struct bnx2x *bp, int vf_cid,
41462306a36Sopenharmony_ci				struct bnx2x_queue_sp_obj **q_obj);
41562306a36Sopenharmony_ciint bnx2x_iov_eq_sp_event(struct bnx2x *bp, union event_ring_elem *elem);
41662306a36Sopenharmony_civoid bnx2x_iov_adjust_stats_req(struct bnx2x *bp);
41762306a36Sopenharmony_civoid bnx2x_iov_storm_stats_update(struct bnx2x *bp);
41862306a36Sopenharmony_ci/* global vf mailbox routines */
41962306a36Sopenharmony_civoid bnx2x_vf_mbx(struct bnx2x *bp);
42062306a36Sopenharmony_civoid bnx2x_vf_mbx_schedule(struct bnx2x *bp,
42162306a36Sopenharmony_ci			   struct vf_pf_event_data *vfpf_event);
42262306a36Sopenharmony_civoid bnx2x_vf_enable_mbx(struct bnx2x *bp, u8 abs_vfid);
42362306a36Sopenharmony_ci
42462306a36Sopenharmony_ci/* CORE VF API */
42562306a36Sopenharmony_citypedef u8 bnx2x_mac_addr_t[ETH_ALEN];
42662306a36Sopenharmony_ci
42762306a36Sopenharmony_ci/* acquire */
42862306a36Sopenharmony_ciint bnx2x_vf_acquire(struct bnx2x *bp, struct bnx2x_virtf *vf,
42962306a36Sopenharmony_ci		     struct vf_pf_resc_request *resc);
43062306a36Sopenharmony_ci/* init */
43162306a36Sopenharmony_ciint bnx2x_vf_init(struct bnx2x *bp, struct bnx2x_virtf *vf,
43262306a36Sopenharmony_ci		  dma_addr_t *sb_map);
43362306a36Sopenharmony_ci
43462306a36Sopenharmony_ci/* VFOP queue construction helpers */
43562306a36Sopenharmony_civoid bnx2x_vfop_qctor_dump_tx(struct bnx2x *bp, struct bnx2x_virtf *vf,
43662306a36Sopenharmony_ci			    struct bnx2x_queue_init_params *init_params,
43762306a36Sopenharmony_ci			    struct bnx2x_queue_setup_params *setup_params,
43862306a36Sopenharmony_ci			    u16 q_idx, u16 sb_idx);
43962306a36Sopenharmony_ci
44062306a36Sopenharmony_civoid bnx2x_vfop_qctor_dump_rx(struct bnx2x *bp, struct bnx2x_virtf *vf,
44162306a36Sopenharmony_ci			    struct bnx2x_queue_init_params *init_params,
44262306a36Sopenharmony_ci			    struct bnx2x_queue_setup_params *setup_params,
44362306a36Sopenharmony_ci			    u16 q_idx, u16 sb_idx);
44462306a36Sopenharmony_ci
44562306a36Sopenharmony_civoid bnx2x_vfop_qctor_prep(struct bnx2x *bp,
44662306a36Sopenharmony_ci			   struct bnx2x_virtf *vf,
44762306a36Sopenharmony_ci			   struct bnx2x_vf_queue *q,
44862306a36Sopenharmony_ci			   struct bnx2x_vf_queue_construct_params *p,
44962306a36Sopenharmony_ci			   unsigned long q_type);
45062306a36Sopenharmony_ci
45162306a36Sopenharmony_ciint bnx2x_vf_mac_vlan_config_list(struct bnx2x *bp, struct bnx2x_virtf *vf,
45262306a36Sopenharmony_ci				  struct bnx2x_vf_mac_vlan_filters *filters,
45362306a36Sopenharmony_ci				  int qid, bool drv_only);
45462306a36Sopenharmony_ci
45562306a36Sopenharmony_ciint bnx2x_vf_queue_setup(struct bnx2x *bp, struct bnx2x_virtf *vf, int qid,
45662306a36Sopenharmony_ci			 struct bnx2x_vf_queue_construct_params *qctor);
45762306a36Sopenharmony_ci
45862306a36Sopenharmony_ciint bnx2x_vf_queue_teardown(struct bnx2x *bp, struct bnx2x_virtf *vf, int qid);
45962306a36Sopenharmony_ci
46062306a36Sopenharmony_ciint bnx2x_vf_mcast(struct bnx2x *bp, struct bnx2x_virtf *vf,
46162306a36Sopenharmony_ci		   bnx2x_mac_addr_t *mcasts, int mc_num, bool drv_only);
46262306a36Sopenharmony_ci
46362306a36Sopenharmony_ciint bnx2x_vf_rxmode(struct bnx2x *bp, struct bnx2x_virtf *vf,
46462306a36Sopenharmony_ci		    int qid, unsigned long accept_flags);
46562306a36Sopenharmony_ci
46662306a36Sopenharmony_ciint bnx2x_vf_close(struct bnx2x *bp, struct bnx2x_virtf *vf);
46762306a36Sopenharmony_ci
46862306a36Sopenharmony_ciint bnx2x_vf_free(struct bnx2x *bp, struct bnx2x_virtf *vf);
46962306a36Sopenharmony_ci
47062306a36Sopenharmony_ciint bnx2x_vf_rss_update(struct bnx2x *bp, struct bnx2x_virtf *vf,
47162306a36Sopenharmony_ci			struct bnx2x_config_rss_params *rss);
47262306a36Sopenharmony_ci
47362306a36Sopenharmony_ciint bnx2x_vf_tpa_update(struct bnx2x *bp, struct bnx2x_virtf *vf,
47462306a36Sopenharmony_ci			struct vfpf_tpa_tlv *tlv,
47562306a36Sopenharmony_ci			struct bnx2x_queue_update_tpa_params *params);
47662306a36Sopenharmony_ci
47762306a36Sopenharmony_ci/* VF release ~ VF close + VF release-resources
47862306a36Sopenharmony_ci *
47962306a36Sopenharmony_ci * Release is the ultimate SW shutdown and is called whenever an
48062306a36Sopenharmony_ci * irrecoverable error is encountered.
48162306a36Sopenharmony_ci */
48262306a36Sopenharmony_ciint bnx2x_vf_release(struct bnx2x *bp, struct bnx2x_virtf *vf);
48362306a36Sopenharmony_ciint bnx2x_vf_idx_by_abs_fid(struct bnx2x *bp, u16 abs_vfid);
48462306a36Sopenharmony_ciu8 bnx2x_vf_max_queue_cnt(struct bnx2x *bp, struct bnx2x_virtf *vf);
48562306a36Sopenharmony_ci
48662306a36Sopenharmony_ci/* FLR routines */
48762306a36Sopenharmony_ci
48862306a36Sopenharmony_ci/* VF FLR helpers */
48962306a36Sopenharmony_ciint bnx2x_vf_flr_clnup_epilog(struct bnx2x *bp, u8 abs_vfid);
49062306a36Sopenharmony_civoid bnx2x_vf_enable_access(struct bnx2x *bp, u8 abs_vfid);
49162306a36Sopenharmony_ci
49262306a36Sopenharmony_ci/* Handles an FLR (or VF_DISABLE) notification form the MCP */
49362306a36Sopenharmony_civoid bnx2x_vf_handle_flr_event(struct bnx2x *bp);
49462306a36Sopenharmony_ci
49562306a36Sopenharmony_cibool bnx2x_tlv_supported(u16 tlvtype);
49662306a36Sopenharmony_ci
49762306a36Sopenharmony_ciu32 bnx2x_crc_vf_bulletin(struct pf_vf_bulletin_content *bulletin);
49862306a36Sopenharmony_ciint bnx2x_post_vf_bulletin(struct bnx2x *bp, int vf);
49962306a36Sopenharmony_civoid bnx2x_vf_bulletin_finalize(struct pf_vf_bulletin_content *bulletin,
50062306a36Sopenharmony_ci				bool support_long);
50162306a36Sopenharmony_ci
50262306a36Sopenharmony_cienum sample_bulletin_result bnx2x_sample_bulletin(struct bnx2x *bp);
50362306a36Sopenharmony_ci
50462306a36Sopenharmony_ci/* VF side vfpf channel functions */
50562306a36Sopenharmony_ciint bnx2x_vfpf_acquire(struct bnx2x *bp, u8 tx_count, u8 rx_count);
50662306a36Sopenharmony_ciint bnx2x_vfpf_release(struct bnx2x *bp);
50762306a36Sopenharmony_ciint bnx2x_vfpf_init(struct bnx2x *bp);
50862306a36Sopenharmony_civoid bnx2x_vfpf_close_vf(struct bnx2x *bp);
50962306a36Sopenharmony_ciint bnx2x_vfpf_setup_q(struct bnx2x *bp, struct bnx2x_fastpath *fp,
51062306a36Sopenharmony_ci		       bool is_leading);
51162306a36Sopenharmony_ciint bnx2x_vfpf_config_mac(struct bnx2x *bp, const u8 *addr, u8 vf_qid,
51262306a36Sopenharmony_ci			  bool set);
51362306a36Sopenharmony_ciint bnx2x_vfpf_config_rss(struct bnx2x *bp,
51462306a36Sopenharmony_ci			  struct bnx2x_config_rss_params *params);
51562306a36Sopenharmony_ciint bnx2x_vfpf_set_mcast(struct net_device *dev);
51662306a36Sopenharmony_ciint bnx2x_vfpf_storm_rx_mode(struct bnx2x *bp);
51762306a36Sopenharmony_ci
51862306a36Sopenharmony_cistatic inline void bnx2x_vf_fill_fw_str(struct bnx2x *bp, char *buf,
51962306a36Sopenharmony_ci					size_t buf_len)
52062306a36Sopenharmony_ci{
52162306a36Sopenharmony_ci	strscpy(buf, bp->acquire_resp.pfdev_info.fw_ver, buf_len);
52262306a36Sopenharmony_ci}
52362306a36Sopenharmony_ci
52462306a36Sopenharmony_cistatic inline int bnx2x_vf_ustorm_prods_offset(struct bnx2x *bp,
52562306a36Sopenharmony_ci					       struct bnx2x_fastpath *fp)
52662306a36Sopenharmony_ci{
52762306a36Sopenharmony_ci	return PXP_VF_ADDR_USDM_QUEUES_START +
52862306a36Sopenharmony_ci		bp->acquire_resp.resc.hw_qid[fp->index] *
52962306a36Sopenharmony_ci		sizeof(struct ustorm_queue_zone_data);
53062306a36Sopenharmony_ci}
53162306a36Sopenharmony_ci
53262306a36Sopenharmony_cienum sample_bulletin_result bnx2x_sample_bulletin(struct bnx2x *bp);
53362306a36Sopenharmony_civoid bnx2x_timer_sriov(struct bnx2x *bp);
53462306a36Sopenharmony_civoid __iomem *bnx2x_vf_doorbells(struct bnx2x *bp);
53562306a36Sopenharmony_civoid bnx2x_vf_pci_dealloc(struct bnx2x *bp);
53662306a36Sopenharmony_ciint bnx2x_vf_pci_alloc(struct bnx2x *bp);
53762306a36Sopenharmony_ciint bnx2x_enable_sriov(struct bnx2x *bp);
53862306a36Sopenharmony_civoid bnx2x_disable_sriov(struct bnx2x *bp);
53962306a36Sopenharmony_cistatic inline int bnx2x_vf_headroom(struct bnx2x *bp)
54062306a36Sopenharmony_ci{
54162306a36Sopenharmony_ci	return bp->vfdb->sriov.nr_virtfn * BNX2X_CIDS_PER_VF;
54262306a36Sopenharmony_ci}
54362306a36Sopenharmony_civoid bnx2x_pf_set_vfs_vlan(struct bnx2x *bp);
54462306a36Sopenharmony_ciint bnx2x_sriov_configure(struct pci_dev *dev, int num_vfs);
54562306a36Sopenharmony_civoid bnx2x_iov_channel_down(struct bnx2x *bp);
54662306a36Sopenharmony_ci
54762306a36Sopenharmony_civoid bnx2x_iov_task(struct work_struct *work);
54862306a36Sopenharmony_ci
54962306a36Sopenharmony_civoid bnx2x_schedule_iov_task(struct bnx2x *bp, enum bnx2x_iov_flag flag);
55062306a36Sopenharmony_ci
55162306a36Sopenharmony_civoid bnx2x_iov_link_update(struct bnx2x *bp);
55262306a36Sopenharmony_ciint bnx2x_iov_link_update_vf(struct bnx2x *bp, int idx);
55362306a36Sopenharmony_ci
55462306a36Sopenharmony_ciint bnx2x_set_vf_link_state(struct net_device *dev, int vf, int link_state);
55562306a36Sopenharmony_ci
55662306a36Sopenharmony_ciint bnx2x_vfpf_update_vlan(struct bnx2x *bp, u16 vid, u8 vf_qid, bool add);
55762306a36Sopenharmony_ci#else /* CONFIG_BNX2X_SRIOV */
55862306a36Sopenharmony_ci
55962306a36Sopenharmony_ci#define GET_NUM_VFS_PER_PATH(bp)	0
56062306a36Sopenharmony_ci#define GET_NUM_VFS_PER_PF(bp)		0
56162306a36Sopenharmony_ci#define VF_MAC_CREDIT_CNT		0
56262306a36Sopenharmony_ci#define VF_VLAN_CREDIT_CNT		0
56362306a36Sopenharmony_ci
56462306a36Sopenharmony_cistatic inline void bnx2x_iov_set_queue_sp_obj(struct bnx2x *bp, int vf_cid,
56562306a36Sopenharmony_ci				struct bnx2x_queue_sp_obj **q_obj) {}
56662306a36Sopenharmony_cistatic inline void bnx2x_vf_handle_flr_event(struct bnx2x *bp) {}
56762306a36Sopenharmony_cistatic inline int bnx2x_iov_eq_sp_event(struct bnx2x *bp,
56862306a36Sopenharmony_ci					union event_ring_elem *elem) {return 1; }
56962306a36Sopenharmony_cistatic inline void bnx2x_vf_mbx(struct bnx2x *bp) {}
57062306a36Sopenharmony_cistatic inline void bnx2x_vf_mbx_schedule(struct bnx2x *bp,
57162306a36Sopenharmony_ci					 struct vf_pf_event_data *vfpf_event) {}
57262306a36Sopenharmony_cistatic inline int bnx2x_iov_init_ilt(struct bnx2x *bp, u16 line) {return line; }
57362306a36Sopenharmony_cistatic inline void bnx2x_iov_init_dq(struct bnx2x *bp) {}
57462306a36Sopenharmony_cistatic inline int bnx2x_iov_alloc_mem(struct bnx2x *bp) {return 0; }
57562306a36Sopenharmony_cistatic inline void bnx2x_iov_free_mem(struct bnx2x *bp) {}
57662306a36Sopenharmony_cistatic inline int bnx2x_iov_chip_cleanup(struct bnx2x *bp) {return 0; }
57762306a36Sopenharmony_cistatic inline void bnx2x_iov_init_dmae(struct bnx2x *bp) {}
57862306a36Sopenharmony_cistatic inline int bnx2x_iov_init_one(struct bnx2x *bp, int int_mode_param,
57962306a36Sopenharmony_ci				     int num_vfs_param) {return 0; }
58062306a36Sopenharmony_cistatic inline void bnx2x_iov_remove_one(struct bnx2x *bp) {}
58162306a36Sopenharmony_cistatic inline int bnx2x_enable_sriov(struct bnx2x *bp) {return 0; }
58262306a36Sopenharmony_cistatic inline void bnx2x_disable_sriov(struct bnx2x *bp) {}
58362306a36Sopenharmony_cistatic inline int bnx2x_vfpf_acquire(struct bnx2x *bp,
58462306a36Sopenharmony_ci				     u8 tx_count, u8 rx_count) {return 0; }
58562306a36Sopenharmony_cistatic inline int bnx2x_vfpf_release(struct bnx2x *bp) {return 0; }
58662306a36Sopenharmony_cistatic inline int bnx2x_vfpf_init(struct bnx2x *bp) {return 0; }
58762306a36Sopenharmony_cistatic inline void bnx2x_vfpf_close_vf(struct bnx2x *bp) {}
58862306a36Sopenharmony_cistatic inline int bnx2x_vfpf_setup_q(struct bnx2x *bp, struct bnx2x_fastpath *fp, bool is_leading) {return 0; }
58962306a36Sopenharmony_cistatic inline int bnx2x_vfpf_config_mac(struct bnx2x *bp, const u8 *addr,
59062306a36Sopenharmony_ci					u8 vf_qid, bool set) {return 0; }
59162306a36Sopenharmony_cistatic inline int bnx2x_vfpf_config_rss(struct bnx2x *bp,
59262306a36Sopenharmony_ci					struct bnx2x_config_rss_params *params) {return 0; }
59362306a36Sopenharmony_cistatic inline int bnx2x_vfpf_set_mcast(struct net_device *dev) {return 0; }
59462306a36Sopenharmony_cistatic inline int bnx2x_vfpf_storm_rx_mode(struct bnx2x *bp) {return 0; }
59562306a36Sopenharmony_cistatic inline int bnx2x_iov_nic_init(struct bnx2x *bp) {return 0; }
59662306a36Sopenharmony_cistatic inline int bnx2x_vf_headroom(struct bnx2x *bp) {return 0; }
59762306a36Sopenharmony_cistatic inline void bnx2x_iov_adjust_stats_req(struct bnx2x *bp) {}
59862306a36Sopenharmony_cistatic inline void bnx2x_vf_fill_fw_str(struct bnx2x *bp, char *buf,
59962306a36Sopenharmony_ci					size_t buf_len) {}
60062306a36Sopenharmony_cistatic inline int bnx2x_vf_ustorm_prods_offset(struct bnx2x *bp,
60162306a36Sopenharmony_ci					       struct bnx2x_fastpath *fp) {return 0; }
60262306a36Sopenharmony_cistatic inline enum sample_bulletin_result bnx2x_sample_bulletin(struct bnx2x *bp)
60362306a36Sopenharmony_ci{
60462306a36Sopenharmony_ci	return PFVF_BULLETIN_UNCHANGED;
60562306a36Sopenharmony_ci}
60662306a36Sopenharmony_cistatic inline void bnx2x_timer_sriov(struct bnx2x *bp) {}
60762306a36Sopenharmony_ci
60862306a36Sopenharmony_cistatic inline void __iomem *bnx2x_vf_doorbells(struct bnx2x *bp)
60962306a36Sopenharmony_ci{
61062306a36Sopenharmony_ci	return NULL;
61162306a36Sopenharmony_ci}
61262306a36Sopenharmony_ci
61362306a36Sopenharmony_cistatic inline void bnx2x_vf_pci_dealloc(struct bnx2x *bp) {}
61462306a36Sopenharmony_cistatic inline int bnx2x_vf_pci_alloc(struct bnx2x *bp) {return 0; }
61562306a36Sopenharmony_cistatic inline void bnx2x_pf_set_vfs_vlan(struct bnx2x *bp) {}
61662306a36Sopenharmony_cistatic inline int bnx2x_sriov_configure(struct pci_dev *dev, int num_vfs) {return 0; }
61762306a36Sopenharmony_cistatic inline void bnx2x_iov_channel_down(struct bnx2x *bp) {}
61862306a36Sopenharmony_ci
61962306a36Sopenharmony_cistatic inline void bnx2x_iov_task(struct work_struct *work) {}
62062306a36Sopenharmony_cistatic inline void bnx2x_schedule_iov_task(struct bnx2x *bp, enum bnx2x_iov_flag flag) {}
62162306a36Sopenharmony_cistatic inline void bnx2x_iov_link_update(struct bnx2x *bp) {}
62262306a36Sopenharmony_cistatic inline int bnx2x_iov_link_update_vf(struct bnx2x *bp, int idx) {return 0; }
62362306a36Sopenharmony_ci
62462306a36Sopenharmony_cistatic inline int bnx2x_set_vf_link_state(struct net_device *dev, int vf,
62562306a36Sopenharmony_ci					  int link_state) {return 0; }
62662306a36Sopenharmony_cistruct pf_vf_bulletin_content;
62762306a36Sopenharmony_cistatic inline void bnx2x_vf_bulletin_finalize(struct pf_vf_bulletin_content *bulletin,
62862306a36Sopenharmony_ci					      bool support_long) {}
62962306a36Sopenharmony_ci
63062306a36Sopenharmony_cistatic inline int bnx2x_vfpf_update_vlan(struct bnx2x *bp, u16 vid, u8 vf_qid, bool add) {return 0; }
63162306a36Sopenharmony_ci
63262306a36Sopenharmony_ci#endif /* CONFIG_BNX2X_SRIOV */
63362306a36Sopenharmony_ci#endif /* bnx2x_sriov.h */
634