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_MCP_API_H__
37*14b24e2bSVaishali Kulkarni #define __ECORE_MCP_API_H__
38*14b24e2bSVaishali Kulkarni 
39*14b24e2bSVaishali Kulkarni #include "ecore_status.h"
40*14b24e2bSVaishali Kulkarni 
41*14b24e2bSVaishali Kulkarni struct ecore_mcp_link_speed_params {
42*14b24e2bSVaishali Kulkarni 	bool autoneg;
43*14b24e2bSVaishali Kulkarni 	u32 advertised_speeds; /* bitmask of DRV_SPEED_CAPABILITY */
44*14b24e2bSVaishali Kulkarni 	u32 forced_speed; /* In Mb/s */
45*14b24e2bSVaishali Kulkarni };
46*14b24e2bSVaishali Kulkarni 
47*14b24e2bSVaishali Kulkarni struct ecore_mcp_link_pause_params {
48*14b24e2bSVaishali Kulkarni 	bool autoneg;
49*14b24e2bSVaishali Kulkarni 	bool forced_rx;
50*14b24e2bSVaishali Kulkarni 	bool forced_tx;
51*14b24e2bSVaishali Kulkarni };
52*14b24e2bSVaishali Kulkarni 
53*14b24e2bSVaishali Kulkarni enum ecore_mcp_eee_mode {
54*14b24e2bSVaishali Kulkarni 	ECORE_MCP_EEE_DISABLED,
55*14b24e2bSVaishali Kulkarni 	ECORE_MCP_EEE_ENABLED,
56*14b24e2bSVaishali Kulkarni 	ECORE_MCP_EEE_UNSUPPORTED
57*14b24e2bSVaishali Kulkarni };
58*14b24e2bSVaishali Kulkarni 
59*14b24e2bSVaishali Kulkarni #ifndef __EXTRACT__LINUX__
60*14b24e2bSVaishali Kulkarni struct ecore_link_eee_params {
61*14b24e2bSVaishali Kulkarni 	u32 tx_lpi_timer;
62*14b24e2bSVaishali Kulkarni #define ECORE_EEE_1G_ADV	(1 << 0)
63*14b24e2bSVaishali Kulkarni #define ECORE_EEE_10G_ADV	(1 << 1)
64*14b24e2bSVaishali Kulkarni 	/* Capabilities are represented using ECORE_EEE_*_ADV values */
65*14b24e2bSVaishali Kulkarni 	u8 adv_caps;
66*14b24e2bSVaishali Kulkarni 	u8 lp_adv_caps;
67*14b24e2bSVaishali Kulkarni 	bool enable;
68*14b24e2bSVaishali Kulkarni 	bool tx_lpi_enable;
69*14b24e2bSVaishali Kulkarni };
70*14b24e2bSVaishali Kulkarni #endif
71*14b24e2bSVaishali Kulkarni 
72*14b24e2bSVaishali Kulkarni struct ecore_mcp_link_params {
73*14b24e2bSVaishali Kulkarni 	struct ecore_mcp_link_speed_params speed;
74*14b24e2bSVaishali Kulkarni 	struct ecore_mcp_link_pause_params pause;
75*14b24e2bSVaishali Kulkarni 	u32 loopback_mode; /* in PMM_LOOPBACK values */
76*14b24e2bSVaishali Kulkarni 	struct ecore_link_eee_params eee;
77*14b24e2bSVaishali Kulkarni };
78*14b24e2bSVaishali Kulkarni 
79*14b24e2bSVaishali Kulkarni struct ecore_mcp_link_capabilities {
80*14b24e2bSVaishali Kulkarni 	u32 speed_capabilities;
81*14b24e2bSVaishali Kulkarni 	bool default_speed_autoneg; /* In Mb/s */
82*14b24e2bSVaishali Kulkarni 	u32 default_speed; /* In Mb/s */
83*14b24e2bSVaishali Kulkarni 	enum ecore_mcp_eee_mode default_eee;
84*14b24e2bSVaishali Kulkarni 	u32 eee_lpi_timer;
85*14b24e2bSVaishali Kulkarni };
86*14b24e2bSVaishali Kulkarni 
87*14b24e2bSVaishali Kulkarni struct ecore_mcp_link_state {
88*14b24e2bSVaishali Kulkarni 	bool link_up;
89*14b24e2bSVaishali Kulkarni 
90*14b24e2bSVaishali Kulkarni 	u32 line_speed; /* In Mb/s */
91*14b24e2bSVaishali Kulkarni 	u32 min_pf_rate; /* In Mb/s */
92*14b24e2bSVaishali Kulkarni 	u32 speed; /* In Mb/s */
93*14b24e2bSVaishali Kulkarni 	bool full_duplex;
94*14b24e2bSVaishali Kulkarni 
95*14b24e2bSVaishali Kulkarni 	bool an;
96*14b24e2bSVaishali Kulkarni 	bool an_complete;
97*14b24e2bSVaishali Kulkarni 	bool parallel_detection;
98*14b24e2bSVaishali Kulkarni 	bool pfc_enabled;
99*14b24e2bSVaishali Kulkarni 
100*14b24e2bSVaishali Kulkarni #define ECORE_LINK_PARTNER_SPEED_1G_HD	(1 << 0)
101*14b24e2bSVaishali Kulkarni #define ECORE_LINK_PARTNER_SPEED_1G_FD	(1 << 1)
102*14b24e2bSVaishali Kulkarni #define ECORE_LINK_PARTNER_SPEED_10G	(1 << 2)
103*14b24e2bSVaishali Kulkarni #define ECORE_LINK_PARTNER_SPEED_20G	(1 << 3)
104*14b24e2bSVaishali Kulkarni #define ECORE_LINK_PARTNER_SPEED_25G	(1 << 4)
105*14b24e2bSVaishali Kulkarni #define ECORE_LINK_PARTNER_SPEED_40G	(1 << 5)
106*14b24e2bSVaishali Kulkarni #define ECORE_LINK_PARTNER_SPEED_50G	(1 << 6)
107*14b24e2bSVaishali Kulkarni #define ECORE_LINK_PARTNER_SPEED_100G	(1 << 7)
108*14b24e2bSVaishali Kulkarni 	u32 partner_adv_speed;
109*14b24e2bSVaishali Kulkarni 
110*14b24e2bSVaishali Kulkarni 	bool partner_tx_flow_ctrl_en;
111*14b24e2bSVaishali Kulkarni 	bool partner_rx_flow_ctrl_en;
112*14b24e2bSVaishali Kulkarni 
113*14b24e2bSVaishali Kulkarni #define ECORE_LINK_PARTNER_SYMMETRIC_PAUSE (1)
114*14b24e2bSVaishali Kulkarni #define ECORE_LINK_PARTNER_ASYMMETRIC_PAUSE (2)
115*14b24e2bSVaishali Kulkarni #define ECORE_LINK_PARTNER_BOTH_PAUSE (3)
116*14b24e2bSVaishali Kulkarni 	u8 partner_adv_pause;
117*14b24e2bSVaishali Kulkarni 
118*14b24e2bSVaishali Kulkarni 	bool sfp_tx_fault;
119*14b24e2bSVaishali Kulkarni 
120*14b24e2bSVaishali Kulkarni 	bool eee_active;
121*14b24e2bSVaishali Kulkarni 	u8 eee_adv_caps;
122*14b24e2bSVaishali Kulkarni 	u8 eee_lp_adv_caps;
123*14b24e2bSVaishali Kulkarni };
124*14b24e2bSVaishali Kulkarni 
125*14b24e2bSVaishali Kulkarni struct ecore_mcp_function_info {
126*14b24e2bSVaishali Kulkarni 	u8 pause_on_host;
127*14b24e2bSVaishali Kulkarni 
128*14b24e2bSVaishali Kulkarni 	enum ecore_pci_personality protocol;
129*14b24e2bSVaishali Kulkarni 
130*14b24e2bSVaishali Kulkarni 	u8 bandwidth_min;
131*14b24e2bSVaishali Kulkarni 	u8 bandwidth_max;
132*14b24e2bSVaishali Kulkarni 
133*14b24e2bSVaishali Kulkarni 	u8 mac[ETH_ALEN];
134*14b24e2bSVaishali Kulkarni 
135*14b24e2bSVaishali Kulkarni 	u64 wwn_port;
136*14b24e2bSVaishali Kulkarni 	u64 wwn_node;
137*14b24e2bSVaishali Kulkarni 
138*14b24e2bSVaishali Kulkarni #define ECORE_MCP_VLAN_UNSET		(0xffff)
139*14b24e2bSVaishali Kulkarni 	u16 ovlan;
140*14b24e2bSVaishali Kulkarni 
141*14b24e2bSVaishali Kulkarni 	u16 mtu;
142*14b24e2bSVaishali Kulkarni };
143*14b24e2bSVaishali Kulkarni 
144*14b24e2bSVaishali Kulkarni struct ecore_mcp_nvm_common {
145*14b24e2bSVaishali Kulkarni 	u32 offset;
146*14b24e2bSVaishali Kulkarni 	u32 param;
147*14b24e2bSVaishali Kulkarni 	u32 resp;
148*14b24e2bSVaishali Kulkarni 	u32 cmd;
149*14b24e2bSVaishali Kulkarni };
150*14b24e2bSVaishali Kulkarni 
151*14b24e2bSVaishali Kulkarni struct ecore_mcp_nvm_rd {
152*14b24e2bSVaishali Kulkarni 	u32 *buf_size;
153*14b24e2bSVaishali Kulkarni 	u32 *buf;
154*14b24e2bSVaishali Kulkarni };
155*14b24e2bSVaishali Kulkarni 
156*14b24e2bSVaishali Kulkarni struct ecore_mcp_nvm_wr {
157*14b24e2bSVaishali Kulkarni 	u32 buf_size;
158*14b24e2bSVaishali Kulkarni 	u32 *buf;
159*14b24e2bSVaishali Kulkarni };
160*14b24e2bSVaishali Kulkarni 
161*14b24e2bSVaishali Kulkarni struct ecore_mcp_nvm_params {
162*14b24e2bSVaishali Kulkarni #define ECORE_MCP_CMD		(1 << 0)
163*14b24e2bSVaishali Kulkarni #define ECORE_MCP_NVM_RD	(1 << 1)
164*14b24e2bSVaishali Kulkarni #define ECORE_MCP_NVM_WR	(1 << 2)
165*14b24e2bSVaishali Kulkarni 	u8 type;
166*14b24e2bSVaishali Kulkarni 
167*14b24e2bSVaishali Kulkarni 	struct ecore_mcp_nvm_common nvm_common;
168*14b24e2bSVaishali Kulkarni 
169*14b24e2bSVaishali Kulkarni 	union {
170*14b24e2bSVaishali Kulkarni 		struct ecore_mcp_nvm_rd nvm_rd;
171*14b24e2bSVaishali Kulkarni 		struct ecore_mcp_nvm_wr nvm_wr;
172*14b24e2bSVaishali Kulkarni 	};
173*14b24e2bSVaishali Kulkarni };
174*14b24e2bSVaishali Kulkarni 
175*14b24e2bSVaishali Kulkarni #ifndef __EXTRACT__LINUX__
176*14b24e2bSVaishali Kulkarni enum ecore_nvm_images {
177*14b24e2bSVaishali Kulkarni 	ECORE_NVM_IMAGE_ISCSI_CFG,
178*14b24e2bSVaishali Kulkarni 	ECORE_NVM_IMAGE_FCOE_CFG,
179*14b24e2bSVaishali Kulkarni 	ECORE_NVM_IMAGE_MDUMP,
180*14b24e2bSVaishali Kulkarni };
181*14b24e2bSVaishali Kulkarni #endif
182*14b24e2bSVaishali Kulkarni 
183*14b24e2bSVaishali Kulkarni struct ecore_mcp_drv_version {
184*14b24e2bSVaishali Kulkarni 	u32 version;
185*14b24e2bSVaishali Kulkarni 	u8 name[MCP_DRV_VER_STR_SIZE - 4];
186*14b24e2bSVaishali Kulkarni };
187*14b24e2bSVaishali Kulkarni 
188*14b24e2bSVaishali Kulkarni struct ecore_mcp_lan_stats {
189*14b24e2bSVaishali Kulkarni 	u64 ucast_rx_pkts;
190*14b24e2bSVaishali Kulkarni 	u64 ucast_tx_pkts;
191*14b24e2bSVaishali Kulkarni 	u32 fcs_err;
192*14b24e2bSVaishali Kulkarni };
193*14b24e2bSVaishali Kulkarni 
194*14b24e2bSVaishali Kulkarni #ifndef ECORE_PROTO_STATS
195*14b24e2bSVaishali Kulkarni #define ECORE_PROTO_STATS
196*14b24e2bSVaishali Kulkarni struct ecore_mcp_fcoe_stats {
197*14b24e2bSVaishali Kulkarni 	u64 rx_pkts;
198*14b24e2bSVaishali Kulkarni 	u64 tx_pkts;
199*14b24e2bSVaishali Kulkarni 	u32 fcs_err;
200*14b24e2bSVaishali Kulkarni 	u32 login_failure;
201*14b24e2bSVaishali Kulkarni };
202*14b24e2bSVaishali Kulkarni 
203*14b24e2bSVaishali Kulkarni struct ecore_mcp_iscsi_stats {
204*14b24e2bSVaishali Kulkarni 	u64 rx_pdus;
205*14b24e2bSVaishali Kulkarni 	u64 tx_pdus;
206*14b24e2bSVaishali Kulkarni 	u64 rx_bytes;
207*14b24e2bSVaishali Kulkarni 	u64 tx_bytes;
208*14b24e2bSVaishali Kulkarni };
209*14b24e2bSVaishali Kulkarni 
210*14b24e2bSVaishali Kulkarni struct ecore_mcp_rdma_stats {
211*14b24e2bSVaishali Kulkarni 	u64 rx_pkts;
212*14b24e2bSVaishali Kulkarni 	u64 tx_pkts;
213*14b24e2bSVaishali Kulkarni 	u64 rx_bytes;
214*14b24e2bSVaishali Kulkarni 	u64 tx_byts;
215*14b24e2bSVaishali Kulkarni };
216*14b24e2bSVaishali Kulkarni 
217*14b24e2bSVaishali Kulkarni enum ecore_mcp_protocol_type {
218*14b24e2bSVaishali Kulkarni 	ECORE_MCP_LAN_STATS,
219*14b24e2bSVaishali Kulkarni 	ECORE_MCP_FCOE_STATS,
220*14b24e2bSVaishali Kulkarni 	ECORE_MCP_ISCSI_STATS,
221*14b24e2bSVaishali Kulkarni 	ECORE_MCP_RDMA_STATS
222*14b24e2bSVaishali Kulkarni };
223*14b24e2bSVaishali Kulkarni 
224*14b24e2bSVaishali Kulkarni union ecore_mcp_protocol_stats {
225*14b24e2bSVaishali Kulkarni 	struct ecore_mcp_lan_stats lan_stats;
226*14b24e2bSVaishali Kulkarni 	struct ecore_mcp_fcoe_stats fcoe_stats;
227*14b24e2bSVaishali Kulkarni 	struct ecore_mcp_iscsi_stats iscsi_stats;
228*14b24e2bSVaishali Kulkarni 	struct ecore_mcp_rdma_stats rdma_stats;
229*14b24e2bSVaishali Kulkarni };
230*14b24e2bSVaishali Kulkarni #endif
231*14b24e2bSVaishali Kulkarni 
232*14b24e2bSVaishali Kulkarni enum ecore_ov_client {
233*14b24e2bSVaishali Kulkarni 	ECORE_OV_CLIENT_DRV,
234*14b24e2bSVaishali Kulkarni 	ECORE_OV_CLIENT_USER,
235*14b24e2bSVaishali Kulkarni 	ECORE_OV_CLIENT_VENDOR_SPEC
236*14b24e2bSVaishali Kulkarni };
237*14b24e2bSVaishali Kulkarni 
238*14b24e2bSVaishali Kulkarni enum ecore_ov_driver_state {
239*14b24e2bSVaishali Kulkarni 	ECORE_OV_DRIVER_STATE_NOT_LOADED,
240*14b24e2bSVaishali Kulkarni 	ECORE_OV_DRIVER_STATE_DISABLED,
241*14b24e2bSVaishali Kulkarni 	ECORE_OV_DRIVER_STATE_ACTIVE
242*14b24e2bSVaishali Kulkarni };
243*14b24e2bSVaishali Kulkarni 
244*14b24e2bSVaishali Kulkarni enum ecore_ov_wol {
245*14b24e2bSVaishali Kulkarni 	ECORE_OV_WOL_DEFAULT,
246*14b24e2bSVaishali Kulkarni 	ECORE_OV_WOL_DISABLED,
247*14b24e2bSVaishali Kulkarni 	ECORE_OV_WOL_ENABLED
248*14b24e2bSVaishali Kulkarni };
249*14b24e2bSVaishali Kulkarni 
250*14b24e2bSVaishali Kulkarni #ifndef __EXTRACT__LINUX__
251*14b24e2bSVaishali Kulkarni #define ECORE_MAX_NPIV_ENTRIES 128
252*14b24e2bSVaishali Kulkarni #define ECORE_WWN_SIZE 8
253*14b24e2bSVaishali Kulkarni struct ecore_fc_npiv_tbl {
254*14b24e2bSVaishali Kulkarni 	u16 num_wwpn;
255*14b24e2bSVaishali Kulkarni 	u16 num_wwnn;
256*14b24e2bSVaishali Kulkarni 	u8 wwpn[ECORE_MAX_NPIV_ENTRIES][ECORE_WWN_SIZE];
257*14b24e2bSVaishali Kulkarni 	u8 wwnn[ECORE_MAX_NPIV_ENTRIES][ECORE_WWN_SIZE];
258*14b24e2bSVaishali Kulkarni };
259*14b24e2bSVaishali Kulkarni 
260*14b24e2bSVaishali Kulkarni enum ecore_led_mode {
261*14b24e2bSVaishali Kulkarni 	ECORE_LED_MODE_OFF,
262*14b24e2bSVaishali Kulkarni 	ECORE_LED_MODE_ON,
263*14b24e2bSVaishali Kulkarni 	ECORE_LED_MODE_RESTORE
264*14b24e2bSVaishali Kulkarni };
265*14b24e2bSVaishali Kulkarni #endif
266*14b24e2bSVaishali Kulkarni 
267*14b24e2bSVaishali Kulkarni struct ecore_temperature_sensor {
268*14b24e2bSVaishali Kulkarni 	u8 sensor_location;
269*14b24e2bSVaishali Kulkarni 	u8 threshold_high;
270*14b24e2bSVaishali Kulkarni 	u8 critical;
271*14b24e2bSVaishali Kulkarni 	u8 current_temp;
272*14b24e2bSVaishali Kulkarni };
273*14b24e2bSVaishali Kulkarni 
274*14b24e2bSVaishali Kulkarni #define ECORE_MAX_NUM_OF_SENSORS	7
275*14b24e2bSVaishali Kulkarni struct ecore_temperature_info {
276*14b24e2bSVaishali Kulkarni 	u32 num_sensors;
277*14b24e2bSVaishali Kulkarni 	struct ecore_temperature_sensor sensors[ECORE_MAX_NUM_OF_SENSORS];
278*14b24e2bSVaishali Kulkarni };
279*14b24e2bSVaishali Kulkarni 
280*14b24e2bSVaishali Kulkarni enum ecore_mba_img_idx {
281*14b24e2bSVaishali Kulkarni 	ECORE_MBA_LEGACY_IDX,
282*14b24e2bSVaishali Kulkarni 	ECORE_MBA_PCI3CLP_IDX,
283*14b24e2bSVaishali Kulkarni 	ECORE_MBA_PCI3_IDX,
284*14b24e2bSVaishali Kulkarni 	ECORE_MBA_FCODE_IDX,
285*14b24e2bSVaishali Kulkarni 	ECORE_EFI_X86_IDX,
286*14b24e2bSVaishali Kulkarni 	ECORE_EFI_IPF_IDX,
287*14b24e2bSVaishali Kulkarni 	ECORE_EFI_EBC_IDX,
288*14b24e2bSVaishali Kulkarni 	ECORE_EFI_X64_IDX,
289*14b24e2bSVaishali Kulkarni 	ECORE_MAX_NUM_OF_ROMIMG
290*14b24e2bSVaishali Kulkarni };
291*14b24e2bSVaishali Kulkarni 
292*14b24e2bSVaishali Kulkarni struct ecore_mba_vers {
293*14b24e2bSVaishali Kulkarni 	u32 mba_vers[ECORE_MAX_NUM_OF_ROMIMG];
294*14b24e2bSVaishali Kulkarni };
295*14b24e2bSVaishali Kulkarni 
296*14b24e2bSVaishali Kulkarni enum ecore_mfw_tlv_type {
297*14b24e2bSVaishali Kulkarni 	ECORE_MFW_TLV_GENERIC = 0x1, /* Core driver TLVs */
298*14b24e2bSVaishali Kulkarni 	ECORE_MFW_TLV_ETH = 0x2, /* L2 driver TLVs */
299*14b24e2bSVaishali Kulkarni 	ECORE_MFW_TLV_FCOE = 0x4, /* FCoE protocol TLVs */
300*14b24e2bSVaishali Kulkarni 	ECORE_MFW_TLV_ISCSI = 0x8, /* SCSI protocol TLVs */
301*14b24e2bSVaishali Kulkarni 	ECORE_MFW_TLV_MAX = 0x16,
302*14b24e2bSVaishali Kulkarni };
303*14b24e2bSVaishali Kulkarni 
304*14b24e2bSVaishali Kulkarni struct ecore_mfw_tlv_generic {
305*14b24e2bSVaishali Kulkarni 	struct {
306*14b24e2bSVaishali Kulkarni 		u8 ipv4_csum_offload;
307*14b24e2bSVaishali Kulkarni 		u8 lso_supported;
308*14b24e2bSVaishali Kulkarni 		bool b_set;
309*14b24e2bSVaishali Kulkarni 	} flags;
310*14b24e2bSVaishali Kulkarni 
311*14b24e2bSVaishali Kulkarni #define ECORE_MFW_TLV_MAC_COUNT 3
312*14b24e2bSVaishali Kulkarni 	/* First entry for primary MAC, 2 secondary MACs possible */
313*14b24e2bSVaishali Kulkarni 	u8 mac[ECORE_MFW_TLV_MAC_COUNT][6];
314*14b24e2bSVaishali Kulkarni 	bool mac_set[ECORE_MFW_TLV_MAC_COUNT];
315*14b24e2bSVaishali Kulkarni 
316*14b24e2bSVaishali Kulkarni 	u64 rx_frames;
317*14b24e2bSVaishali Kulkarni 	bool rx_frames_set;
318*14b24e2bSVaishali Kulkarni 	u64 rx_bytes;
319*14b24e2bSVaishali Kulkarni 	bool rx_bytes_set;
320*14b24e2bSVaishali Kulkarni 	u64 tx_frames;
321*14b24e2bSVaishali Kulkarni 	bool tx_frames_set;
322*14b24e2bSVaishali Kulkarni 	u64 tx_bytes;
323*14b24e2bSVaishali Kulkarni 	bool tx_bytes_set;
324*14b24e2bSVaishali Kulkarni };
325*14b24e2bSVaishali Kulkarni 
326*14b24e2bSVaishali Kulkarni #ifndef __EXTRACT__LINUX__
327*14b24e2bSVaishali Kulkarni struct ecore_mfw_tlv_eth {
328*14b24e2bSVaishali Kulkarni 	u16 lso_maxoff_size;
329*14b24e2bSVaishali Kulkarni 	bool lso_maxoff_size_set;
330*14b24e2bSVaishali Kulkarni 	u16 lso_minseg_size;
331*14b24e2bSVaishali Kulkarni 	bool lso_minseg_size_set;
332*14b24e2bSVaishali Kulkarni 	u8 prom_mode;
333*14b24e2bSVaishali Kulkarni 	bool prom_mode_set;
334*14b24e2bSVaishali Kulkarni 	u16 tx_descr_size;
335*14b24e2bSVaishali Kulkarni 	bool tx_descr_size_set;
336*14b24e2bSVaishali Kulkarni 	u16 rx_descr_size;
337*14b24e2bSVaishali Kulkarni 	bool rx_descr_size_set;
338*14b24e2bSVaishali Kulkarni 	u16 netq_count;
339*14b24e2bSVaishali Kulkarni 	bool netq_count_set;
340*14b24e2bSVaishali Kulkarni 	u32 tcp4_offloads;
341*14b24e2bSVaishali Kulkarni 	bool tcp4_offloads_set;
342*14b24e2bSVaishali Kulkarni 	u32 tcp6_offloads;
343*14b24e2bSVaishali Kulkarni 	bool tcp6_offloads_set;
344*14b24e2bSVaishali Kulkarni 	u16 tx_descr_qdepth;
345*14b24e2bSVaishali Kulkarni 	bool tx_descr_qdepth_set;
346*14b24e2bSVaishali Kulkarni 	u16 rx_descr_qdepth;
347*14b24e2bSVaishali Kulkarni 	bool rx_descr_qdepth_set;
348*14b24e2bSVaishali Kulkarni 	u8 iov_offload;
349*14b24e2bSVaishali Kulkarni #define ECORE_MFW_TLV_IOV_OFFLOAD_NONE		(0)
350*14b24e2bSVaishali Kulkarni #define ECORE_MFW_TLV_IOV_OFFLOAD_MULTIQUEUE	(1)
351*14b24e2bSVaishali Kulkarni #define ECORE_MFW_TLV_IOV_OFFLOAD_VEB		(2)
352*14b24e2bSVaishali Kulkarni #define ECORE_MFW_TLV_IOV_OFFLOAD_VEPA		(3)
353*14b24e2bSVaishali Kulkarni 	bool iov_offload_set;
354*14b24e2bSVaishali Kulkarni 	u8 txqs_empty;
355*14b24e2bSVaishali Kulkarni 	bool txqs_empty_set;
356*14b24e2bSVaishali Kulkarni 	u8 rxqs_empty;
357*14b24e2bSVaishali Kulkarni 	bool rxqs_empty_set;
358*14b24e2bSVaishali Kulkarni 	u8 num_txqs_full;
359*14b24e2bSVaishali Kulkarni 	bool num_txqs_full_set;
360*14b24e2bSVaishali Kulkarni 	u8 num_rxqs_full;
361*14b24e2bSVaishali Kulkarni 	bool num_rxqs_full_set;
362*14b24e2bSVaishali Kulkarni };
363*14b24e2bSVaishali Kulkarni 
364*14b24e2bSVaishali Kulkarni struct ecore_mfw_tlv_time {
365*14b24e2bSVaishali Kulkarni 	bool b_set;
366*14b24e2bSVaishali Kulkarni 	u8 month;
367*14b24e2bSVaishali Kulkarni 	u8 day;
368*14b24e2bSVaishali Kulkarni 	u8 hour;
369*14b24e2bSVaishali Kulkarni 	u8 min;
370*14b24e2bSVaishali Kulkarni 	u16 msec;
371*14b24e2bSVaishali Kulkarni 	u16 usec;
372*14b24e2bSVaishali Kulkarni };
373*14b24e2bSVaishali Kulkarni 
374*14b24e2bSVaishali Kulkarni struct ecore_mfw_tlv_fcoe {
375*14b24e2bSVaishali Kulkarni 	u8 scsi_timeout;
376*14b24e2bSVaishali Kulkarni 	bool scsi_timeout_set;
377*14b24e2bSVaishali Kulkarni 	u32 rt_tov;
378*14b24e2bSVaishali Kulkarni 	bool rt_tov_set;
379*14b24e2bSVaishali Kulkarni 	u32 ra_tov;
380*14b24e2bSVaishali Kulkarni 	bool ra_tov_set;
381*14b24e2bSVaishali Kulkarni 	u32 ed_tov;
382*14b24e2bSVaishali Kulkarni 	bool ed_tov_set;
383*14b24e2bSVaishali Kulkarni 	u32 cr_tov;
384*14b24e2bSVaishali Kulkarni 	bool cr_tov_set;
385*14b24e2bSVaishali Kulkarni 	u8 boot_type;
386*14b24e2bSVaishali Kulkarni 	bool boot_type_set;
387*14b24e2bSVaishali Kulkarni 	u8 npiv_state;
388*14b24e2bSVaishali Kulkarni 	bool npiv_state_set;
389*14b24e2bSVaishali Kulkarni 	u32 num_npiv_ids;
390*14b24e2bSVaishali Kulkarni 	bool num_npiv_ids_set;
391*14b24e2bSVaishali Kulkarni 	u8 switch_name[8];
392*14b24e2bSVaishali Kulkarni 	bool switch_name_set;
393*14b24e2bSVaishali Kulkarni 	u16 switch_portnum;
394*14b24e2bSVaishali Kulkarni 	bool switch_portnum_set;
395*14b24e2bSVaishali Kulkarni 	u8 switch_portid[3];
396*14b24e2bSVaishali Kulkarni 	bool switch_portid_set;
397*14b24e2bSVaishali Kulkarni 	u8 vendor_name[8];
398*14b24e2bSVaishali Kulkarni 	bool vendor_name_set;
399*14b24e2bSVaishali Kulkarni 	u8 switch_model[8];
400*14b24e2bSVaishali Kulkarni 	bool switch_model_set;
401*14b24e2bSVaishali Kulkarni 	u8 switch_fw_version[8];
402*14b24e2bSVaishali Kulkarni 	bool switch_fw_version_set;
403*14b24e2bSVaishali Kulkarni 	u8 qos_pri;
404*14b24e2bSVaishali Kulkarni 	bool qos_pri_set;
405*14b24e2bSVaishali Kulkarni 	u8 port_alias[3];
406*14b24e2bSVaishali Kulkarni 	bool port_alias_set;
407*14b24e2bSVaishali Kulkarni 	u8 port_state;
408*14b24e2bSVaishali Kulkarni #define ECORE_MFW_TLV_PORT_STATE_OFFLINE	(0)
409*14b24e2bSVaishali Kulkarni #define ECORE_MFW_TLV_PORT_STATE_LOOP		(1)
410*14b24e2bSVaishali Kulkarni #define ECORE_MFW_TLV_PORT_STATE_P2P		(2)
411*14b24e2bSVaishali Kulkarni #define ECORE_MFW_TLV_PORT_STATE_FABRIC		(3)
412*14b24e2bSVaishali Kulkarni 	bool port_state_set;
413*14b24e2bSVaishali Kulkarni 	u16 fip_tx_descr_size;
414*14b24e2bSVaishali Kulkarni 	bool fip_tx_descr_size_set;
415*14b24e2bSVaishali Kulkarni 	u16 fip_rx_descr_size;
416*14b24e2bSVaishali Kulkarni 	bool fip_rx_descr_size_set;
417*14b24e2bSVaishali Kulkarni 	u16 link_failures;
418*14b24e2bSVaishali Kulkarni 	bool link_failures_set;
419*14b24e2bSVaishali Kulkarni 	u8 fcoe_boot_progress;
420*14b24e2bSVaishali Kulkarni 	bool fcoe_boot_progress_set;
421*14b24e2bSVaishali Kulkarni 	u64 rx_bcast;
422*14b24e2bSVaishali Kulkarni 	bool rx_bcast_set;
423*14b24e2bSVaishali Kulkarni 	u64 tx_bcast;
424*14b24e2bSVaishali Kulkarni 	bool tx_bcast_set;
425*14b24e2bSVaishali Kulkarni 	u16 fcoe_txq_depth;
426*14b24e2bSVaishali Kulkarni 	bool fcoe_txq_depth_set;
427*14b24e2bSVaishali Kulkarni 	u16 fcoe_rxq_depth;
428*14b24e2bSVaishali Kulkarni 	bool fcoe_rxq_depth_set;
429*14b24e2bSVaishali Kulkarni 	u64 fcoe_rx_frames;
430*14b24e2bSVaishali Kulkarni 	bool fcoe_rx_frames_set;
431*14b24e2bSVaishali Kulkarni 	u64 fcoe_rx_bytes;
432*14b24e2bSVaishali Kulkarni 	bool fcoe_rx_bytes_set;
433*14b24e2bSVaishali Kulkarni 	u64 fcoe_tx_frames;
434*14b24e2bSVaishali Kulkarni 	bool fcoe_tx_frames_set;
435*14b24e2bSVaishali Kulkarni 	u64 fcoe_tx_bytes;
436*14b24e2bSVaishali Kulkarni 	bool fcoe_tx_bytes_set;
437*14b24e2bSVaishali Kulkarni 	u16 crc_count;
438*14b24e2bSVaishali Kulkarni 	bool crc_count_set;
439*14b24e2bSVaishali Kulkarni 	u32 crc_err_src_fcid[5];
440*14b24e2bSVaishali Kulkarni 	bool crc_err_src_fcid_set[5];
441*14b24e2bSVaishali Kulkarni 	struct ecore_mfw_tlv_time crc_err[5];
442*14b24e2bSVaishali Kulkarni 	u16 losync_err;
443*14b24e2bSVaishali Kulkarni 	bool losync_err_set;
444*14b24e2bSVaishali Kulkarni 	u16 losig_err;
445*14b24e2bSVaishali Kulkarni 	bool losig_err_set;
446*14b24e2bSVaishali Kulkarni 	u16 primtive_err;
447*14b24e2bSVaishali Kulkarni 	bool primtive_err_set;
448*14b24e2bSVaishali Kulkarni 	u16 disparity_err;
449*14b24e2bSVaishali Kulkarni 	bool disparity_err_set;
450*14b24e2bSVaishali Kulkarni 	u16 code_violation_err;
451*14b24e2bSVaishali Kulkarni 	bool code_violation_err_set;
452*14b24e2bSVaishali Kulkarni 	u32 flogi_param[4];
453*14b24e2bSVaishali Kulkarni 	bool flogi_param_set[4];
454*14b24e2bSVaishali Kulkarni 	struct ecore_mfw_tlv_time flogi_tstamp;
455*14b24e2bSVaishali Kulkarni 	u32 flogi_acc_param[4];
456*14b24e2bSVaishali Kulkarni 	bool flogi_acc_param_set[4];
457*14b24e2bSVaishali Kulkarni 	struct ecore_mfw_tlv_time flogi_acc_tstamp;
458*14b24e2bSVaishali Kulkarni 	u32 flogi_rjt;
459*14b24e2bSVaishali Kulkarni 	bool flogi_rjt_set;
460*14b24e2bSVaishali Kulkarni 	struct ecore_mfw_tlv_time flogi_rjt_tstamp;
461*14b24e2bSVaishali Kulkarni 	u32 fdiscs;
462*14b24e2bSVaishali Kulkarni 	bool fdiscs_set;
463*14b24e2bSVaishali Kulkarni 	u8 fdisc_acc;
464*14b24e2bSVaishali Kulkarni 	bool fdisc_acc_set;
465*14b24e2bSVaishali Kulkarni 	u8 fdisc_rjt;
466*14b24e2bSVaishali Kulkarni 	bool fdisc_rjt_set;
467*14b24e2bSVaishali Kulkarni 	u8 plogi;
468*14b24e2bSVaishali Kulkarni 	bool plogi_set;
469*14b24e2bSVaishali Kulkarni 	u8 plogi_acc;
470*14b24e2bSVaishali Kulkarni 	bool plogi_acc_set;
471*14b24e2bSVaishali Kulkarni 	u8 plogi_rjt;
472*14b24e2bSVaishali Kulkarni 	bool plogi_rjt_set;
473*14b24e2bSVaishali Kulkarni 	u32 plogi_dst_fcid[5];
474*14b24e2bSVaishali Kulkarni 	bool plogi_dst_fcid_set[5];
475*14b24e2bSVaishali Kulkarni 	struct ecore_mfw_tlv_time plogi_tstamp[5];
476*14b24e2bSVaishali Kulkarni 	u32 plogi_acc_src_fcid[5];
477*14b24e2bSVaishali Kulkarni 	bool plogi_acc_src_fcid_set[5];
478*14b24e2bSVaishali Kulkarni 	struct ecore_mfw_tlv_time plogi_acc_tstamp[5];
479*14b24e2bSVaishali Kulkarni 	u8 tx_plogos;
480*14b24e2bSVaishali Kulkarni 	bool tx_plogos_set;
481*14b24e2bSVaishali Kulkarni 	u8 plogo_acc;
482*14b24e2bSVaishali Kulkarni 	bool plogo_acc_set;
483*14b24e2bSVaishali Kulkarni 	u8 plogo_rjt;
484*14b24e2bSVaishali Kulkarni 	bool plogo_rjt_set;
485*14b24e2bSVaishali Kulkarni 	u32 plogo_src_fcid[5];
486*14b24e2bSVaishali Kulkarni 	bool plogo_src_fcid_set[5];
487*14b24e2bSVaishali Kulkarni 	struct ecore_mfw_tlv_time plogo_tstamp[5];
488*14b24e2bSVaishali Kulkarni 	u8 rx_logos;
489*14b24e2bSVaishali Kulkarni 	bool rx_logos_set;
490*14b24e2bSVaishali Kulkarni 	u8 tx_accs;
491*14b24e2bSVaishali Kulkarni 	bool tx_accs_set;
492*14b24e2bSVaishali Kulkarni 	u8 tx_prlis;
493*14b24e2bSVaishali Kulkarni 	bool tx_prlis_set;
494*14b24e2bSVaishali Kulkarni 	u8 rx_accs;
495*14b24e2bSVaishali Kulkarni 	bool rx_accs_set;
496*14b24e2bSVaishali Kulkarni 	u8 tx_abts;
497*14b24e2bSVaishali Kulkarni 	bool tx_abts_set;
498*14b24e2bSVaishali Kulkarni 	u8 rx_abts_acc;
499*14b24e2bSVaishali Kulkarni 	bool rx_abts_acc_set;
500*14b24e2bSVaishali Kulkarni 	u8 rx_abts_rjt;
501*14b24e2bSVaishali Kulkarni 	bool rx_abts_rjt_set;
502*14b24e2bSVaishali Kulkarni 	u32 abts_dst_fcid[5];
503*14b24e2bSVaishali Kulkarni 	bool abts_dst_fcid_set[5];
504*14b24e2bSVaishali Kulkarni 	struct ecore_mfw_tlv_time abts_tstamp[5];
505*14b24e2bSVaishali Kulkarni 	u8 rx_rscn;
506*14b24e2bSVaishali Kulkarni 	bool rx_rscn_set;
507*14b24e2bSVaishali Kulkarni 	u32 rx_rscn_nport[4];
508*14b24e2bSVaishali Kulkarni 	bool rx_rscn_nport_set[4];
509*14b24e2bSVaishali Kulkarni 	u8 tx_lun_rst;
510*14b24e2bSVaishali Kulkarni 	bool tx_lun_rst_set;
511*14b24e2bSVaishali Kulkarni 	u8 abort_task_sets;
512*14b24e2bSVaishali Kulkarni 	bool abort_task_sets_set;
513*14b24e2bSVaishali Kulkarni 	u8 tx_tprlos;
514*14b24e2bSVaishali Kulkarni 	bool tx_tprlos_set;
515*14b24e2bSVaishali Kulkarni 	u8 tx_nos;
516*14b24e2bSVaishali Kulkarni 	bool tx_nos_set;
517*14b24e2bSVaishali Kulkarni 	u8 rx_nos;
518*14b24e2bSVaishali Kulkarni 	bool rx_nos_set;
519*14b24e2bSVaishali Kulkarni 	u8 ols;
520*14b24e2bSVaishali Kulkarni 	bool ols_set;
521*14b24e2bSVaishali Kulkarni 	u8 lr;
522*14b24e2bSVaishali Kulkarni 	bool lr_set;
523*14b24e2bSVaishali Kulkarni 	u8 lrr;
524*14b24e2bSVaishali Kulkarni 	bool lrr_set;
525*14b24e2bSVaishali Kulkarni 	u8 tx_lip;
526*14b24e2bSVaishali Kulkarni 	bool tx_lip_set;
527*14b24e2bSVaishali Kulkarni 	u8 rx_lip;
528*14b24e2bSVaishali Kulkarni 	bool rx_lip_set;
529*14b24e2bSVaishali Kulkarni 	u8 eofa;
530*14b24e2bSVaishali Kulkarni 	bool eofa_set;
531*14b24e2bSVaishali Kulkarni 	u8 eofni;
532*14b24e2bSVaishali Kulkarni 	bool eofni_set;
533*14b24e2bSVaishali Kulkarni 	u8 scsi_chks;
534*14b24e2bSVaishali Kulkarni 	bool scsi_chks_set;
535*14b24e2bSVaishali Kulkarni 	u8 scsi_cond_met;
536*14b24e2bSVaishali Kulkarni 	bool scsi_cond_met_set;
537*14b24e2bSVaishali Kulkarni 	u8 scsi_busy;
538*14b24e2bSVaishali Kulkarni 	bool scsi_busy_set;
539*14b24e2bSVaishali Kulkarni 	u8 scsi_inter;
540*14b24e2bSVaishali Kulkarni 	bool scsi_inter_set;
541*14b24e2bSVaishali Kulkarni 	u8 scsi_inter_cond_met;
542*14b24e2bSVaishali Kulkarni 	bool scsi_inter_cond_met_set;
543*14b24e2bSVaishali Kulkarni 	u8 scsi_rsv_conflicts;
544*14b24e2bSVaishali Kulkarni 	bool scsi_rsv_conflicts_set;
545*14b24e2bSVaishali Kulkarni 	u8 scsi_tsk_full;
546*14b24e2bSVaishali Kulkarni 	bool scsi_tsk_full_set;
547*14b24e2bSVaishali Kulkarni 	u8 scsi_aca_active;
548*14b24e2bSVaishali Kulkarni 	bool scsi_aca_active_set;
549*14b24e2bSVaishali Kulkarni 	u8 scsi_tsk_abort;
550*14b24e2bSVaishali Kulkarni 	bool scsi_tsk_abort_set;
551*14b24e2bSVaishali Kulkarni 	u32 scsi_rx_chk[5];
552*14b24e2bSVaishali Kulkarni 	bool scsi_rx_chk_set[5];
553*14b24e2bSVaishali Kulkarni 	struct ecore_mfw_tlv_time scsi_chk_tstamp[5];
554*14b24e2bSVaishali Kulkarni };
555*14b24e2bSVaishali Kulkarni 
556*14b24e2bSVaishali Kulkarni struct ecore_mfw_tlv_iscsi {
557*14b24e2bSVaishali Kulkarni 	u8 target_llmnr;
558*14b24e2bSVaishali Kulkarni 	bool target_llmnr_set;
559*14b24e2bSVaishali Kulkarni 	u8 header_digest;
560*14b24e2bSVaishali Kulkarni 	bool header_digest_set;
561*14b24e2bSVaishali Kulkarni 	u8 data_digest;
562*14b24e2bSVaishali Kulkarni 	bool data_digest_set;
563*14b24e2bSVaishali Kulkarni 	u8 auth_method;
564*14b24e2bSVaishali Kulkarni #define ECORE_MFW_TLV_AUTH_METHOD_NONE		(1)
565*14b24e2bSVaishali Kulkarni #define ECORE_MFW_TLV_AUTH_METHOD_CHAP		(2)
566*14b24e2bSVaishali Kulkarni #define ECORE_MFW_TLV_AUTH_METHOD_MUTUAL_CHAP	(3)
567*14b24e2bSVaishali Kulkarni 	bool auth_method_set;
568*14b24e2bSVaishali Kulkarni 	u16 boot_taget_portal;
569*14b24e2bSVaishali Kulkarni 	bool boot_taget_portal_set;
570*14b24e2bSVaishali Kulkarni 	u16 frame_size;
571*14b24e2bSVaishali Kulkarni 	bool frame_size_set;
572*14b24e2bSVaishali Kulkarni 	u16 tx_desc_size;
573*14b24e2bSVaishali Kulkarni 	bool tx_desc_size_set;
574*14b24e2bSVaishali Kulkarni 	u16 rx_desc_size;
575*14b24e2bSVaishali Kulkarni 	bool rx_desc_size_set;
576*14b24e2bSVaishali Kulkarni 	u8 boot_progress;
577*14b24e2bSVaishali Kulkarni 	bool boot_progress_set;
578*14b24e2bSVaishali Kulkarni 	u16 tx_desc_qdepth;
579*14b24e2bSVaishali Kulkarni 	bool tx_desc_qdepth_set;
580*14b24e2bSVaishali Kulkarni 	u16 rx_desc_qdepth;
581*14b24e2bSVaishali Kulkarni 	bool rx_desc_qdepth_set;
582*14b24e2bSVaishali Kulkarni 	u64 rx_frames;
583*14b24e2bSVaishali Kulkarni 	bool rx_frames_set;
584*14b24e2bSVaishali Kulkarni 	u64 rx_bytes;
585*14b24e2bSVaishali Kulkarni 	bool rx_bytes_set;
586*14b24e2bSVaishali Kulkarni 	u64 tx_frames;
587*14b24e2bSVaishali Kulkarni 	bool tx_frames_set;
588*14b24e2bSVaishali Kulkarni 	u64 tx_bytes;
589*14b24e2bSVaishali Kulkarni 	bool tx_bytes_set;
590*14b24e2bSVaishali Kulkarni };
591*14b24e2bSVaishali Kulkarni #endif
592*14b24e2bSVaishali Kulkarni 
593*14b24e2bSVaishali Kulkarni union ecore_mfw_tlv_data {
594*14b24e2bSVaishali Kulkarni 	struct ecore_mfw_tlv_generic generic;
595*14b24e2bSVaishali Kulkarni 	struct ecore_mfw_tlv_eth eth;
596*14b24e2bSVaishali Kulkarni 	struct ecore_mfw_tlv_fcoe fcoe;
597*14b24e2bSVaishali Kulkarni 	struct ecore_mfw_tlv_iscsi iscsi;
598*14b24e2bSVaishali Kulkarni };
599*14b24e2bSVaishali Kulkarni 
600*14b24e2bSVaishali Kulkarni enum ecore_hw_info_change {
601*14b24e2bSVaishali Kulkarni 	ECORE_HW_INFO_CHANGE_OVLAN,
602*14b24e2bSVaishali Kulkarni };
603*14b24e2bSVaishali Kulkarni 
604*14b24e2bSVaishali Kulkarni /**
605*14b24e2bSVaishali Kulkarni  * @brief - returns the link params of the hw function
606*14b24e2bSVaishali Kulkarni  *
607*14b24e2bSVaishali Kulkarni  * @param p_hwfn
608*14b24e2bSVaishali Kulkarni  *
609*14b24e2bSVaishali Kulkarni  * @returns pointer to link params
610*14b24e2bSVaishali Kulkarni  */
611*14b24e2bSVaishali Kulkarni struct ecore_mcp_link_params *ecore_mcp_get_link_params(struct ecore_hwfn*);
612*14b24e2bSVaishali Kulkarni 
613*14b24e2bSVaishali Kulkarni /**
614*14b24e2bSVaishali Kulkarni  * @brief - return the link state of the hw function
615*14b24e2bSVaishali Kulkarni  *
616*14b24e2bSVaishali Kulkarni  * @param p_hwfn
617*14b24e2bSVaishali Kulkarni  *
618*14b24e2bSVaishali Kulkarni  * @returns pointer to link state
619*14b24e2bSVaishali Kulkarni  */
620*14b24e2bSVaishali Kulkarni struct ecore_mcp_link_state *ecore_mcp_get_link_state(struct ecore_hwfn*);
621*14b24e2bSVaishali Kulkarni 
622*14b24e2bSVaishali Kulkarni /**
623*14b24e2bSVaishali Kulkarni  * @brief - return the link capabilities of the hw function
624*14b24e2bSVaishali Kulkarni  *
625*14b24e2bSVaishali Kulkarni  * @param p_hwfn
626*14b24e2bSVaishali Kulkarni  *
627*14b24e2bSVaishali Kulkarni  * @returns pointer to link capabilities
628*14b24e2bSVaishali Kulkarni  */
629*14b24e2bSVaishali Kulkarni struct ecore_mcp_link_capabilities
630*14b24e2bSVaishali Kulkarni *ecore_mcp_get_link_capabilities(struct ecore_hwfn *p_hwfn);
631*14b24e2bSVaishali Kulkarni 
632*14b24e2bSVaishali Kulkarni /**
633*14b24e2bSVaishali Kulkarni  * @brief Request the MFW to set the the link according to 'link_input'.
634*14b24e2bSVaishali Kulkarni  *
635*14b24e2bSVaishali Kulkarni  * @param p_hwfn
636*14b24e2bSVaishali Kulkarni  * @param p_ptt
637*14b24e2bSVaishali Kulkarni  * @param b_up - raise link if `true'. Reset link if `false'.
638*14b24e2bSVaishali Kulkarni  *
639*14b24e2bSVaishali Kulkarni  * @return enum _ecore_status_t
640*14b24e2bSVaishali Kulkarni  */
641*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_mcp_set_link(struct ecore_hwfn *p_hwfn,
642*14b24e2bSVaishali Kulkarni 					struct ecore_ptt *p_ptt,
643*14b24e2bSVaishali Kulkarni 					bool b_up);
644*14b24e2bSVaishali Kulkarni 
645*14b24e2bSVaishali Kulkarni /**
646*14b24e2bSVaishali Kulkarni  * @brief Get the management firmware version value
647*14b24e2bSVaishali Kulkarni  *
648*14b24e2bSVaishali Kulkarni  * @param p_hwfn
649*14b24e2bSVaishali Kulkarni  * @param p_ptt
650*14b24e2bSVaishali Kulkarni  * @param p_mfw_ver    - mfw version value
651*14b24e2bSVaishali Kulkarni  * @param p_running_bundle_id	- image id in nvram; Optional.
652*14b24e2bSVaishali Kulkarni  *
653*14b24e2bSVaishali Kulkarni  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
654*14b24e2bSVaishali Kulkarni  */
655*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_mcp_get_mfw_ver(struct ecore_hwfn *p_hwfn,
656*14b24e2bSVaishali Kulkarni 					   struct ecore_ptt *p_ptt,
657*14b24e2bSVaishali Kulkarni 					   u32 *p_mfw_ver,
658*14b24e2bSVaishali Kulkarni 					   u32 *p_running_bundle_id);
659*14b24e2bSVaishali Kulkarni 
660*14b24e2bSVaishali Kulkarni /**
661*14b24e2bSVaishali Kulkarni  * @brief Get the MBI version value
662*14b24e2bSVaishali Kulkarni  *
663*14b24e2bSVaishali Kulkarni  * @param p_hwfn
664*14b24e2bSVaishali Kulkarni  * @param p_ptt
665*14b24e2bSVaishali Kulkarni  * @param p_mbi_ver - A pointer to a variable to be filled with the MBI version.
666*14b24e2bSVaishali Kulkarni  *
667*14b24e2bSVaishali Kulkarni  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
668*14b24e2bSVaishali Kulkarni  */
669*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_mcp_get_mbi_ver(struct ecore_hwfn *p_hwfn,
670*14b24e2bSVaishali Kulkarni 					   struct ecore_ptt *p_ptt,
671*14b24e2bSVaishali Kulkarni 					   u32 *p_mbi_ver);
672*14b24e2bSVaishali Kulkarni 
673*14b24e2bSVaishali Kulkarni /**
674*14b24e2bSVaishali Kulkarni  * @brief Get media type value of the port.
675*14b24e2bSVaishali Kulkarni  *
676*14b24e2bSVaishali Kulkarni  * @param p_dev      - ecore dev pointer
677*14b24e2bSVaishali Kulkarni  * @param mfw_ver    - media type value
678*14b24e2bSVaishali Kulkarni  *
679*14b24e2bSVaishali Kulkarni  * @return enum _ecore_status_t -
680*14b24e2bSVaishali Kulkarni  *      ECORE_SUCCESS - Operation was successful.
681*14b24e2bSVaishali Kulkarni  *      ECORE_BUSY - Operation failed
682*14b24e2bSVaishali Kulkarni  */
683*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_mcp_get_media_type(struct ecore_dev *p_dev,
684*14b24e2bSVaishali Kulkarni 					   u32 *media_type);
685*14b24e2bSVaishali Kulkarni 
686*14b24e2bSVaishali Kulkarni /**
687*14b24e2bSVaishali Kulkarni  * @brief - Sends a command to the MCP mailbox.
688*14b24e2bSVaishali Kulkarni  *
689*14b24e2bSVaishali Kulkarni  * @param p_hwfn      - hw function
690*14b24e2bSVaishali Kulkarni  * @param p_ptt       - PTT required for register access
691*14b24e2bSVaishali Kulkarni  * @param cmd         - command to be sent to the MCP
692*14b24e2bSVaishali Kulkarni  * @param param       - optional param
693*14b24e2bSVaishali Kulkarni  * @param o_mcp_resp  - the MCP response code (exclude sequence)
694*14b24e2bSVaishali Kulkarni  * @param o_mcp_param - optional parameter provided by the MCP response
695*14b24e2bSVaishali Kulkarni  *
696*14b24e2bSVaishali Kulkarni  * @return enum _ecore_status_t -
697*14b24e2bSVaishali Kulkarni  *      ECORE_SUCCESS - operation was successful
698*14b24e2bSVaishali Kulkarni  *      ECORE_BUSY    - operation failed
699*14b24e2bSVaishali Kulkarni  */
700*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_mcp_cmd(struct ecore_hwfn *p_hwfn,
701*14b24e2bSVaishali Kulkarni 				   struct ecore_ptt *p_ptt, u32 cmd, u32 param,
702*14b24e2bSVaishali Kulkarni 				   u32 *o_mcp_resp, u32 *o_mcp_param);
703*14b24e2bSVaishali Kulkarni 
704*14b24e2bSVaishali Kulkarni /**
705*14b24e2bSVaishali Kulkarni  * @brief - drains the nig, allowing completion to pass in case of pauses.
706*14b24e2bSVaishali Kulkarni  *          (Should be called only from sleepable context)
707*14b24e2bSVaishali Kulkarni  *
708*14b24e2bSVaishali Kulkarni  * @param p_hwfn
709*14b24e2bSVaishali Kulkarni  * @param p_ptt
710*14b24e2bSVaishali Kulkarni  */
711*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_mcp_drain(struct ecore_hwfn *p_hwfn,
712*14b24e2bSVaishali Kulkarni 				     struct ecore_ptt *p_ptt);
713*14b24e2bSVaishali Kulkarni 
714*14b24e2bSVaishali Kulkarni #ifndef LINUX_REMOVE
715*14b24e2bSVaishali Kulkarni /**
716*14b24e2bSVaishali Kulkarni  * @brief - return the mcp function info of the hw function
717*14b24e2bSVaishali Kulkarni  *
718*14b24e2bSVaishali Kulkarni  * @param p_hwfn
719*14b24e2bSVaishali Kulkarni  *
720*14b24e2bSVaishali Kulkarni  * @returns pointer to mcp function info
721*14b24e2bSVaishali Kulkarni  */
722*14b24e2bSVaishali Kulkarni const struct ecore_mcp_function_info
723*14b24e2bSVaishali Kulkarni *ecore_mcp_get_function_info(struct ecore_hwfn *p_hwfn);
724*14b24e2bSVaishali Kulkarni #endif
725*14b24e2bSVaishali Kulkarni 
726*14b24e2bSVaishali Kulkarni /**
727*14b24e2bSVaishali Kulkarni  * @brief - Function for reading/manipulating the nvram. Following are supported
728*14b24e2bSVaishali Kulkarni  *          functionalities.
729*14b24e2bSVaishali Kulkarni  *          1. Read: Read the specified nvram offset.
730*14b24e2bSVaishali Kulkarni  *             input values:
731*14b24e2bSVaishali Kulkarni  *               type   - ECORE_MCP_NVM_RD
732*14b24e2bSVaishali Kulkarni  *               cmd    - command code (e.g. DRV_MSG_CODE_NVM_READ_NVRAM)
733*14b24e2bSVaishali Kulkarni  *               offset - nvm offset
734*14b24e2bSVaishali Kulkarni  *
735*14b24e2bSVaishali Kulkarni  *             output values:
736*14b24e2bSVaishali Kulkarni  *               buf      - buffer
737*14b24e2bSVaishali Kulkarni  *               buf_size - buffer size
738*14b24e2bSVaishali Kulkarni  *
739*14b24e2bSVaishali Kulkarni  *          2. Write: Write the data at the specified nvram offset
740*14b24e2bSVaishali Kulkarni  *             input values:
741*14b24e2bSVaishali Kulkarni  *               type     - ECORE_MCP_NVM_WR
742*14b24e2bSVaishali Kulkarni  *               cmd      - command code (e.g. DRV_MSG_CODE_NVM_WRITE_NVRAM)
743*14b24e2bSVaishali Kulkarni  *               offset   - nvm offset
744*14b24e2bSVaishali Kulkarni  *               buf      - buffer
745*14b24e2bSVaishali Kulkarni  *               buf_size - buffer size
746*14b24e2bSVaishali Kulkarni  *
747*14b24e2bSVaishali Kulkarni  *          3. Command: Send the NVM command to MCP.
748*14b24e2bSVaishali Kulkarni  *             input values:
749*14b24e2bSVaishali Kulkarni  *               type   - ECORE_MCP_CMD
750*14b24e2bSVaishali Kulkarni  *               cmd    - command code (e.g. DRV_MSG_CODE_NVM_DEL_FILE)
751*14b24e2bSVaishali Kulkarni  *               offset - nvm offset
752*14b24e2bSVaishali Kulkarni  *
753*14b24e2bSVaishali Kulkarni  *
754*14b24e2bSVaishali Kulkarni  * @param p_hwfn
755*14b24e2bSVaishali Kulkarni  * @param p_ptt
756*14b24e2bSVaishali Kulkarni  * @param params
757*14b24e2bSVaishali Kulkarni  *
758*14b24e2bSVaishali Kulkarni  * @return ECORE_SUCCESS - operation was successful.
759*14b24e2bSVaishali Kulkarni  */
760*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_mcp_nvm_command(struct ecore_hwfn *p_hwfn,
761*14b24e2bSVaishali Kulkarni 					   struct ecore_ptt *p_ptt,
762*14b24e2bSVaishali Kulkarni 					   struct ecore_mcp_nvm_params *params);
763*14b24e2bSVaishali Kulkarni 
764*14b24e2bSVaishali Kulkarni #ifndef LINUX_REMOVE
765*14b24e2bSVaishali Kulkarni /**
766*14b24e2bSVaishali Kulkarni  * @brief - count number of function with a matching personality on engine.
767*14b24e2bSVaishali Kulkarni  *
768*14b24e2bSVaishali Kulkarni  * @param p_hwfn
769*14b24e2bSVaishali Kulkarni  * @param p_ptt
770*14b24e2bSVaishali Kulkarni  * @param personalities - a bitmask of ecore_pci_personality values
771*14b24e2bSVaishali Kulkarni  *
772*14b24e2bSVaishali Kulkarni  * @returns the count of all devices on engine whose personality match one of
773*14b24e2bSVaishali Kulkarni  *          the bitsmasks.
774*14b24e2bSVaishali Kulkarni  */
775*14b24e2bSVaishali Kulkarni int ecore_mcp_get_personality_cnt(struct ecore_hwfn *p_hwfn,
776*14b24e2bSVaishali Kulkarni 				  struct ecore_ptt *p_ptt,
777*14b24e2bSVaishali Kulkarni 				  u32 personalities);
778*14b24e2bSVaishali Kulkarni #endif
779*14b24e2bSVaishali Kulkarni 
780*14b24e2bSVaishali Kulkarni /**
781*14b24e2bSVaishali Kulkarni  * @brief Get the flash size value
782*14b24e2bSVaishali Kulkarni  *
783