1/* bnx2x_sriov.h: Broadcom Everest network driver.
2 *
3 * Copyright 2009-2013 Broadcom Corporation
4 *
5 * Unless you and Broadcom execute a separate written software license
6 * agreement governing use of this software, this software is licensed to you
7 * under the terms of the GNU General Public License version 2, available
8 * at http://www.gnu.org/licenses/old-licenses/gpl-2.0.html (the "GPL").
9 *
10 * Notwithstanding the above, under no circumstances may you combine this
11 * software in any way with any other Broadcom software provided under a
12 * license other than the GPL, without Broadcom's express prior written
13 * consent.
14 *
15 * Maintained by: Ariel Elior <ariel.elior@qlogic.com>
16 * Written by: Shmulik Ravid
17 *	       Ariel Elior <ariel.elior@qlogic.com>
18 */
19#ifndef BNX2X_SRIOV_H
20#define BNX2X_SRIOV_H
21
22#include "bnx2x_vfpf.h"
23#include "bnx2x.h"
24
25enum sample_bulletin_result {
26	   PFVF_BULLETIN_UNCHANGED,
27	   PFVF_BULLETIN_UPDATED,
28	   PFVF_BULLETIN_CRC_ERR
29};
30
31#ifdef CONFIG_BNX2X_SRIOV
32
33extern struct workqueue_struct *bnx2x_iov_wq;
34
35/* The bnx2x device structure holds vfdb structure described below.
36 * The VF array is indexed by the relative vfid.
37 */
38#define BNX2X_VF_MAX_QUEUES		16
39#define BNX2X_VF_MAX_TPA_AGG_QUEUES	8
40
41struct bnx2x_sriov {
42	u32 first_vf_in_pf;
43
44	/* standard SRIOV capability fields, mostly for debugging */
45	int pos;		/* capability position */
46	int nres;		/* number of resources */
47	u32 cap;		/* SR-IOV Capabilities */
48	u16 ctrl;		/* SR-IOV Control */
49	u16 total;		/* total VFs associated with the PF */
50	u16 initial;		/* initial VFs associated with the PF */
51	u16 nr_virtfn;		/* number of VFs available */
52	u16 offset;		/* first VF Routing ID offset */
53	u16 stride;		/* following VF stride */
54	u32 pgsz;		/* page size for BAR alignment */
55	u8 link;		/* Function Dependency Link */
56};
57
58/* bars */
59struct bnx2x_vf_bar {
60	u64 bar;
61	u32 size;
62};
63
64struct bnx2x_vf_bar_info {
65	struct bnx2x_vf_bar bars[PCI_SRIOV_NUM_BARS];
66	u8 nr_bars;
67};
68
69/* vf queue (used both for rx or tx) */
70struct bnx2x_vf_queue {
71	struct eth_context		*cxt;
72
73	/* MACs object */
74	struct bnx2x_vlan_mac_obj	mac_obj;
75
76	/* VLANs object */
77	struct bnx2x_vlan_mac_obj	vlan_obj;
78	atomic_t vlan_count;		/* 0 means vlan-0 is set  ~ untagged */
79	unsigned long accept_flags;	/* last accept flags configured */
80
81	/* Queue Slow-path State object */
82	struct bnx2x_queue_sp_obj	sp_obj;
83
84	u32 cid;
85	u16 index;
86	u16 sb_idx;
87	bool is_leading;
88	bool sp_initialized;
89};
90
91/* struct bnx2x_vf_queue_construct_params - prepare queue construction
92 * parameters: q-init, q-setup and SB index
93 */
94struct bnx2x_vf_queue_construct_params {
95	struct bnx2x_queue_state_params		qstate;
96	struct bnx2x_queue_setup_params		prep_qsetup;
97};
98
99/* forward */
100struct bnx2x_virtf;
101
102/* VFOP definitions */
103
104struct bnx2x_vf_mac_vlan_filter {
105	int type;
106#define BNX2X_VF_FILTER_MAC	1
107#define BNX2X_VF_FILTER_VLAN	2
108
109	bool add;
110	u8 *mac;
111	u16 vid;
112};
113
114struct bnx2x_vf_mac_vlan_filters {
115	int count;
116	struct bnx2x_vf_mac_vlan_filter filters[];
117};
118
119/* vf context */
120struct bnx2x_virtf {
121	u16 cfg_flags;
122#define VF_CFG_STATS		0x0001
123#define VF_CFG_FW_FC		0x0002
124#define VF_CFG_TPA		0x0004
125#define VF_CFG_INT_SIMD		0x0008
126#define VF_CACHE_LINE		0x0010
127#define VF_CFG_VLAN		0x0020
128#define VF_CFG_STATS_COALESCE	0x0040
129#define VF_CFG_EXT_BULLETIN	0x0080
130	u8 link_cfg;		/* IFLA_VF_LINK_STATE_AUTO
131				 * IFLA_VF_LINK_STATE_ENABLE
132				 * IFLA_VF_LINK_STATE_DISABLE
133				 */
134	u8 state;
135#define VF_FREE		0	/* VF ready to be acquired holds no resc */
136#define VF_ACQUIRED	1	/* VF acquired, but not initialized */
137#define VF_ENABLED	2	/* VF Enabled */
138#define VF_RESET	3	/* VF FLR'd, pending cleanup */
139
140	bool flr_clnup_stage;	/* true during flr cleanup */
141
142	/* dma */
143	dma_addr_t fw_stat_map;		/* valid iff VF_CFG_STATS */
144	u16 stats_stride;
145	dma_addr_t spq_map;
146	dma_addr_t bulletin_map;
147
148	/* Allocated resources counters. Before the VF is acquired, the
149	 * counters hold the following values:
150	 *
151	 * - xxq_count = 0 as the queues memory is not allocated yet.
152	 *
153	 * - sb_count  = The number of status blocks configured for this VF in
154	 *		 the IGU CAM. Initially read during probe.
155	 *
156	 * - xx_rules_count = The number of rules statically and equally
157	 *		      allocated for each VF, during PF load.
158	 */
159	struct vf_pf_resc_request	alloc_resc;
160#define vf_rxq_count(vf)		((vf)->alloc_resc.num_rxqs)
161#define vf_txq_count(vf)		((vf)->alloc_resc.num_txqs)
162#define vf_sb_count(vf)			((vf)->alloc_resc.num_sbs)
163#define vf_mac_rules_cnt(vf)		((vf)->alloc_resc.num_mac_filters)
164#define vf_vlan_rules_cnt(vf)		((vf)->alloc_resc.num_vlan_filters)
165#define vf_mc_rules_cnt(vf)		((vf)->alloc_resc.num_mc_filters)
166	/* Hide a single vlan filter credit for the hypervisor */
167#define vf_vlan_rules_visible_cnt(vf)	(vf_vlan_rules_cnt(vf) - 1)
168
169	u8 sb_count;	/* actual number of SBs */
170	u8 igu_base_id;	/* base igu status block id */
171
172	struct bnx2x_vf_queue	*vfqs;
173#define LEADING_IDX			0
174#define bnx2x_vfq_is_leading(vfq)	((vfq)->index == LEADING_IDX)
175#define bnx2x_vfq(vf, nr, var)		((vf)->vfqs[(nr)].var)
176#define bnx2x_leading_vfq(vf, var)	((vf)->vfqs[LEADING_IDX].var)
177
178	u8 index;	/* index in the vf array */
179	u8 abs_vfid;
180	u8 sp_cl_id;
181	u32 error;	/* 0 means all's-well */
182
183	/* BDF */
184	unsigned int bus;
185	unsigned int devfn;
186
187	/* bars */
188	struct bnx2x_vf_bar bars[PCI_SRIOV_NUM_BARS];
189
190	/* set-mac ramrod state 1-pending, 0-done */
191	unsigned long	filter_state;
192
193	/* leading rss client id ~~ the client id of the first rxq, must be
194	 * set for each txq.
195	 */
196	int leading_rss;
197
198	/* MCAST object */
199	int mcast_list_len;
200	struct bnx2x_mcast_obj		mcast_obj;
201
202	/* RSS configuration object */
203	struct bnx2x_rss_config_obj     rss_conf_obj;
204
205	/* slow-path operations */
206	struct mutex			op_mutex; /* one vfop at a time mutex */
207	enum channel_tlvs		op_current;
208
209	u8 fp_hsi;
210};
211
212#define BNX2X_NR_VIRTFN(bp)	((bp)->vfdb->sriov.nr_virtfn)
213
214#define for_each_vf(bp, var) \
215		for ((var) = 0; (var) < BNX2X_NR_VIRTFN(bp); (var)++)
216
217#define for_each_vfq(vf, var) \
218		for ((var) = 0; (var) < vf_rxq_count(vf); (var)++)
219
220#define for_each_vf_sb(vf, var) \
221		for ((var) = 0; (var) < vf_sb_count(vf); (var)++)
222
223#define is_vf_multi(vf)	(vf_rxq_count(vf) > 1)
224
225#define HW_VF_HANDLE(bp, abs_vfid) \
226	(u16)(BP_ABS_FUNC((bp)) | (1<<3) |  ((u16)(abs_vfid) << 4))
227
228#define FW_PF_MAX_HANDLE	8
229
230#define FW_VF_HANDLE(abs_vfid)	\
231	(abs_vfid + FW_PF_MAX_HANDLE)
232
233/* locking and unlocking the channel mutex */
234void bnx2x_lock_vf_pf_channel(struct bnx2x *bp, struct bnx2x_virtf *vf,
235			      enum channel_tlvs tlv);
236
237void bnx2x_unlock_vf_pf_channel(struct bnx2x *bp, struct bnx2x_virtf *vf,
238				enum channel_tlvs expected_tlv);
239
240/* VF mail box (aka vf-pf channel) */
241
242/* a container for the bi-directional vf<-->pf messages.
243 *  The actual response will be placed according to the offset parameter
244 *  provided in the request
245 */
246
247#define MBX_MSG_ALIGN	8
248#define MBX_MSG_ALIGNED_SIZE	(roundup(sizeof(struct bnx2x_vf_mbx_msg), \
249				MBX_MSG_ALIGN))
250
251struct bnx2x_vf_mbx_msg {
252	union vfpf_tlvs req;
253	union pfvf_tlvs resp;
254};
255
256struct bnx2x_vf_mbx {
257	struct bnx2x_vf_mbx_msg *msg;
258	dma_addr_t msg_mapping;
259
260	/* VF GPA address */
261	u32 vf_addr_lo;
262	u32 vf_addr_hi;
263
264	struct vfpf_first_tlv first_tlv;	/* saved VF request header */
265};
266
267struct bnx2x_vf_sp {
268	union {
269		struct eth_classify_rules_ramrod_data	e2;
270	} mac_rdata;
271
272	union {
273		struct eth_classify_rules_ramrod_data	e2;
274	} vlan_rdata;
275
276	union {
277		struct eth_filter_rules_ramrod_data	e2;
278	} rx_mode_rdata;
279
280	union {
281		struct eth_multicast_rules_ramrod_data  e2;
282	} mcast_rdata;
283
284	union {
285		struct client_init_ramrod_data  init_data;
286		struct client_update_ramrod_data update_data;
287	} q_data;
288
289	union {
290		struct eth_rss_update_ramrod_data e2;
291	} rss_rdata;
292};
293
294struct hw_dma {
295	void *addr;
296	dma_addr_t mapping;
297	size_t size;
298};
299
300struct bnx2x_vfdb {
301#define BP_VFDB(bp)		((bp)->vfdb)
302	/* vf array */
303	struct bnx2x_virtf	*vfs;
304#define BP_VF(bp, idx)		((BP_VFDB(bp) && (bp)->vfdb->vfs) ? \
305					&((bp)->vfdb->vfs[idx]) : NULL)
306#define bnx2x_vf(bp, idx, var)	((bp)->vfdb->vfs[idx].var)
307
308	/* queue array - for all vfs */
309	struct bnx2x_vf_queue *vfqs;
310
311	/* vf HW contexts */
312	struct hw_dma		context[BNX2X_VF_CIDS/ILT_PAGE_CIDS];
313#define	BP_VF_CXT_PAGE(bp, i)	(&(bp)->vfdb->context[i])
314
315	/* SR-IOV information */
316	struct bnx2x_sriov	sriov;
317	struct hw_dma		mbx_dma;
318#define BP_VF_MBX_DMA(bp)	(&((bp)->vfdb->mbx_dma))
319	struct bnx2x_vf_mbx	mbxs[BNX2X_MAX_NUM_OF_VFS];
320#define BP_VF_MBX(bp, vfid)	(&((bp)->vfdb->mbxs[vfid]))
321
322	struct hw_dma		bulletin_dma;
323#define BP_VF_BULLETIN_DMA(bp)	(&((bp)->vfdb->bulletin_dma))
324#define	BP_VF_BULLETIN(bp, vf) \
325	(((struct pf_vf_bulletin_content *)(BP_VF_BULLETIN_DMA(bp)->addr)) \
326	 + (vf))
327
328	struct hw_dma		sp_dma;
329#define bnx2x_vf_sp(bp, vf, field) ((bp)->vfdb->sp_dma.addr +		\
330		(vf)->index * sizeof(struct bnx2x_vf_sp) +		\
331		offsetof(struct bnx2x_vf_sp, field))
332#define bnx2x_vf_sp_map(bp, vf, field) ((bp)->vfdb->sp_dma.mapping +	\
333		(vf)->index * sizeof(struct bnx2x_vf_sp) +		\
334		offsetof(struct bnx2x_vf_sp, field))
335
336#define FLRD_VFS_DWORDS (BNX2X_MAX_NUM_OF_VFS / 32)
337	u32 flrd_vfs[FLRD_VFS_DWORDS];
338
339	/* the number of msix vectors belonging to this PF designated for VFs */
340	u16 vf_sbs_pool;
341	u16 first_vf_igu_entry;
342
343	/* sp_rtnl synchronization */
344	struct mutex			event_mutex;
345	u64				event_occur;
346
347	/* bulletin board update synchronization */
348	struct mutex			bulletin_mutex;
349};
350
351/* queue access */
352static inline struct bnx2x_vf_queue *vfq_get(struct bnx2x_virtf *vf, u8 index)
353{
354	return &(vf->vfqs[index]);
355}
356
357/* FW ids */
358static inline u8 vf_igu_sb(struct bnx2x_virtf *vf, u16 sb_idx)
359{
360	return vf->igu_base_id + sb_idx;
361}
362
363static inline u8 vf_hc_qzone(struct bnx2x_virtf *vf, u16 sb_idx)
364{
365	return vf_igu_sb(vf, sb_idx);
366}
367
368static u8 vfq_cl_id(struct bnx2x_virtf *vf, struct bnx2x_vf_queue *q)
369{
370	return vf->igu_base_id + q->index;
371}
372
373static inline u8 vfq_stat_id(struct bnx2x_virtf *vf, struct bnx2x_vf_queue *q)
374{
375	if (vf->cfg_flags & VF_CFG_STATS_COALESCE)
376		return vf->leading_rss;
377	else
378		return vfq_cl_id(vf, q);
379}
380
381static inline u8 vfq_qzone_id(struct bnx2x_virtf *vf, struct bnx2x_vf_queue *q)
382{
383	return vfq_cl_id(vf, q);
384}
385
386/* global iov routines */
387int bnx2x_iov_init_ilt(struct bnx2x *bp, u16 line);
388int bnx2x_iov_init_one(struct bnx2x *bp, int int_mode_param, int num_vfs_param);
389void bnx2x_iov_remove_one(struct bnx2x *bp);
390void bnx2x_iov_free_mem(struct bnx2x *bp);
391int bnx2x_iov_alloc_mem(struct bnx2x *bp);
392int bnx2x_iov_nic_init(struct bnx2x *bp);
393int bnx2x_iov_chip_cleanup(struct bnx2x *bp);
394void bnx2x_iov_init_dq(struct bnx2x *bp);
395void bnx2x_iov_init_dmae(struct bnx2x *bp);
396void bnx2x_iov_set_queue_sp_obj(struct bnx2x *bp, int vf_cid,
397				struct bnx2x_queue_sp_obj **q_obj);
398int bnx2x_iov_eq_sp_event(struct bnx2x *bp, union event_ring_elem *elem);
399void bnx2x_iov_adjust_stats_req(struct bnx2x *bp);
400void bnx2x_iov_storm_stats_update(struct bnx2x *bp);
401/* global vf mailbox routines */
402void bnx2x_vf_mbx(struct bnx2x *bp);
403void bnx2x_vf_mbx_schedule(struct bnx2x *bp,
404			   struct vf_pf_event_data *vfpf_event);
405void bnx2x_vf_enable_mbx(struct bnx2x *bp, u8 abs_vfid);
406
407/* CORE VF API */
408typedef u8 bnx2x_mac_addr_t[ETH_ALEN];
409
410/* acquire */
411int bnx2x_vf_acquire(struct bnx2x *bp, struct bnx2x_virtf *vf,
412		     struct vf_pf_resc_request *resc);
413/* init */
414int bnx2x_vf_init(struct bnx2x *bp, struct bnx2x_virtf *vf,
415		  dma_addr_t *sb_map);
416
417/* VFOP queue construction helpers */
418void bnx2x_vfop_qctor_dump_tx(struct bnx2x *bp, struct bnx2x_virtf *vf,
419			    struct bnx2x_queue_init_params *init_params,
420			    struct bnx2x_queue_setup_params *setup_params,
421			    u16 q_idx, u16 sb_idx);
422
423void bnx2x_vfop_qctor_dump_rx(struct bnx2x *bp, struct bnx2x_virtf *vf,
424			    struct bnx2x_queue_init_params *init_params,
425			    struct bnx2x_queue_setup_params *setup_params,
426			    u16 q_idx, u16 sb_idx);
427
428void bnx2x_vfop_qctor_prep(struct bnx2x *bp,
429			   struct bnx2x_virtf *vf,
430			   struct bnx2x_vf_queue *q,
431			   struct bnx2x_vf_queue_construct_params *p,
432			   unsigned long q_type);
433
434int bnx2x_vf_mac_vlan_config_list(struct bnx2x *bp, struct bnx2x_virtf *vf,
435				  struct bnx2x_vf_mac_vlan_filters *filters,
436				  int qid, bool drv_only);
437
438int bnx2x_vf_queue_setup(struct bnx2x *bp, struct bnx2x_virtf *vf, int qid,
439			 struct bnx2x_vf_queue_construct_params *qctor);
440
441int bnx2x_vf_queue_teardown(struct bnx2x *bp, struct bnx2x_virtf *vf, int qid);
442
443int bnx2x_vf_mcast(struct bnx2x *bp, struct bnx2x_virtf *vf,
444		   bnx2x_mac_addr_t *mcasts, int mc_num, bool drv_only);
445
446int bnx2x_vf_rxmode(struct bnx2x *bp, struct bnx2x_virtf *vf,
447		    int qid, unsigned long accept_flags);
448
449int bnx2x_vf_close(struct bnx2x *bp, struct bnx2x_virtf *vf);
450
451int bnx2x_vf_free(struct bnx2x *bp, struct bnx2x_virtf *vf);
452
453int bnx2x_vf_rss_update(struct bnx2x *bp, struct bnx2x_virtf *vf,
454			struct bnx2x_config_rss_params *rss);
455
456int bnx2x_vf_tpa_update(struct bnx2x *bp, struct bnx2x_virtf *vf,
457			struct vfpf_tpa_tlv *tlv,
458			struct bnx2x_queue_update_tpa_params *params);
459
460/* VF release ~ VF close + VF release-resources
461 *
462 * Release is the ultimate SW shutdown and is called whenever an
463 * irrecoverable error is encountered.
464 */
465int bnx2x_vf_release(struct bnx2x *bp, struct bnx2x_virtf *vf);
466int bnx2x_vf_idx_by_abs_fid(struct bnx2x *bp, u16 abs_vfid);
467u8 bnx2x_vf_max_queue_cnt(struct bnx2x *bp, struct bnx2x_virtf *vf);
468
469/* FLR routines */
470
471/* VF FLR helpers */
472int bnx2x_vf_flr_clnup_epilog(struct bnx2x *bp, u8 abs_vfid);
473void bnx2x_vf_enable_access(struct bnx2x *bp, u8 abs_vfid);
474
475/* Handles an FLR (or VF_DISABLE) notification form the MCP */
476void bnx2x_vf_handle_flr_event(struct bnx2x *bp);
477
478bool bnx2x_tlv_supported(u16 tlvtype);
479
480u32 bnx2x_crc_vf_bulletin(struct pf_vf_bulletin_content *bulletin);
481int bnx2x_post_vf_bulletin(struct bnx2x *bp, int vf);
482void bnx2x_vf_bulletin_finalize(struct pf_vf_bulletin_content *bulletin,
483				bool support_long);
484
485enum sample_bulletin_result bnx2x_sample_bulletin(struct bnx2x *bp);
486
487/* VF side vfpf channel functions */
488int bnx2x_vfpf_acquire(struct bnx2x *bp, u8 tx_count, u8 rx_count);
489int bnx2x_vfpf_release(struct bnx2x *bp);
490int bnx2x_vfpf_release(struct bnx2x *bp);
491int bnx2x_vfpf_init(struct bnx2x *bp);
492void bnx2x_vfpf_close_vf(struct bnx2x *bp);
493int bnx2x_vfpf_setup_q(struct bnx2x *bp, struct bnx2x_fastpath *fp,
494		       bool is_leading);
495int bnx2x_vfpf_config_mac(struct bnx2x *bp, u8 *addr, u8 vf_qid, bool set);
496int bnx2x_vfpf_config_rss(struct bnx2x *bp,
497			  struct bnx2x_config_rss_params *params);
498int bnx2x_vfpf_set_mcast(struct net_device *dev);
499int bnx2x_vfpf_storm_rx_mode(struct bnx2x *bp);
500
501static inline void bnx2x_vf_fill_fw_str(struct bnx2x *bp, char *buf,
502					size_t buf_len)
503{
504	strlcpy(buf, bp->acquire_resp.pfdev_info.fw_ver, buf_len);
505}
506
507static inline int bnx2x_vf_ustorm_prods_offset(struct bnx2x *bp,
508					       struct bnx2x_fastpath *fp)
509{
510	return PXP_VF_ADDR_USDM_QUEUES_START +
511		bp->acquire_resp.resc.hw_qid[fp->index] *
512		sizeof(struct ustorm_queue_zone_data);
513}
514
515enum sample_bulletin_result bnx2x_sample_bulletin(struct bnx2x *bp);
516void bnx2x_timer_sriov(struct bnx2x *bp);
517void __iomem *bnx2x_vf_doorbells(struct bnx2x *bp);
518void bnx2x_vf_pci_dealloc(struct bnx2x *bp);
519int bnx2x_vf_pci_alloc(struct bnx2x *bp);
520int bnx2x_enable_sriov(struct bnx2x *bp);
521void bnx2x_disable_sriov(struct bnx2x *bp);
522static inline int bnx2x_vf_headroom(struct bnx2x *bp)
523{
524	return bp->vfdb->sriov.nr_virtfn * BNX2X_CIDS_PER_VF;
525}
526void bnx2x_pf_set_vfs_vlan(struct bnx2x *bp);
527int bnx2x_sriov_configure(struct pci_dev *dev, int num_vfs);
528void bnx2x_iov_channel_down(struct bnx2x *bp);
529
530void bnx2x_iov_task(struct work_struct *work);
531
532void bnx2x_schedule_iov_task(struct bnx2x *bp, enum bnx2x_iov_flag flag);
533
534void bnx2x_iov_link_update(struct bnx2x *bp);
535int bnx2x_iov_link_update_vf(struct bnx2x *bp, int idx);
536
537int bnx2x_set_vf_link_state(struct net_device *dev, int vf, int link_state);
538
539#else /* CONFIG_BNX2X_SRIOV */
540
541static inline void bnx2x_iov_set_queue_sp_obj(struct bnx2x *bp, int vf_cid,
542				struct bnx2x_queue_sp_obj **q_obj) {}
543static inline void bnx2x_vf_handle_flr_event(struct bnx2x *bp) {}
544static inline int bnx2x_iov_eq_sp_event(struct bnx2x *bp,
545					union event_ring_elem *elem) {return 1; }
546static inline void bnx2x_vf_mbx(struct bnx2x *bp) {}
547static inline void bnx2x_vf_mbx_schedule(struct bnx2x *bp,
548					 struct vf_pf_event_data *vfpf_event) {}
549static inline int bnx2x_iov_init_ilt(struct bnx2x *bp, u16 line) {return line; }
550static inline void bnx2x_iov_init_dq(struct bnx2x *bp) {}
551static inline int bnx2x_iov_alloc_mem(struct bnx2x *bp) {return 0; }
552static inline void bnx2x_iov_free_mem(struct bnx2x *bp) {}
553static inline int bnx2x_iov_chip_cleanup(struct bnx2x *bp) {return 0; }
554static inline void bnx2x_iov_init_dmae(struct bnx2x *bp) {}
555static inline int bnx2x_iov_init_one(struct bnx2x *bp, int int_mode_param,
556				     int num_vfs_param) {return 0; }
557static inline void bnx2x_iov_remove_one(struct bnx2x *bp) {}
558static inline int bnx2x_enable_sriov(struct bnx2x *bp) {return 0; }
559static inline void bnx2x_disable_sriov(struct bnx2x *bp) {}
560static inline int bnx2x_vfpf_acquire(struct bnx2x *bp,
561				     u8 tx_count, u8 rx_count) {return 0; }
562static inline int bnx2x_vfpf_release(struct bnx2x *bp) {return 0; }
563static inline int bnx2x_vfpf_init(struct bnx2x *bp) {return 0; }
564static inline void bnx2x_vfpf_close_vf(struct bnx2x *bp) {}
565static inline int bnx2x_vfpf_setup_q(struct bnx2x *bp, struct bnx2x_fastpath *fp, bool is_leading) {return 0; }
566static inline int bnx2x_vfpf_config_mac(struct bnx2x *bp, u8 *addr,
567					u8 vf_qid, bool set) {return 0; }
568static inline int bnx2x_vfpf_config_rss(struct bnx2x *bp,
569					struct bnx2x_config_rss_params *params) {return 0; }
570static inline int bnx2x_vfpf_set_mcast(struct net_device *dev) {return 0; }
571static inline int bnx2x_vfpf_storm_rx_mode(struct bnx2x *bp) {return 0; }
572static inline int bnx2x_iov_nic_init(struct bnx2x *bp) {return 0; }
573static inline int bnx2x_vf_headroom(struct bnx2x *bp) {return 0; }
574static inline void bnx2x_iov_adjust_stats_req(struct bnx2x *bp) {}
575static inline void bnx2x_vf_fill_fw_str(struct bnx2x *bp, char *buf,
576					size_t buf_len) {}
577static inline int bnx2x_vf_ustorm_prods_offset(struct bnx2x *bp,
578					       struct bnx2x_fastpath *fp) {return 0; }
579static inline enum sample_bulletin_result bnx2x_sample_bulletin(struct bnx2x *bp)
580{
581	return PFVF_BULLETIN_UNCHANGED;
582}
583static inline void bnx2x_timer_sriov(struct bnx2x *bp) {}
584
585static inline void __iomem *bnx2x_vf_doorbells(struct bnx2x *bp)
586{
587	return NULL;
588}
589
590static inline void bnx2x_vf_pci_dealloc(struct bnx2x *bp) {}
591static inline int bnx2x_vf_pci_alloc(struct bnx2x *bp) {return 0; }
592static inline void bnx2x_pf_set_vfs_vlan(struct bnx2x *bp) {}
593static inline int bnx2x_sriov_configure(struct pci_dev *dev, int num_vfs) {return 0; }
594static inline void bnx2x_iov_channel_down(struct bnx2x *bp) {}
595
596static inline void bnx2x_iov_task(struct work_struct *work) {}
597static inline void bnx2x_schedule_iov_task(struct bnx2x *bp, enum bnx2x_iov_flag flag) {}
598static inline void bnx2x_iov_link_update(struct bnx2x *bp) {}
599static inline int bnx2x_iov_link_update_vf(struct bnx2x *bp, int idx) {return 0; }
600
601static inline int bnx2x_set_vf_link_state(struct net_device *dev, int vf,
602					  int link_state) {return 0; }
603struct pf_vf_bulletin_content;
604static inline void bnx2x_vf_bulletin_finalize(struct pf_vf_bulletin_content *bulletin,
605					      bool support_long) {}
606
607#endif /* CONFIG_BNX2X_SRIOV */
608#endif /* bnx2x_sriov.h */
609