1*14b24e2bSVaishali Kulkarni /*
2*14b24e2bSVaishali Kulkarni * CDDL HEADER START
3*14b24e2bSVaishali Kulkarni *
4*14b24e2bSVaishali Kulkarni * The contents of this file are subject to the terms of the
5*14b24e2bSVaishali Kulkarni * Common Development and Distribution License, v.1,  (the "License").
6*14b24e2bSVaishali Kulkarni * You may not use this file except in compliance with the License.
7*14b24e2bSVaishali Kulkarni *
8*14b24e2bSVaishali Kulkarni * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*14b24e2bSVaishali Kulkarni * or http://opensource.org/licenses/CDDL-1.0.
10*14b24e2bSVaishali Kulkarni * See the License for the specific language governing permissions
11*14b24e2bSVaishali Kulkarni * and limitations under the License.
12*14b24e2bSVaishali Kulkarni *
13*14b24e2bSVaishali Kulkarni * When distributing Covered Code, include this CDDL HEADER in each
14*14b24e2bSVaishali Kulkarni * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*14b24e2bSVaishali Kulkarni * If applicable, add the following below this CDDL HEADER, with the
16*14b24e2bSVaishali Kulkarni * fields enclosed by brackets "[]" replaced with your own identifying
17*14b24e2bSVaishali Kulkarni * information: Portions Copyright [yyyy] [name of copyright owner]
18*14b24e2bSVaishali Kulkarni *
19*14b24e2bSVaishali Kulkarni * CDDL HEADER END
20*14b24e2bSVaishali Kulkarni */
21*14b24e2bSVaishali Kulkarni 
22*14b24e2bSVaishali Kulkarni /*
23*14b24e2bSVaishali Kulkarni * Copyright 2014-2017 Cavium, Inc.
24*14b24e2bSVaishali Kulkarni * The contents of this file are subject to the terms of the Common Development
25*14b24e2bSVaishali Kulkarni * and Distribution License, v.1,  (the "License").
26*14b24e2bSVaishali Kulkarni 
27*14b24e2bSVaishali Kulkarni * You may not use this file except in compliance with the License.
28*14b24e2bSVaishali Kulkarni 
29*14b24e2bSVaishali Kulkarni * You can obtain a copy of the License at available
30*14b24e2bSVaishali Kulkarni * at http://opensource.org/licenses/CDDL-1.0
31*14b24e2bSVaishali Kulkarni 
32*14b24e2bSVaishali Kulkarni * See the License for the specific language governing permissions and
33*14b24e2bSVaishali Kulkarni * limitations under the License.
34*14b24e2bSVaishali Kulkarni */
35*14b24e2bSVaishali Kulkarni 
36*14b24e2bSVaishali Kulkarni #ifndef __ECORE_SRIOV_H__
37*14b24e2bSVaishali Kulkarni #define __ECORE_SRIOV_H__
38*14b24e2bSVaishali Kulkarni 
39*14b24e2bSVaishali Kulkarni #include "ecore_status.h"
40*14b24e2bSVaishali Kulkarni #include "ecore_vfpf_if.h"
41*14b24e2bSVaishali Kulkarni #include "ecore_iov_api.h"
42*14b24e2bSVaishali Kulkarni #include "ecore_hsi_common.h"
43*14b24e2bSVaishali Kulkarni #include "ecore_l2.h"
44*14b24e2bSVaishali Kulkarni 
45*14b24e2bSVaishali Kulkarni #define ECORE_ETH_MAX_VF_NUM_VLAN_FILTERS \
46*14b24e2bSVaishali Kulkarni 	(E4_MAX_NUM_VFS * ECORE_ETH_VF_NUM_VLAN_FILTERS)
47*14b24e2bSVaishali Kulkarni 
48*14b24e2bSVaishali Kulkarni /* Represents a full message. Both the request filled by VF
49*14b24e2bSVaishali Kulkarni  * and the response filled by the PF. The VF needs one copy
50*14b24e2bSVaishali Kulkarni  * of this message, it fills the request part and sends it to
51*14b24e2bSVaishali Kulkarni  * the PF. The PF will copy the response to the response part for
52*14b24e2bSVaishali Kulkarni  * the VF to later read it. The PF needs to hold a message like this
53*14b24e2bSVaishali Kulkarni  * per VF, the request that is copied to the PF is placed in the
54*14b24e2bSVaishali Kulkarni  * request size, and the response is filled by the PF before sending
55*14b24e2bSVaishali Kulkarni  * it to the VF.
56*14b24e2bSVaishali Kulkarni  */
57*14b24e2bSVaishali Kulkarni struct ecore_vf_mbx_msg {
58*14b24e2bSVaishali Kulkarni 	union vfpf_tlvs req;
59*14b24e2bSVaishali Kulkarni 	union pfvf_tlvs resp;
60*14b24e2bSVaishali Kulkarni };
61*14b24e2bSVaishali Kulkarni 
62*14b24e2bSVaishali Kulkarni /* This mailbox is maintained per VF in its PF
63*14b24e2bSVaishali Kulkarni  * contains all information required for sending / receiving
64*14b24e2bSVaishali Kulkarni  * a message
65*14b24e2bSVaishali Kulkarni  */
66*14b24e2bSVaishali Kulkarni struct ecore_iov_vf_mbx {
67*14b24e2bSVaishali Kulkarni 	union vfpf_tlvs		*req_virt;
68*14b24e2bSVaishali Kulkarni 	dma_addr_t		req_phys;
69*14b24e2bSVaishali Kulkarni 	union pfvf_tlvs		*reply_virt;
70*14b24e2bSVaishali Kulkarni 	dma_addr_t		reply_phys;
71*14b24e2bSVaishali Kulkarni 
72*14b24e2bSVaishali Kulkarni 	/* Address in VF where a pending message is located */
73*14b24e2bSVaishali Kulkarni 	dma_addr_t		pending_req;
74*14b24e2bSVaishali Kulkarni 
75*14b24e2bSVaishali Kulkarni 	/* Message from VF awaits handling */
76*14b24e2bSVaishali Kulkarni 	bool			b_pending_msg;
77*14b24e2bSVaishali Kulkarni 
78*14b24e2bSVaishali Kulkarni 	u8 *offset;
79*14b24e2bSVaishali Kulkarni 
80*14b24e2bSVaishali Kulkarni #ifdef CONFIG_ECORE_SW_CHANNEL
81*14b24e2bSVaishali Kulkarni 	struct ecore_iov_sw_mbx sw_mbx;
82*14b24e2bSVaishali Kulkarni #endif
83*14b24e2bSVaishali Kulkarni 
84*14b24e2bSVaishali Kulkarni 	/* VF GPA address */
85*14b24e2bSVaishali Kulkarni 	u32			vf_addr_lo;
86*14b24e2bSVaishali Kulkarni 	u32			vf_addr_hi;
87*14b24e2bSVaishali Kulkarni 
88*14b24e2bSVaishali Kulkarni 	struct vfpf_first_tlv	first_tlv;	/* saved VF request header */
89*14b24e2bSVaishali Kulkarni 
90*14b24e2bSVaishali Kulkarni 	u8			flags;
91*14b24e2bSVaishali Kulkarni #define VF_MSG_INPROCESS	0x1	/* failsafe - the FW should prevent
92*14b24e2bSVaishali Kulkarni 					 * more then one pending msg
93*14b24e2bSVaishali Kulkarni 					 */
94*14b24e2bSVaishali Kulkarni };
95*14b24e2bSVaishali Kulkarni 
96*14b24e2bSVaishali Kulkarni #define ECORE_IOV_LEGACY_QID_RX (0)
97*14b24e2bSVaishali Kulkarni #define ECORE_IOV_LEGACY_QID_TX (1)
98*14b24e2bSVaishali Kulkarni #define ECORE_IOV_QID_INVALID (0xFE)
99*14b24e2bSVaishali Kulkarni 
100*14b24e2bSVaishali Kulkarni struct ecore_vf_queue_cid {
101*14b24e2bSVaishali Kulkarni 	bool b_is_tx;
102*14b24e2bSVaishali Kulkarni 	struct ecore_queue_cid *p_cid;
103*14b24e2bSVaishali Kulkarni };
104*14b24e2bSVaishali Kulkarni 
105*14b24e2bSVaishali Kulkarni /* Describes a qzone associated with the VF */
106*14b24e2bSVaishali Kulkarni struct ecore_vf_queue {
107*14b24e2bSVaishali Kulkarni 	/* Input from upper-layer, mapping relateive queue to queue-zone */
108*14b24e2bSVaishali Kulkarni 	u16 fw_rx_qid;
109*14b24e2bSVaishali Kulkarni 	u16 fw_tx_qid;
110*14b24e2bSVaishali Kulkarni 
111*14b24e2bSVaishali Kulkarni 	struct ecore_vf_queue_cid cids[MAX_QUEUES_PER_QZONE];
112*14b24e2bSVaishali Kulkarni };
113*14b24e2bSVaishali Kulkarni 
114*14b24e2bSVaishali Kulkarni enum vf_state {
115*14b24e2bSVaishali Kulkarni 	VF_FREE		= 0,	/* VF ready to be acquired holds no resc */
116*14b24e2bSVaishali Kulkarni 	VF_ACQUIRED	= 1,	/* VF, aquired, but not initalized */
117*14b24e2bSVaishali Kulkarni 	VF_ENABLED	= 2,	/* VF, Enabled */
118*14b24e2bSVaishali Kulkarni 	VF_RESET	= 3,	/* VF, FLR'd, pending cleanup */
119*14b24e2bSVaishali Kulkarni 	VF_STOPPED      = 4     /* VF, Stopped */
120*14b24e2bSVaishali Kulkarni };
121*14b24e2bSVaishali Kulkarni 
122*14b24e2bSVaishali Kulkarni struct ecore_vf_vlan_shadow {
123*14b24e2bSVaishali Kulkarni 	bool used;
124*14b24e2bSVaishali Kulkarni 	u16 vid;
125*14b24e2bSVaishali Kulkarni };
126*14b24e2bSVaishali Kulkarni 
127*14b24e2bSVaishali Kulkarni struct ecore_vf_shadow_config {
128*14b24e2bSVaishali Kulkarni 	/* Shadow copy of all guest vlans */
129*14b24e2bSVaishali Kulkarni 	struct ecore_vf_vlan_shadow vlans[ECORE_ETH_VF_NUM_VLAN_FILTERS + 1];
130*14b24e2bSVaishali Kulkarni 
131*14b24e2bSVaishali Kulkarni 	/* Shadow copy of all configured MACs; Empty if forcing MACs */
132*14b24e2bSVaishali Kulkarni 	u8 macs[ECORE_ETH_VF_NUM_MAC_FILTERS][ETH_ALEN];
133*14b24e2bSVaishali Kulkarni 	u8 inner_vlan_removal;
134*14b24e2bSVaishali Kulkarni };
135*14b24e2bSVaishali Kulkarni 
136*14b24e2bSVaishali Kulkarni /* PFs maintain an array of this structure, per VF */
137*14b24e2bSVaishali Kulkarni struct ecore_vf_info {
138*14b24e2bSVaishali Kulkarni 	struct ecore_iov_vf_mbx vf_mbx;
139*14b24e2bSVaishali Kulkarni 	enum vf_state state;
140*14b24e2bSVaishali Kulkarni 	bool b_init;
141*14b24e2bSVaishali Kulkarni 	bool b_malicious;
142*14b24e2bSVaishali Kulkarni 	u8			to_disable;
143*14b24e2bSVaishali Kulkarni 
144*14b24e2bSVaishali Kulkarni 	struct ecore_bulletin	bulletin;
145*14b24e2bSVaishali Kulkarni 	dma_addr_t		vf_bulletin;
146*14b24e2bSVaishali Kulkarni 
147*14b24e2bSVaishali Kulkarni 	/* PF saves a copy of the last VF acquire message */
148*14b24e2bSVaishali Kulkarni 	struct vfpf_acquire_tlv acquire;
149*14b24e2bSVaishali Kulkarni 
150*14b24e2bSVaishali Kulkarni 	u32			concrete_fid;
151*14b24e2bSVaishali Kulkarni 	u16			opaque_fid;
152*14b24e2bSVaishali Kulkarni 	u16			mtu;
153*14b24e2bSVaishali Kulkarni 
154*14b24e2bSVaishali Kulkarni 	u8			vport_id;
155*14b24e2bSVaishali Kulkarni 	u8			rss_eng_id;
156*14b24e2bSVaishali Kulkarni 	u8			relative_vf_id;
157*14b24e2bSVaishali Kulkarni 	u8			abs_vf_id;
158*14b24e2bSVaishali Kulkarni #define ECORE_VF_ABS_ID(p_hwfn, p_vf)	(ECORE_PATH_ID(p_hwfn) ? \
159*14b24e2bSVaishali Kulkarni 					 (p_vf)->abs_vf_id + MAX_NUM_VFS_BB : \
160*14b24e2bSVaishali Kulkarni 					 (p_vf)->abs_vf_id)
161*14b24e2bSVaishali Kulkarni 
162*14b24e2bSVaishali Kulkarni 	u8			vport_instance; /* Number of active vports */
163*14b24e2bSVaishali Kulkarni 	u8			num_rxqs;
164*14b24e2bSVaishali Kulkarni 	u8			num_txqs;
165*14b24e2bSVaishali Kulkarni 
166*14b24e2bSVaishali Kulkarni 	u16			rx_coal;
167*14b24e2bSVaishali Kulkarni 	u16			tx_coal;
168*14b24e2bSVaishali Kulkarni 
169*14b24e2bSVaishali Kulkarni 	u8			num_sbs;
170*14b24e2bSVaishali Kulkarni 
171*14b24e2bSVaishali Kulkarni 	u8			num_mac_filters;
172*14b24e2bSVaishali Kulkarni 	u8			num_vlan_filters;
173*14b24e2bSVaishali Kulkarni 
174*14b24e2bSVaishali Kulkarni 	struct ecore_vf_queue	vf_queues[ECORE_MAX_VF_CHAINS_PER_PF];
175*14b24e2bSVaishali Kulkarni 	u16			igu_sbs[ECORE_MAX_VF_CHAINS_PER_PF];
176*14b24e2bSVaishali Kulkarni 
177*14b24e2bSVaishali Kulkarni 	/* TODO - Only windows is using it - should be removed */
178*14b24e2bSVaishali Kulkarni 	u8 was_malicious;
179*14b24e2bSVaishali Kulkarni 	u8 num_active_rxqs;
180*14b24e2bSVaishali Kulkarni 	void *ctx;
181*14b24e2bSVaishali Kulkarni 	struct ecore_public_vf_info p_vf_info;
182*14b24e2bSVaishali Kulkarni 	bool spoof_chk;		/* Current configured on HW */
183*14b24e2bSVaishali Kulkarni 	bool req_spoofchk_val;  /* Requested value */
184*14b24e2bSVaishali Kulkarni 
185*14b24e2bSVaishali Kulkarni 	/* Stores the configuration requested by VF */
186*14b24e2bSVaishali Kulkarni 	struct ecore_vf_shadow_config shadow_config;
187*14b24e2bSVaishali Kulkarni 
188*14b24e2bSVaishali Kulkarni 	/* A bitfield using bulletin's valid-map bits, used to indicate
189*14b24e2bSVaishali Kulkarni 	 * which of the bulletin board features have been configured.
190*14b24e2bSVaishali Kulkarni 	 */
191*14b24e2bSVaishali Kulkarni 	u64 configured_features;
192*14b24e2bSVaishali Kulkarni #define ECORE_IOV_CONFIGURED_FEATURES_MASK	((1 << MAC_ADDR_FORCED) | \
193*14b24e2bSVaishali Kulkarni 						 (1 << VLAN_ADDR_FORCED))
194*14b24e2bSVaishali Kulkarni };
195*14b24e2bSVaishali Kulkarni 
196*14b24e2bSVaishali Kulkarni /* This structure is part of ecore_hwfn and used only for PFs that have sriov
197*14b24e2bSVaishali Kulkarni  * capability enabled.
198*14b24e2bSVaishali Kulkarni  */
199*14b24e2bSVaishali Kulkarni struct ecore_pf_iov {
200*14b24e2bSVaishali Kulkarni 	struct ecore_vf_info	vfs_array[E4_MAX_NUM_VFS];
201*14b24e2bSVaishali Kulkarni 	u64			pending_flr[ECORE_VF_ARRAY_LENGTH];
202*14b24e2bSVaishali Kulkarni 
203*14b24e2bSVaishali Kulkarni #ifndef REMOVE_DBG
204*14b24e2bSVaishali Kulkarni 	/* This doesn't serve anything functionally, but it makes windows
205*14b24e2bSVaishali Kulkarni 	 * debugging of IOV related issues easier.
206*14b24e2bSVaishali Kulkarni 	 */
207*14b24e2bSVaishali Kulkarni 	u64			active_vfs[ECORE_VF_ARRAY_LENGTH];
208*14b24e2bSVaishali Kulkarni #endif
209*14b24e2bSVaishali Kulkarni 
210*14b24e2bSVaishali Kulkarni 	/* Allocate message address continuosuly and split to each VF */
211*14b24e2bSVaishali Kulkarni 	void			*mbx_msg_virt_addr;
212*14b24e2bSVaishali Kulkarni 	dma_addr_t		mbx_msg_phys_addr;
213*14b24e2bSVaishali Kulkarni 	u32			mbx_msg_size;
214*14b24e2bSVaishali Kulkarni 	void			*mbx_reply_virt_addr;
215*14b24e2bSVaishali Kulkarni 	dma_addr_t		mbx_reply_phys_addr;
216*14b24e2bSVaishali Kulkarni 	u32			mbx_reply_size;
217*14b24e2bSVaishali Kulkarni 	void			*p_bulletins;
218*14b24e2bSVaishali Kulkarni 	dma_addr_t		bulletins_phys;
219*14b24e2bSVaishali Kulkarni 	u32			bulletins_size;
220*14b24e2bSVaishali Kulkarni };
221*14b24e2bSVaishali Kulkarni 
222*14b24e2bSVaishali Kulkarni #ifdef CONFIG_ECORE_SRIOV
223*14b24e2bSVaishali Kulkarni /**
224*14b24e2bSVaishali Kulkarni  * @brief Read sriov related information and allocated resources
225*14b24e2bSVaishali Kulkarni  *  reads from configuraiton space, shmem, etc.
226*14b24e2bSVaishali Kulkarni  *
227*14b24e2bSVaishali Kulkarni  * @param p_hwfn
228*14b24e2bSVaishali Kulkarni  *
229*14b24e2bSVaishali Kulkarni  * @return enum _ecore_status_t
230*14b24e2bSVaishali Kulkarni  */
231*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_iov_hw_info(struct ecore_hwfn *p_hwfn);
232*14b24e2bSVaishali Kulkarni 
233*14b24e2bSVaishali Kulkarni /**
234*14b24e2bSVaishali Kulkarni  * @brief ecore_add_tlv - place a given tlv on the tlv buffer at next offset
235*14b24e2bSVaishali Kulkarni  *
236*14b24e2bSVaishali Kulkarni  * @param p_hwfn
237*14b24e2bSVaishali Kulkarni  * @param p_iov
238*14b24e2bSVaishali Kulkarni  * @param type
239*14b24e2bSVaishali Kulkarni  * @param length
240*14b24e2bSVaishali Kulkarni  *
241*14b24e2bSVaishali Kulkarni  * @return pointer to the newly placed tlv
242*14b24e2bSVaishali Kulkarni  */
243*14b24e2bSVaishali Kulkarni void *ecore_add_tlv(struct ecore_hwfn	*p_hwfn,
244*14b24e2bSVaishali Kulkarni 		    u8			**offset,
245*14b24e2bSVaishali Kulkarni 		    u16			type,
246*14b24e2bSVaishali Kulkarni 		    u16			length);
247*14b24e2bSVaishali Kulkarni 
248*14b24e2bSVaishali Kulkarni /**
249*14b24e2bSVaishali Kulkarni  * @brief list the types and lengths of the tlvs on the buffer
250*14b24e2bSVaishali Kulkarni  *
251*14b24e2bSVaishali Kulkarni  * @param p_hwfn
252*14b24e2bSVaishali Kulkarni  * @param tlvs_list
253*14b24e2bSVaishali Kulkarni  */
254*14b24e2bSVaishali Kulkarni void ecore_dp_tlv_list(struct ecore_hwfn *p_hwfn,
255*14b24e2bSVaishali Kulkarni 		       void *tlvs_list);
256*14b24e2bSVaishali Kulkarni 
257*14b24e2bSVaishali Kulkarni /**
258*14b24e2bSVaishali Kulkarni  * @brief ecore_iov_alloc - allocate sriov related resources
259*14b24e2bSVaishali Kulkarni  *
260*14b24e2bSVaishali Kulkarni  * @param p_hwfn
261*14b24e2bSVaishali Kulkarni  *
262*14b24e2bSVaishali Kulkarni  * @return enum _ecore_status_t
263*14b24e2bSVaishali Kulkarni  */
264*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_iov_alloc(struct ecore_hwfn *p_hwfn);
265*14b24e2bSVaishali Kulkarni 
266*14b24e2bSVaishali Kulkarni /**
267*14b24e2bSVaishali Kulkarni  * @brief ecore_iov_setup - setup sriov related resources
268*14b24e2bSVaishali Kulkarni  *
269*14b24e2bSVaishali Kulkarni  * @param p_hwfn
270*14b24e2bSVaishali Kulkarni  * @param p_ptt
271*14b24e2bSVaishali Kulkarni  */
272*14b24e2bSVaishali Kulkarni void ecore_iov_setup(struct ecore_hwfn	*p_hwfn,
273*14b24e2bSVaishali Kulkarni 		     struct ecore_ptt	*p_ptt);
274*14b24e2bSVaishali Kulkarni 
275*14b24e2bSVaishali Kulkarni /**
276*14b24e2bSVaishali Kulkarni  * @brief ecore_iov_free - free sriov related resources
277*14b24e2bSVaishali Kulkarni  *
278*14b24e2bSVaishali Kulkarni  * @param p_hwfn
279*14b24e2bSVaishali Kulkarni  */
280*14b24e2bSVaishali Kulkarni void ecore_iov_free(struct ecore_hwfn *p_hwfn);
281*14b24e2bSVaishali Kulkarni 
282*14b24e2bSVaishali Kulkarni /**
283*14b24e2bSVaishali Kulkarni  * @brief free sriov related memory that was allocated during hw_prepare
284*14b24e2bSVaishali Kulkarni  *
285*14b24e2bSVaishali Kulkarni  * @param p_dev
286*14b24e2bSVaishali Kulkarni  */
287*14b24e2bSVaishali Kulkarni void ecore_iov_free_hw_info(struct ecore_dev *p_dev);
288*14b24e2bSVaishali Kulkarni 
289*14b24e2bSVaishali Kulkarni /**
290*14b24e2bSVaishali Kulkarni  * @brief ecore_sriov_eqe_event - handle async sriov event arrived on eqe.
291*14b24e2bSVaishali Kulkarni  *
292*14b24e2bSVaishali Kulkarni  * @param p_hwfn
293*14b24e2bSVaishali Kulkarni  * @param opcode
294*14b24e2bSVaishali Kulkarni  * @param echo
295*14b24e2bSVaishali Kulkarni  * @param data
296*14b24e2bSVaishali Kulkarni  */
297*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_sriov_eqe_event(struct ecore_hwfn	 *p_hwfn,
298*14b24e2bSVaishali Kulkarni 					   u8			 opcode,
299*14b24e2bSVaishali Kulkarni 					   __le16		 echo,
300*14b24e2bSVaishali Kulkarni 					   union event_ring_data *data);
301*14b24e2bSVaishali Kulkarni 
302*14b24e2bSVaishali Kulkarni /**
303*14b24e2bSVaishali Kulkarni  * @brief Mark structs of vfs that have been FLR-ed.
304*14b24e2bSVaishali Kulkarni  *
305*14b24e2bSVaishali Kulkarni  * @param p_hwfn
306*14b24e2bSVaishali Kulkarni  * @param disabled_vfs - bitmask of all VFs on path that were FLRed
307*14b24e2bSVaishali Kulkarni  *
308*14b24e2bSVaishali Kulkarni  * @return 1 iff one of the PF's vfs got FLRed. 0 otherwise.
309*14b24e2bSVaishali Kulkarni  */
310*14b24e2bSVaishali Kulkarni bool ecore_iov_mark_vf_flr(struct ecore_hwfn *p_hwfn,
311*14b24e2bSVaishali Kulkarni 			  u32 *disabled_vfs);
312*14b24e2bSVaishali Kulkarni 
313*14b24e2bSVaishali Kulkarni /**
314*14b24e2bSVaishali Kulkarni  * @brief Search extended TLVs in request/reply buffer.
315*14b24e2bSVaishali Kulkarni  *
316*14b24e2bSVaishali Kulkarni  * @param p_hwfn
317*14b24e2bSVaishali Kulkarni  * @param p_tlvs_list - Pointer to tlvs list
318*14b24e2bSVaishali Kulkarni  * @param req_type - Type of TLV
319*14b24e2bSVaishali Kulkarni  *
320*14b24e2bSVaishali Kulkarni  * @return pointer to tlv type if found, otherwise returns NULL.
321*14b24e2bSVaishali Kulkarni  */
322*14b24e2bSVaishali Kulkarni void *ecore_iov_search_list_tlvs(struct ecore_hwfn *p_hwfn,
323*14b24e2bSVaishali Kulkarni 				 void *p_tlvs_list, u16 req_type);
324*14b24e2bSVaishali Kulkarni 
325*14b24e2bSVaishali Kulkarni /**
326*14b24e2bSVaishali Kulkarni  * @brief ecore_iov_get_vf_info - return the database of a
327*14b24e2bSVaishali Kulkarni  *        specific VF
328*14b24e2bSVaishali Kulkarni  *
329*14b24e2bSVaishali Kulkarni  * @param p_hwfn
330*14b24e2bSVaishali Kulkarni  * @param relative_vf_id - relative id of the VF for which info
331*14b24e2bSVaishali Kulkarni  *			 is requested
332*14b24e2bSVaishali Kulkarni  * @param b_enabled_only - false iff want to access even if vf is disabled
333*14b24e2bSVaishali Kulkarni  *
334*14b24e2bSVaishali Kulkarni  * @return struct ecore_vf_info*
335*14b24e2bSVaishali Kulkarni  */
336*14b24e2bSVaishali Kulkarni struct ecore_vf_info *ecore_iov_get_vf_info(struct ecore_hwfn *p_hwfn,
337*14b24e2bSVaishali Kulkarni 					    u16 relative_vf_id,
338*14b24e2bSVaishali Kulkarni 					    bool b_enabled_only);
339*14b24e2bSVaishali Kulkarni #else
ecore_iov_hw_info(struct ecore_hwfn * p_hwfn)340*14b24e2bSVaishali Kulkarni static OSAL_INLINE enum _ecore_status_t ecore_iov_hw_info(struct ecore_hwfn *p_hwfn) {return ECORE_SUCCESS;}
ecore_add_tlv(struct ecore_hwfn * p_hwfn,u8 ** offset,u16 type,u16 length)341*14b24e2bSVaishali Kulkarni static OSAL_INLINE void *ecore_add_tlv(struct ecore_hwfn *p_hwfn, u8 **offset, u16 type, u16 length) {return OSAL_NULL;}
ecore_dp_tlv_list(struct ecore_hwfn * p_hwfn,void * tlvs_list)342*14b24e2bSVaishali Kulkarni static OSAL_INLINE void ecore_dp_tlv_list(struct ecore_hwfn *p_hwfn, void *tlvs_list) {}
ecore_iov_alloc(struct ecore_hwfn * p_hwfn)343*14b24e2bSVaishali Kulkarni static OSAL_INLINE enum _ecore_status_t ecore_iov_alloc(struct ecore_hwfn *p_hwfn) {return ECORE_SUCCESS;}
ecore_iov_setup(struct ecore_hwfn * p_hwfn,struct ecore_ptt * p_ptt)344*14b24e2bSVaishali Kulkarni static OSAL_INLINE void ecore_iov_setup(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt) {}
ecore_iov_free(struct ecore_hwfn * p_hwfn)345*14b24e2bSVaishali Kulkarni static OSAL_INLINE void ecore_iov_free(struct ecore_hwfn *p_hwfn) {}
ecore_iov_free_hw_info(struct ecore_dev * p_dev)346*14b24e2bSVaishali Kulkarni static OSAL_INLINE void ecore_iov_free_hw_info(struct ecore_dev *p_dev) {}
ecore_sriov_eqe_event(struct ecore_hwfn * p_hwfn,u8 opcode,__le16 echo,union event_ring_data * data)347*14b24e2bSVaishali Kulkarni static OSAL_INLINE enum _ecore_status_t ecore_sriov_eqe_event(struct ecore_hwfn *p_hwfn, u8 opcode, __le16 echo, union event_ring_data *data) {return ECORE_INVAL;}
ecore_crc32(u32 crc,u8 * ptr,u32 length)348*14b24e2bSVaishali Kulkarni static OSAL_INLINE u32 ecore_crc32(u32 crc, u8 *ptr, u32 length) {return 0;}
ecore_iov_mark_vf_flr(struct ecore_hwfn * p_hwfn,u32 * disabled_vfs)349*14b24e2bSVaishali Kulkarni static OSAL_INLINE bool ecore_iov_mark_vf_flr(struct ecore_hwfn *p_hwfn, u32 *disabled_vfs) {return 0;}
ecore_iov_search_list_tlvs(struct ecore_hwfn * p_hwfn,void * p_tlvs_list,u16 req_type)350*14b24e2bSVaishali Kulkarni static OSAL_INLINE void *ecore_iov_search_list_tlvs(struct ecore_hwfn *p_hwfn, void *p_tlvs_list, u16 req_type) {return OSAL_NULL;}
ecore_iov_get_vf_info(struct ecore_hwfn * p_hwfn,u16 relative_vf_id,bool b_enabled_only)351*14b24e2bSVaishali Kulkarni static OSAL_INLINE struct ecore_vf_info *ecore_iov_get_vf_info(struct ecore_hwfn *p_hwfn, u16 relative_vf_id, bool b_enabled_only) {return OSAL_NULL;}
352*14b24e2bSVaishali Kulkarni 
353*14b24e2bSVaishali Kulkarni #endif
354*14b24e2bSVaishali Kulkarni #endif /* __ECORE_SRIOV_H__ */