xref: /linux/drivers/net/ethernet/qlogic/qed/qed_mcp.h (revision 0cc3a8017900f856f9bf4fdc41c2b5cb1670aabe)
11f4d4ed6SAlexander Lobakin /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
2fe56b9e6SYuval Mintz /* QLogic qed NIC Driver
3e8f1cb50SMintz, Yuval  * Copyright (c) 2015-2017  QLogic Corporation
4663eacd8SAlexander Lobakin  * Copyright (c) 2019-2020 Marvell International Ltd.
5fe56b9e6SYuval Mintz  */
6fe56b9e6SYuval Mintz 
7fe56b9e6SYuval Mintz #ifndef _QED_MCP_H
8fe56b9e6SYuval Mintz #define _QED_MCP_H
9fe56b9e6SYuval Mintz 
10fe56b9e6SYuval Mintz #include <linux/types.h>
11fe56b9e6SYuval Mintz #include <linux/delay.h>
12fe56b9e6SYuval Mintz #include <linux/slab.h>
135529bad9STomer Tayar #include <linux/spinlock.h>
141e128c81SArun Easi #include <linux/qed/qed_fcoe_if.h>
15fe56b9e6SYuval Mintz #include "qed_hsi.h"
165d24bcf1STomer Tayar #include "qed_dev_api.h"
17fe56b9e6SYuval Mintz 
18*0cc3a801SManish Chopra #define QED_MFW_REPORT_STR_SIZE	256
19*0cc3a801SManish Chopra 
20cc875c2eSYuval Mintz struct qed_mcp_link_speed_params {
21cc875c2eSYuval Mintz 	bool					autoneg;
2299785a87SAlexander Lobakin 
235d4193c6SAlexander Lobakin 	u32					advertised_speeds;
2499785a87SAlexander Lobakin #define QED_EXT_SPEED_MASK_RES			0x1
2599785a87SAlexander Lobakin #define QED_EXT_SPEED_MASK_1G			0x2
2699785a87SAlexander Lobakin #define QED_EXT_SPEED_MASK_10G			0x4
2799785a87SAlexander Lobakin #define QED_EXT_SPEED_MASK_20G			0x8
2899785a87SAlexander Lobakin #define QED_EXT_SPEED_MASK_25G			0x10
2999785a87SAlexander Lobakin #define QED_EXT_SPEED_MASK_40G			0x20
3099785a87SAlexander Lobakin #define QED_EXT_SPEED_MASK_50G_R		0x40
3199785a87SAlexander Lobakin #define QED_EXT_SPEED_MASK_50G_R2		0x80
3299785a87SAlexander Lobakin #define QED_EXT_SPEED_MASK_100G_R2		0x100
3399785a87SAlexander Lobakin #define QED_EXT_SPEED_MASK_100G_R4		0x200
3499785a87SAlexander Lobakin #define QED_EXT_SPEED_MASK_100G_P4		0x400
3599785a87SAlexander Lobakin 
36cc875c2eSYuval Mintz 	u32					forced_speed;	   /* In Mb/s */
3799785a87SAlexander Lobakin #define QED_EXT_SPEED_1G			0x1
3899785a87SAlexander Lobakin #define QED_EXT_SPEED_10G			0x2
3999785a87SAlexander Lobakin #define QED_EXT_SPEED_20G			0x4
4099785a87SAlexander Lobakin #define QED_EXT_SPEED_25G			0x8
4199785a87SAlexander Lobakin #define QED_EXT_SPEED_40G			0x10
4299785a87SAlexander Lobakin #define QED_EXT_SPEED_50G_R			0x20
4399785a87SAlexander Lobakin #define QED_EXT_SPEED_50G_R2			0x40
4499785a87SAlexander Lobakin #define QED_EXT_SPEED_100G_R2			0x80
4599785a87SAlexander Lobakin #define QED_EXT_SPEED_100G_R4			0x100
4699785a87SAlexander Lobakin #define QED_EXT_SPEED_100G_P4			0x200
47cc875c2eSYuval Mintz };
48cc875c2eSYuval Mintz 
49cc875c2eSYuval Mintz struct qed_mcp_link_pause_params {
50cc875c2eSYuval Mintz 	bool					autoneg;
51cc875c2eSYuval Mintz 	bool					forced_rx;
52cc875c2eSYuval Mintz 	bool					forced_tx;
53cc875c2eSYuval Mintz };
54cc875c2eSYuval Mintz 
55645874e5SSudarsana Reddy Kalluru enum qed_mcp_eee_mode {
56645874e5SSudarsana Reddy Kalluru 	QED_MCP_EEE_DISABLED,
57645874e5SSudarsana Reddy Kalluru 	QED_MCP_EEE_ENABLED,
58645874e5SSudarsana Reddy Kalluru 	QED_MCP_EEE_UNSUPPORTED
59645874e5SSudarsana Reddy Kalluru };
60645874e5SSudarsana Reddy Kalluru 
61cc875c2eSYuval Mintz struct qed_mcp_link_params {
62cc875c2eSYuval Mintz 	struct qed_mcp_link_speed_params	speed;
63cc875c2eSYuval Mintz 	struct qed_mcp_link_pause_params	pause;
64cc875c2eSYuval Mintz 	u32					loopback_mode;
65645874e5SSudarsana Reddy Kalluru 	struct qed_link_eee_params		eee;
66ae7e6937SAlexander Lobakin 	u32					fec;
6799785a87SAlexander Lobakin 
6899785a87SAlexander Lobakin 	struct qed_mcp_link_speed_params	ext_speed;
6999785a87SAlexander Lobakin 	u32					ext_fec_mode;
70cc875c2eSYuval Mintz };
71cc875c2eSYuval Mintz 
72cc875c2eSYuval Mintz struct qed_mcp_link_capabilities {
73cc875c2eSYuval Mintz 	u32					speed_capabilities;
7434f9199cSsudarsana.kalluru@cavium.com 	bool					default_speed_autoneg;
75ae7e6937SAlexander Lobakin 	u32					fec_default;
76645874e5SSudarsana Reddy Kalluru 	enum qed_mcp_eee_mode			default_eee;
77645874e5SSudarsana Reddy Kalluru 	u32					eee_lpi_timer;
78645874e5SSudarsana Reddy Kalluru 	u8					eee_speed_caps;
7999785a87SAlexander Lobakin 
8099785a87SAlexander Lobakin 	u32					default_ext_speed_caps;
8199785a87SAlexander Lobakin 	u32					default_ext_autoneg;
8299785a87SAlexander Lobakin 	u32					default_ext_speed;
8399785a87SAlexander Lobakin 	u32					default_ext_fec;
84cc875c2eSYuval Mintz };
85cc875c2eSYuval Mintz 
86cc875c2eSYuval Mintz struct qed_mcp_link_state {
87cc875c2eSYuval Mintz 	bool					link_up;
88a64b02d5SManish Chopra 	u32					min_pf_rate;
89a64b02d5SManish Chopra 
904b01e519SManish Chopra 	/* Actual link speed in Mb/s */
914b01e519SManish Chopra 	u32					line_speed;
924b01e519SManish Chopra 
934b01e519SManish Chopra 	/* PF max speed in Mb/s, deduced from line_speed
944b01e519SManish Chopra 	 * according to PF max bandwidth configuration.
954b01e519SManish Chopra 	 */
964b01e519SManish Chopra 	u32					speed;
97cc875c2eSYuval Mintz 
9837237b5bSAlexander Lobakin 	bool					full_duplex;
99cc875c2eSYuval Mintz 	bool					an;
100cc875c2eSYuval Mintz 	bool					an_complete;
101cc875c2eSYuval Mintz 	bool					parallel_detection;
102cc875c2eSYuval Mintz 	bool					pfc_enabled;
103cc875c2eSYuval Mintz 
10437237b5bSAlexander Lobakin 	u32					partner_adv_speed;
105cc875c2eSYuval Mintz #define QED_LINK_PARTNER_SPEED_1G_HD		BIT(0)
106cc875c2eSYuval Mintz #define QED_LINK_PARTNER_SPEED_1G_FD		BIT(1)
107cc875c2eSYuval Mintz #define QED_LINK_PARTNER_SPEED_10G		BIT(2)
108cc875c2eSYuval Mintz #define QED_LINK_PARTNER_SPEED_20G		BIT(3)
109054c67d1SSudarsana Reddy Kalluru #define QED_LINK_PARTNER_SPEED_25G		BIT(4)
110054c67d1SSudarsana Reddy Kalluru #define QED_LINK_PARTNER_SPEED_40G		BIT(5)
111054c67d1SSudarsana Reddy Kalluru #define QED_LINK_PARTNER_SPEED_50G		BIT(6)
112054c67d1SSudarsana Reddy Kalluru #define QED_LINK_PARTNER_SPEED_100G		BIT(7)
113cc875c2eSYuval Mintz 
114cc875c2eSYuval Mintz 	bool					partner_tx_flow_ctrl_en;
115cc875c2eSYuval Mintz 	bool					partner_rx_flow_ctrl_en;
116cc875c2eSYuval Mintz 
117cc875c2eSYuval Mintz 	u8					partner_adv_pause;
11837237b5bSAlexander Lobakin #define QED_LINK_PARTNER_SYMMETRIC_PAUSE	0x1
11937237b5bSAlexander Lobakin #define QED_LINK_PARTNER_ASYMMETRIC_PAUSE	0x2
12037237b5bSAlexander Lobakin #define QED_LINK_PARTNER_BOTH_PAUSE		0x3
121cc875c2eSYuval Mintz 
122cc875c2eSYuval Mintz 	bool					sfp_tx_fault;
123645874e5SSudarsana Reddy Kalluru 	bool					eee_active;
124645874e5SSudarsana Reddy Kalluru 	u8					eee_adv_caps;
125645874e5SSudarsana Reddy Kalluru 	u8					eee_lp_adv_caps;
126ae7e6937SAlexander Lobakin 
127ae7e6937SAlexander Lobakin 	u32					fec_active;
128cc875c2eSYuval Mintz };
129cc875c2eSYuval Mintz 
130fe56b9e6SYuval Mintz struct qed_mcp_function_info {
131fe56b9e6SYuval Mintz 	u8				pause_on_host;
132fe56b9e6SYuval Mintz 
133fe56b9e6SYuval Mintz 	enum qed_pci_personality	protocol;
134fe56b9e6SYuval Mintz 
135fe56b9e6SYuval Mintz 	u8				bandwidth_min;
136fe56b9e6SYuval Mintz 	u8				bandwidth_max;
137fe56b9e6SYuval Mintz 
138fe56b9e6SYuval Mintz 	u8				mac[ETH_ALEN];
139fe56b9e6SYuval Mintz 
140fe56b9e6SYuval Mintz 	u64				wwn_port;
141fe56b9e6SYuval Mintz 	u64				wwn_node;
142fe56b9e6SYuval Mintz 
143fe56b9e6SYuval Mintz #define QED_MCP_VLAN_UNSET              (0xffff)
144fe56b9e6SYuval Mintz 	u16				ovlan;
1450fefbfbaSSudarsana Kalluru 
1460fefbfbaSSudarsana Kalluru 	u16				mtu;
147fe56b9e6SYuval Mintz };
148fe56b9e6SYuval Mintz 
149fe56b9e6SYuval Mintz struct qed_mcp_nvm_common {
150fe56b9e6SYuval Mintz 	u32	offset;
151fe56b9e6SYuval Mintz 	u32	param;
152fe56b9e6SYuval Mintz 	u32	resp;
153fe56b9e6SYuval Mintz 	u32	cmd;
154fe56b9e6SYuval Mintz };
155fe56b9e6SYuval Mintz 
156fe56b9e6SYuval Mintz struct qed_mcp_drv_version {
157fe56b9e6SYuval Mintz 	u32	version;
158fe56b9e6SYuval Mintz 	u8	name[MCP_DRV_VER_STR_SIZE - 4];
159fe56b9e6SYuval Mintz };
160fe56b9e6SYuval Mintz 
1616c754246SSudarsana Reddy Kalluru struct qed_mcp_lan_stats {
1626c754246SSudarsana Reddy Kalluru 	u64 ucast_rx_pkts;
1636c754246SSudarsana Reddy Kalluru 	u64 ucast_tx_pkts;
1646c754246SSudarsana Reddy Kalluru 	u32 fcs_err;
1656c754246SSudarsana Reddy Kalluru };
1666c754246SSudarsana Reddy Kalluru 
1676c754246SSudarsana Reddy Kalluru struct qed_mcp_fcoe_stats {
1686c754246SSudarsana Reddy Kalluru 	u64 rx_pkts;
1696c754246SSudarsana Reddy Kalluru 	u64 tx_pkts;
1706c754246SSudarsana Reddy Kalluru 	u32 fcs_err;
1716c754246SSudarsana Reddy Kalluru 	u32 login_failure;
1726c754246SSudarsana Reddy Kalluru };
1736c754246SSudarsana Reddy Kalluru 
1746c754246SSudarsana Reddy Kalluru struct qed_mcp_iscsi_stats {
1756c754246SSudarsana Reddy Kalluru 	u64 rx_pdus;
1766c754246SSudarsana Reddy Kalluru 	u64 tx_pdus;
1776c754246SSudarsana Reddy Kalluru 	u64 rx_bytes;
1786c754246SSudarsana Reddy Kalluru 	u64 tx_bytes;
1796c754246SSudarsana Reddy Kalluru };
1806c754246SSudarsana Reddy Kalluru 
1816c754246SSudarsana Reddy Kalluru struct qed_mcp_rdma_stats {
1826c754246SSudarsana Reddy Kalluru 	u64 rx_pkts;
1836c754246SSudarsana Reddy Kalluru 	u64 tx_pkts;
1846c754246SSudarsana Reddy Kalluru 	u64 rx_bytes;
1856c754246SSudarsana Reddy Kalluru 	u64 tx_byts;
1866c754246SSudarsana Reddy Kalluru };
1876c754246SSudarsana Reddy Kalluru 
1886c754246SSudarsana Reddy Kalluru enum qed_mcp_protocol_type {
1896c754246SSudarsana Reddy Kalluru 	QED_MCP_LAN_STATS,
1906c754246SSudarsana Reddy Kalluru 	QED_MCP_FCOE_STATS,
1916c754246SSudarsana Reddy Kalluru 	QED_MCP_ISCSI_STATS,
1926c754246SSudarsana Reddy Kalluru 	QED_MCP_RDMA_STATS
1936c754246SSudarsana Reddy Kalluru };
1946c754246SSudarsana Reddy Kalluru 
1956c754246SSudarsana Reddy Kalluru union qed_mcp_protocol_stats {
1966c754246SSudarsana Reddy Kalluru 	struct qed_mcp_lan_stats lan_stats;
1976c754246SSudarsana Reddy Kalluru 	struct qed_mcp_fcoe_stats fcoe_stats;
1986c754246SSudarsana Reddy Kalluru 	struct qed_mcp_iscsi_stats iscsi_stats;
1996c754246SSudarsana Reddy Kalluru 	struct qed_mcp_rdma_stats rdma_stats;
2006c754246SSudarsana Reddy Kalluru };
2016c754246SSudarsana Reddy Kalluru 
2020fefbfbaSSudarsana Kalluru enum qed_ov_eswitch {
2030fefbfbaSSudarsana Kalluru 	QED_OV_ESWITCH_NONE,
2040fefbfbaSSudarsana Kalluru 	QED_OV_ESWITCH_VEB,
2050fefbfbaSSudarsana Kalluru 	QED_OV_ESWITCH_VEPA
2060fefbfbaSSudarsana Kalluru };
2070fefbfbaSSudarsana Kalluru 
2080fefbfbaSSudarsana Kalluru enum qed_ov_client {
2090fefbfbaSSudarsana Kalluru 	QED_OV_CLIENT_DRV,
2100fefbfbaSSudarsana Kalluru 	QED_OV_CLIENT_USER,
2110fefbfbaSSudarsana Kalluru 	QED_OV_CLIENT_VENDOR_SPEC
2120fefbfbaSSudarsana Kalluru };
2130fefbfbaSSudarsana Kalluru 
2140fefbfbaSSudarsana Kalluru enum qed_ov_driver_state {
2150fefbfbaSSudarsana Kalluru 	QED_OV_DRIVER_STATE_NOT_LOADED,
2160fefbfbaSSudarsana Kalluru 	QED_OV_DRIVER_STATE_DISABLED,
2170fefbfbaSSudarsana Kalluru 	QED_OV_DRIVER_STATE_ACTIVE
2180fefbfbaSSudarsana Kalluru };
2190fefbfbaSSudarsana Kalluru 
2200fefbfbaSSudarsana Kalluru enum qed_ov_wol {
2210fefbfbaSSudarsana Kalluru 	QED_OV_WOL_DEFAULT,
2220fefbfbaSSudarsana Kalluru 	QED_OV_WOL_DISABLED,
2230fefbfbaSSudarsana Kalluru 	QED_OV_WOL_ENABLED
2240fefbfbaSSudarsana Kalluru };
2250fefbfbaSSudarsana Kalluru 
2262528c389SSudarsana Reddy Kalluru enum qed_mfw_tlv_type {
2272528c389SSudarsana Reddy Kalluru 	QED_MFW_TLV_GENERIC = 0x1,	/* Core driver TLVs */
2282528c389SSudarsana Reddy Kalluru 	QED_MFW_TLV_ETH = 0x2,		/* L2 driver TLVs */
229f240b688SSudarsana Reddy Kalluru 	QED_MFW_TLV_FCOE = 0x4,		/* FCoE protocol TLVs */
23077a509e4SSudarsana Reddy Kalluru 	QED_MFW_TLV_ISCSI = 0x8,	/* SCSI protocol TLVs */
23177a509e4SSudarsana Reddy Kalluru 	QED_MFW_TLV_MAX = 0x16,
2322528c389SSudarsana Reddy Kalluru };
2332528c389SSudarsana Reddy Kalluru 
2342528c389SSudarsana Reddy Kalluru struct qed_mfw_tlv_generic {
2352528c389SSudarsana Reddy Kalluru #define QED_MFW_TLV_FLAGS_SIZE	2
2362528c389SSudarsana Reddy Kalluru 	struct {
2372528c389SSudarsana Reddy Kalluru 		u8 ipv4_csum_offload;
2382528c389SSudarsana Reddy Kalluru 		u8 lso_supported;
2392528c389SSudarsana Reddy Kalluru 		bool b_set;
2402528c389SSudarsana Reddy Kalluru 	} flags;
2412528c389SSudarsana Reddy Kalluru 
2422528c389SSudarsana Reddy Kalluru #define QED_MFW_TLV_MAC_COUNT 3
2432528c389SSudarsana Reddy Kalluru 	/* First entry for primary MAC, 2 secondary MACs possible */
2442528c389SSudarsana Reddy Kalluru 	u8 mac[QED_MFW_TLV_MAC_COUNT][6];
2452528c389SSudarsana Reddy Kalluru 	bool mac_set[QED_MFW_TLV_MAC_COUNT];
2462528c389SSudarsana Reddy Kalluru 
2472528c389SSudarsana Reddy Kalluru 	u64 rx_frames;
2482528c389SSudarsana Reddy Kalluru 	bool rx_frames_set;
2492528c389SSudarsana Reddy Kalluru 	u64 rx_bytes;
2502528c389SSudarsana Reddy Kalluru 	bool rx_bytes_set;
2512528c389SSudarsana Reddy Kalluru 	u64 tx_frames;
2522528c389SSudarsana Reddy Kalluru 	bool tx_frames_set;
2532528c389SSudarsana Reddy Kalluru 	u64 tx_bytes;
2542528c389SSudarsana Reddy Kalluru 	bool tx_bytes_set;
2552528c389SSudarsana Reddy Kalluru };
2562528c389SSudarsana Reddy Kalluru 
2572528c389SSudarsana Reddy Kalluru union qed_mfw_tlv_data {
2582528c389SSudarsana Reddy Kalluru 	struct qed_mfw_tlv_generic generic;
2592528c389SSudarsana Reddy Kalluru 	struct qed_mfw_tlv_eth eth;
260f240b688SSudarsana Reddy Kalluru 	struct qed_mfw_tlv_fcoe fcoe;
26177a509e4SSudarsana Reddy Kalluru 	struct qed_mfw_tlv_iscsi iscsi;
2622528c389SSudarsana Reddy Kalluru };
2632528c389SSudarsana Reddy Kalluru 
26438eabdf0SSudarsana Reddy Kalluru #define QED_NVM_CFG_OPTION_ALL		BIT(0)
26538eabdf0SSudarsana Reddy Kalluru #define QED_NVM_CFG_OPTION_INIT		BIT(1)
26638eabdf0SSudarsana Reddy Kalluru #define QED_NVM_CFG_OPTION_COMMIT       BIT(2)
26738eabdf0SSudarsana Reddy Kalluru #define QED_NVM_CFG_OPTION_FREE		BIT(3)
26838eabdf0SSudarsana Reddy Kalluru #define QED_NVM_CFG_OPTION_ENTITY_SEL	BIT(4)
26938eabdf0SSudarsana Reddy Kalluru 
270fe56b9e6SYuval Mintz /**
27119198e4eSPrabhakar Kushwaha  * qed_mcp_get_link_params(): Returns the link params of the hw function.
272cc875c2eSYuval Mintz  *
27319198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
274cc875c2eSYuval Mintz  *
27519198e4eSPrabhakar Kushwaha  * Returns: Pointer to link params.
276cc875c2eSYuval Mintz  */
27719198e4eSPrabhakar Kushwaha struct qed_mcp_link_params *qed_mcp_get_link_params(struct qed_hwfn *p_hwfn);
278cc875c2eSYuval Mintz 
279cc875c2eSYuval Mintz /**
28019198e4eSPrabhakar Kushwaha  * qed_mcp_get_link_state(): Return the link state of the hw function.
281cc875c2eSYuval Mintz  *
28219198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
283cc875c2eSYuval Mintz  *
28419198e4eSPrabhakar Kushwaha  * Returns: Pointer to link state.
285cc875c2eSYuval Mintz  */
28619198e4eSPrabhakar Kushwaha struct qed_mcp_link_state *qed_mcp_get_link_state(struct qed_hwfn *p_hwfn);
287cc875c2eSYuval Mintz 
288cc875c2eSYuval Mintz /**
28919198e4eSPrabhakar Kushwaha  * qed_mcp_get_link_capabilities(): Return the link capabilities of the
29019198e4eSPrabhakar Kushwaha  *                                  hw function.
291cc875c2eSYuval Mintz  *
29219198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
293cc875c2eSYuval Mintz  *
29419198e4eSPrabhakar Kushwaha  * Returns: Pointer to link capabilities.
295cc875c2eSYuval Mintz  */
296cc875c2eSYuval Mintz struct qed_mcp_link_capabilities
297cc875c2eSYuval Mintz 	*qed_mcp_get_link_capabilities(struct qed_hwfn *p_hwfn);
298cc875c2eSYuval Mintz 
299cc875c2eSYuval Mintz /**
30019198e4eSPrabhakar Kushwaha  * qed_mcp_set_link(): Request the MFW to set the link according
30119198e4eSPrabhakar Kushwaha  *                     to 'link_input'.
302cc875c2eSYuval Mintz  *
30319198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
30419198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
30519198e4eSPrabhakar Kushwaha  * @b_up: Raise link if `true'. Reset link if `false'.
306cc875c2eSYuval Mintz  *
30719198e4eSPrabhakar Kushwaha  * Return: Int.
308cc875c2eSYuval Mintz  */
309cc875c2eSYuval Mintz int qed_mcp_set_link(struct qed_hwfn   *p_hwfn,
310cc875c2eSYuval Mintz 		     struct qed_ptt     *p_ptt,
311cc875c2eSYuval Mintz 		     bool               b_up);
312cc875c2eSYuval Mintz 
313cc875c2eSYuval Mintz /**
31419198e4eSPrabhakar Kushwaha  * qed_mcp_get_mfw_ver(): Get the management firmware version value.
315fe56b9e6SYuval Mintz  *
31619198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
31719198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
31819198e4eSPrabhakar Kushwaha  * @p_mfw_ver: MFW version value.
31919198e4eSPrabhakar Kushwaha  * @p_running_bundle_id: Image id in nvram; Optional.
320fe56b9e6SYuval Mintz  *
32119198e4eSPrabhakar Kushwaha  * Return: Int - 0 - operation was successful.
322fe56b9e6SYuval Mintz  */
3231408cc1fSYuval Mintz int qed_mcp_get_mfw_ver(struct qed_hwfn *p_hwfn,
3241408cc1fSYuval Mintz 			struct qed_ptt *p_ptt,
3251408cc1fSYuval Mintz 			u32 *p_mfw_ver, u32 *p_running_bundle_id);
326fe56b9e6SYuval Mintz 
327fe56b9e6SYuval Mintz /**
32819198e4eSPrabhakar Kushwaha  * qed_mcp_get_mbi_ver(): Get the MBI version value.
329ae33666aSTomer Tayar  *
33019198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
33119198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
33219198e4eSPrabhakar Kushwaha  * @p_mbi_ver: A pointer to a variable to be filled with the MBI version.
333ae33666aSTomer Tayar  *
33419198e4eSPrabhakar Kushwaha  * Return: Int - 0 - operation was successful.
335ae33666aSTomer Tayar  */
336ae33666aSTomer Tayar int qed_mcp_get_mbi_ver(struct qed_hwfn *p_hwfn,
337ae33666aSTomer Tayar 			struct qed_ptt *p_ptt, u32 *p_mbi_ver);
338ae33666aSTomer Tayar 
339ae33666aSTomer Tayar /**
34019198e4eSPrabhakar Kushwaha  * qed_mcp_get_media_type(): Get media type value of the port.
341cc875c2eSYuval Mintz  *
34219198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
34319198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
34419198e4eSPrabhakar Kushwaha  * @media_type: Media type value
345cc875c2eSYuval Mintz  *
34619198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
347cc875c2eSYuval Mintz  *              -EBUSY - Operation failed
348cc875c2eSYuval Mintz  */
349706d0891SRahul Verma int qed_mcp_get_media_type(struct qed_hwfn *p_hwfn,
350706d0891SRahul Verma 			   struct qed_ptt *p_ptt, u32 *media_type);
351cc875c2eSYuval Mintz 
352cc875c2eSYuval Mintz /**
35319198e4eSPrabhakar Kushwaha  * qed_mcp_get_transceiver_data(): Get transceiver data of the port.
354c56a8be7SRahul Verma  *
35519198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
35619198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
35719198e4eSPrabhakar Kushwaha  * @p_transceiver_state: Transceiver state.
35819198e4eSPrabhakar Kushwaha  * @p_tranceiver_type: Media type value.
359c56a8be7SRahul Verma  *
36019198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
361c56a8be7SRahul Verma  *              -EBUSY - Operation failed
362c56a8be7SRahul Verma  */
363c56a8be7SRahul Verma int qed_mcp_get_transceiver_data(struct qed_hwfn *p_hwfn,
364c56a8be7SRahul Verma 				 struct qed_ptt *p_ptt,
365c56a8be7SRahul Verma 				 u32 *p_transceiver_state,
366c56a8be7SRahul Verma 				 u32 *p_tranceiver_type);
367c56a8be7SRahul Verma 
368c56a8be7SRahul Verma /**
36919198e4eSPrabhakar Kushwaha  * qed_mcp_trans_speed_mask(): Get transceiver supported speed mask.
370c56a8be7SRahul Verma  *
37119198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
37219198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
37319198e4eSPrabhakar Kushwaha  * @p_speed_mask: Bit mask of all supported speeds.
374c56a8be7SRahul Verma  *
37519198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
376c56a8be7SRahul Verma  *              -EBUSY - Operation failed
377c56a8be7SRahul Verma  */
378c56a8be7SRahul Verma 
379c56a8be7SRahul Verma int qed_mcp_trans_speed_mask(struct qed_hwfn *p_hwfn,
380c56a8be7SRahul Verma 			     struct qed_ptt *p_ptt, u32 *p_speed_mask);
381c56a8be7SRahul Verma 
382c56a8be7SRahul Verma /**
38319198e4eSPrabhakar Kushwaha  * qed_mcp_get_board_config(): Get board configuration.
384c56a8be7SRahul Verma  *
38519198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
38619198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
38719198e4eSPrabhakar Kushwaha  * @p_board_config: Board config.
388c56a8be7SRahul Verma  *
38919198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
390c56a8be7SRahul Verma  *              -EBUSY - Operation failed
391c56a8be7SRahul Verma  */
392c56a8be7SRahul Verma int qed_mcp_get_board_config(struct qed_hwfn *p_hwfn,
393c56a8be7SRahul Verma 			     struct qed_ptt *p_ptt, u32 *p_board_config);
394c56a8be7SRahul Verma 
395c56a8be7SRahul Verma /**
39619198e4eSPrabhakar Kushwaha  * qed_mcp_cmd(): General function for sending commands to the MCP
397fe56b9e6SYuval Mintz  *                mailbox. It acquire mutex lock for the entire
398fe56b9e6SYuval Mintz  *                operation, from sending the request until the MCP
399fe56b9e6SYuval Mintz  *                response. Waiting for MCP response will be checked up
400fe56b9e6SYuval Mintz  *                to 5 seconds every 5ms.
401fe56b9e6SYuval Mintz  *
40219198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
40319198e4eSPrabhakar Kushwaha  * @p_ptt: PTT required for register access.
40419198e4eSPrabhakar Kushwaha  * @cmd: command to be sent to the MCP.
40519198e4eSPrabhakar Kushwaha  * @param: Optional param
40619198e4eSPrabhakar Kushwaha  * @o_mcp_resp: The MCP response code (exclude sequence).
40719198e4eSPrabhakar Kushwaha  * @o_mcp_param: Optional parameter provided by the MCP
408fe56b9e6SYuval Mintz  *                     response
40919198e4eSPrabhakar Kushwaha  *
41019198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
411fe56b9e6SYuval Mintz  */
412fe56b9e6SYuval Mintz int qed_mcp_cmd(struct qed_hwfn *p_hwfn,
413fe56b9e6SYuval Mintz 		struct qed_ptt *p_ptt,
414fe56b9e6SYuval Mintz 		u32 cmd,
415fe56b9e6SYuval Mintz 		u32 param,
416fe56b9e6SYuval Mintz 		u32 *o_mcp_resp,
417fe56b9e6SYuval Mintz 		u32 *o_mcp_param);
418fe56b9e6SYuval Mintz 
419fe56b9e6SYuval Mintz /**
42019198e4eSPrabhakar Kushwaha  * qed_mcp_drain(): drains the nig, allowing completion to pass in
42119198e4eSPrabhakar Kushwaha  *                  case of pauses.
422fe56b9e6SYuval Mintz  *                  (Should be called only from sleepable context)
423fe56b9e6SYuval Mintz  *
42419198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
42519198e4eSPrabhakar Kushwaha  * @p_ptt: PTT required for register access.
42619198e4eSPrabhakar Kushwaha  *
42719198e4eSPrabhakar Kushwaha  * Return: Int.
428fe56b9e6SYuval Mintz  */
429fe56b9e6SYuval Mintz int qed_mcp_drain(struct qed_hwfn *p_hwfn,
430fe56b9e6SYuval Mintz 		  struct qed_ptt *p_ptt);
431fe56b9e6SYuval Mintz 
432fe56b9e6SYuval Mintz /**
43319198e4eSPrabhakar Kushwaha  * qed_mcp_get_flash_size(): Get the flash size value.
434cee4d264SManish Chopra  *
43519198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
43619198e4eSPrabhakar Kushwaha  * @p_ptt: PTT required for register access.
43719198e4eSPrabhakar Kushwaha  * @p_flash_size: Flash size in bytes to be filled.
438cee4d264SManish Chopra  *
43919198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
440cee4d264SManish Chopra  */
441cee4d264SManish Chopra int qed_mcp_get_flash_size(struct qed_hwfn     *p_hwfn,
442cee4d264SManish Chopra 			   struct qed_ptt       *p_ptt,
443cee4d264SManish Chopra 			   u32 *p_flash_size);
444cee4d264SManish Chopra 
445cee4d264SManish Chopra /**
44619198e4eSPrabhakar Kushwaha  * qed_mcp_send_drv_version(): Send driver version to MFW.
447fe56b9e6SYuval Mintz  *
44819198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
44919198e4eSPrabhakar Kushwaha  * @p_ptt: PTT required for register access.
45019198e4eSPrabhakar Kushwaha  * @p_ver: Version value.
451fe56b9e6SYuval Mintz  *
45219198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
453fe56b9e6SYuval Mintz  */
454fe56b9e6SYuval Mintz int
455fe56b9e6SYuval Mintz qed_mcp_send_drv_version(struct qed_hwfn *p_hwfn,
456fe56b9e6SYuval Mintz 			 struct qed_ptt *p_ptt,
457fe56b9e6SYuval Mintz 			 struct qed_mcp_drv_version *p_ver);
458fe56b9e6SYuval Mintz 
45991420b83SSudarsana Kalluru /**
46019198e4eSPrabhakar Kushwaha  * qed_get_process_kill_counter(): Read the MFW process kill counter.
46164515dc8STomer Tayar  *
46219198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
46319198e4eSPrabhakar Kushwaha  * @p_ptt: PTT required for register access.
46464515dc8STomer Tayar  *
46519198e4eSPrabhakar Kushwaha  * Return: u32.
46664515dc8STomer Tayar  */
46764515dc8STomer Tayar u32 qed_get_process_kill_counter(struct qed_hwfn *p_hwfn,
46864515dc8STomer Tayar 				 struct qed_ptt *p_ptt);
46964515dc8STomer Tayar 
47064515dc8STomer Tayar /**
47119198e4eSPrabhakar Kushwaha  * qed_start_recovery_process(): Trigger a recovery process.
47264515dc8STomer Tayar  *
47319198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
47419198e4eSPrabhakar Kushwaha  * @p_ptt: PTT required for register access.
47564515dc8STomer Tayar  *
47619198e4eSPrabhakar Kushwaha  * Return: Int.
47764515dc8STomer Tayar  */
47864515dc8STomer Tayar int qed_start_recovery_process(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
47964515dc8STomer Tayar 
48064515dc8STomer Tayar /**
48119198e4eSPrabhakar Kushwaha  * qed_recovery_prolog(): A recovery handler must call this function
48219198e4eSPrabhakar Kushwaha  *                        as its first step.
48319198e4eSPrabhakar Kushwaha  *                        It is assumed that the handler is not run from
48419198e4eSPrabhakar Kushwaha  *                        an interrupt context.
48564515dc8STomer Tayar  *
48619198e4eSPrabhakar Kushwaha  * @cdev: Qed dev pointer.
48764515dc8STomer Tayar  *
48819198e4eSPrabhakar Kushwaha  * Return: int.
48964515dc8STomer Tayar  */
49064515dc8STomer Tayar int qed_recovery_prolog(struct qed_dev *cdev);
49164515dc8STomer Tayar 
49264515dc8STomer Tayar /**
49319198e4eSPrabhakar Kushwaha  * qed_mcp_ov_update_current_config(): Notify MFW about the change in base
49419198e4eSPrabhakar Kushwaha  *                                    device properties
4950fefbfbaSSudarsana Kalluru  *
49619198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
49719198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
49819198e4eSPrabhakar Kushwaha  * @client: Qed client type.
4990fefbfbaSSudarsana Kalluru  *
50019198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
5010fefbfbaSSudarsana Kalluru  */
5020fefbfbaSSudarsana Kalluru int qed_mcp_ov_update_current_config(struct qed_hwfn *p_hwfn,
5030fefbfbaSSudarsana Kalluru 				     struct qed_ptt *p_ptt,
5040fefbfbaSSudarsana Kalluru 				     enum qed_ov_client client);
5050fefbfbaSSudarsana Kalluru 
5060fefbfbaSSudarsana Kalluru /**
50719198e4eSPrabhakar Kushwaha  * qed_mcp_ov_update_driver_state(): Notify MFW about the driver state.
5080fefbfbaSSudarsana Kalluru  *
50919198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
51019198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
51119198e4eSPrabhakar Kushwaha  * @drv_state: Driver state.
5120fefbfbaSSudarsana Kalluru  *
51319198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
5140fefbfbaSSudarsana Kalluru  */
5150fefbfbaSSudarsana Kalluru int qed_mcp_ov_update_driver_state(struct qed_hwfn *p_hwfn,
5160fefbfbaSSudarsana Kalluru 				   struct qed_ptt *p_ptt,
5170fefbfbaSSudarsana Kalluru 				   enum qed_ov_driver_state drv_state);
5180fefbfbaSSudarsana Kalluru 
5190fefbfbaSSudarsana Kalluru /**
52019198e4eSPrabhakar Kushwaha  * qed_mcp_ov_update_mtu(): Send MTU size to MFW.
5210fefbfbaSSudarsana Kalluru  *
52219198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
52319198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
52419198e4eSPrabhakar Kushwaha  * @mtu: MTU size.
5250fefbfbaSSudarsana Kalluru  *
52619198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
5270fefbfbaSSudarsana Kalluru  */
5280fefbfbaSSudarsana Kalluru int qed_mcp_ov_update_mtu(struct qed_hwfn *p_hwfn,
5290fefbfbaSSudarsana Kalluru 			  struct qed_ptt *p_ptt, u16 mtu);
5300fefbfbaSSudarsana Kalluru 
5310fefbfbaSSudarsana Kalluru /**
53219198e4eSPrabhakar Kushwaha  * qed_mcp_ov_update_mac(): Send MAC address to MFW.
5330fefbfbaSSudarsana Kalluru  *
53419198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
53519198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
53619198e4eSPrabhakar Kushwaha  * @mac: MAC address.
5370fefbfbaSSudarsana Kalluru  *
53819198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
5390fefbfbaSSudarsana Kalluru  */
5400fefbfbaSSudarsana Kalluru int qed_mcp_ov_update_mac(struct qed_hwfn *p_hwfn,
54176660757SJakub Kicinski 			  struct qed_ptt *p_ptt, const u8 *mac);
5420fefbfbaSSudarsana Kalluru 
5430fefbfbaSSudarsana Kalluru /**
54419198e4eSPrabhakar Kushwaha  * qed_mcp_ov_update_wol(): Send WOL mode to MFW.
5450fefbfbaSSudarsana Kalluru  *
54619198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
54719198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
54819198e4eSPrabhakar Kushwaha  * @wol: WOL mode.
5490fefbfbaSSudarsana Kalluru  *
55019198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
5510fefbfbaSSudarsana Kalluru  */
5520fefbfbaSSudarsana Kalluru int qed_mcp_ov_update_wol(struct qed_hwfn *p_hwfn,
5530fefbfbaSSudarsana Kalluru 			  struct qed_ptt *p_ptt,
5540fefbfbaSSudarsana Kalluru 			  enum qed_ov_wol wol);
5550fefbfbaSSudarsana Kalluru 
5560fefbfbaSSudarsana Kalluru /**
55719198e4eSPrabhakar Kushwaha  * qed_mcp_set_led(): Set LED status.
55891420b83SSudarsana Kalluru  *
55919198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
56019198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
56119198e4eSPrabhakar Kushwaha  * @mode: LED mode.
56291420b83SSudarsana Kalluru  *
56319198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
56491420b83SSudarsana Kalluru  */
56591420b83SSudarsana Kalluru int qed_mcp_set_led(struct qed_hwfn *p_hwfn,
56691420b83SSudarsana Kalluru 		    struct qed_ptt *p_ptt,
56791420b83SSudarsana Kalluru 		    enum qed_led_mode mode);
56891420b83SSudarsana Kalluru 
56903dc76caSSudarsana Reddy Kalluru /**
57019198e4eSPrabhakar Kushwaha  * qed_mcp_nvm_read(): Read from NVM.
5717a4b21b7SMintz, Yuval  *
57219198e4eSPrabhakar Kushwaha  * @cdev: Qed dev pointer.
57319198e4eSPrabhakar Kushwaha  * @addr: NVM offset.
57419198e4eSPrabhakar Kushwaha  * @p_buf: NVM read buffer.
57519198e4eSPrabhakar Kushwaha  * @len: Buffer len.
5767a4b21b7SMintz, Yuval  *
57719198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
5787a4b21b7SMintz, Yuval  */
5797a4b21b7SMintz, Yuval int qed_mcp_nvm_read(struct qed_dev *cdev, u32 addr, u8 *p_buf, u32 len);
5807a4b21b7SMintz, Yuval 
58162e4d438SSudarsana Reddy Kalluru /**
58219198e4eSPrabhakar Kushwaha  * qed_mcp_nvm_write(): Write to NVM.
58362e4d438SSudarsana Reddy Kalluru  *
58419198e4eSPrabhakar Kushwaha  * @cdev: Qed dev pointer.
58519198e4eSPrabhakar Kushwaha  * @addr: NVM offset.
58619198e4eSPrabhakar Kushwaha  * @cmd: NVM command.
58719198e4eSPrabhakar Kushwaha  * @p_buf: NVM write buffer.
58819198e4eSPrabhakar Kushwaha  * @len: Buffer len.
58962e4d438SSudarsana Reddy Kalluru  *
59019198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
59162e4d438SSudarsana Reddy Kalluru  */
59262e4d438SSudarsana Reddy Kalluru int qed_mcp_nvm_write(struct qed_dev *cdev,
59362e4d438SSudarsana Reddy Kalluru 		      u32 cmd, u32 addr, u8 *p_buf, u32 len);
59462e4d438SSudarsana Reddy Kalluru 
59562e4d438SSudarsana Reddy Kalluru /**
59619198e4eSPrabhakar Kushwaha  * qed_mcp_nvm_resp(): Check latest response.
59762e4d438SSudarsana Reddy Kalluru  *
59819198e4eSPrabhakar Kushwaha  * @cdev: Qed dev pointer.
59919198e4eSPrabhakar Kushwaha  * @p_buf: NVM write buffer.
60062e4d438SSudarsana Reddy Kalluru  *
60119198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
60262e4d438SSudarsana Reddy Kalluru  */
60362e4d438SSudarsana Reddy Kalluru int qed_mcp_nvm_resp(struct qed_dev *cdev, u8 *p_buf);
60462e4d438SSudarsana Reddy Kalluru 
60520675b37SMintz, Yuval struct qed_nvm_image_att {
60620675b37SMintz, Yuval 	u32 start_addr;
60720675b37SMintz, Yuval 	u32 length;
60820675b37SMintz, Yuval };
60920675b37SMintz, Yuval 
61020675b37SMintz, Yuval /**
61119198e4eSPrabhakar Kushwaha  * qed_mcp_get_nvm_image_att(): Allows reading a whole nvram image.
61220675b37SMintz, Yuval  *
61319198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
61419198e4eSPrabhakar Kushwaha  * @image_id: Image to get attributes for.
61519198e4eSPrabhakar Kushwaha  * @p_image_att: Image attributes structure into which to fill data.
6161ac4329aSDenis Bolotin  *
61719198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
6181ac4329aSDenis Bolotin  */
6191ac4329aSDenis Bolotin int
6201ac4329aSDenis Bolotin qed_mcp_get_nvm_image_att(struct qed_hwfn *p_hwfn,
6211ac4329aSDenis Bolotin 			  enum qed_nvm_images image_id,
6221ac4329aSDenis Bolotin 			  struct qed_nvm_image_att *p_image_att);
6231ac4329aSDenis Bolotin 
6241ac4329aSDenis Bolotin /**
62519198e4eSPrabhakar Kushwaha  * qed_mcp_get_nvm_image(): Allows reading a whole nvram image.
6261ac4329aSDenis Bolotin  *
62719198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
62819198e4eSPrabhakar Kushwaha  * @image_id: image requested for reading.
62919198e4eSPrabhakar Kushwaha  * @p_buffer: allocated buffer into which to fill data.
63019198e4eSPrabhakar Kushwaha  * @buffer_len: length of the allocated buffer.
63120675b37SMintz, Yuval  *
63219198e4eSPrabhakar Kushwaha  * Return: 0 if p_buffer now contains the nvram image.
63320675b37SMintz, Yuval  */
63420675b37SMintz, Yuval int qed_mcp_get_nvm_image(struct qed_hwfn *p_hwfn,
63520675b37SMintz, Yuval 			  enum qed_nvm_images image_id,
63620675b37SMintz, Yuval 			  u8 *p_buffer, u32 buffer_len);
63720675b37SMintz, Yuval 
6387a4b21b7SMintz, Yuval /**
63919198e4eSPrabhakar Kushwaha  * qed_mcp_bist_register_test(): Bist register test.
64003dc76caSSudarsana Reddy Kalluru  *
64119198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
64219198e4eSPrabhakar Kushwaha  * @p_ptt: PTT required for register access.
64303dc76caSSudarsana Reddy Kalluru  *
64419198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
64503dc76caSSudarsana Reddy Kalluru  */
64603dc76caSSudarsana Reddy Kalluru int qed_mcp_bist_register_test(struct qed_hwfn *p_hwfn,
64703dc76caSSudarsana Reddy Kalluru 			       struct qed_ptt *p_ptt);
64803dc76caSSudarsana Reddy Kalluru 
64903dc76caSSudarsana Reddy Kalluru /**
65019198e4eSPrabhakar Kushwaha  * qed_mcp_bist_clock_test(): Bist clock test.
65103dc76caSSudarsana Reddy Kalluru  *
65219198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
65319198e4eSPrabhakar Kushwaha  * @p_ptt: PTT required for register access.
65403dc76caSSudarsana Reddy Kalluru  *
65519198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
65603dc76caSSudarsana Reddy Kalluru  */
65703dc76caSSudarsana Reddy Kalluru int qed_mcp_bist_clock_test(struct qed_hwfn *p_hwfn,
65803dc76caSSudarsana Reddy Kalluru 			    struct qed_ptt *p_ptt);
65903dc76caSSudarsana Reddy Kalluru 
6607a4b21b7SMintz, Yuval /**
66119198e4eSPrabhakar Kushwaha  * qed_mcp_bist_nvm_get_num_images(): Bist nvm test - get number of images.
6627a4b21b7SMintz, Yuval  *
66319198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
66419198e4eSPrabhakar Kushwaha  * @p_ptt: PTT required for register access.
66519198e4eSPrabhakar Kushwaha  * @num_images: number of images if operation was
6667a4b21b7SMintz, Yuval  *			  successful. 0 if not.
6677a4b21b7SMintz, Yuval  *
66819198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
6697a4b21b7SMintz, Yuval  */
67043645ce0SSudarsana Reddy Kalluru int qed_mcp_bist_nvm_get_num_images(struct qed_hwfn *p_hwfn,
6717a4b21b7SMintz, Yuval 				    struct qed_ptt *p_ptt,
6727a4b21b7SMintz, Yuval 				    u32 *num_images);
6737a4b21b7SMintz, Yuval 
6747a4b21b7SMintz, Yuval /**
67519198e4eSPrabhakar Kushwaha  * qed_mcp_bist_nvm_get_image_att(): Bist nvm test - get image attributes
67619198e4eSPrabhakar Kushwaha  *                                   by index.
6777a4b21b7SMintz, Yuval  *
67819198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
67919198e4eSPrabhakar Kushwaha  * @p_ptt: PTT required for register access.
68019198e4eSPrabhakar Kushwaha  * @p_image_att: Attributes of image.
68119198e4eSPrabhakar Kushwaha  * @image_index: Index of image to get information for.
6827a4b21b7SMintz, Yuval  *
68319198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
6847a4b21b7SMintz, Yuval  */
68543645ce0SSudarsana Reddy Kalluru int qed_mcp_bist_nvm_get_image_att(struct qed_hwfn *p_hwfn,
6867a4b21b7SMintz, Yuval 				   struct qed_ptt *p_ptt,
6877a4b21b7SMintz, Yuval 				   struct bist_nvm_image_att *p_image_att,
6887a4b21b7SMintz, Yuval 				   u32 image_index);
6897a4b21b7SMintz, Yuval 
6902528c389SSudarsana Reddy Kalluru /**
69119198e4eSPrabhakar Kushwaha  * qed_mfw_process_tlv_req(): Processes the TLV request from MFW i.e.,
69219198e4eSPrabhakar Kushwaha  *                            get the required TLV info
6932528c389SSudarsana Reddy Kalluru  *                            from the qed client and send it to the MFW.
6942528c389SSudarsana Reddy Kalluru  *
69519198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
69619198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
6972528c389SSudarsana Reddy Kalluru  *
69819198e4eSPrabhakar Kushwaha  * Return: 0 upon success.
6992528c389SSudarsana Reddy Kalluru  */
7002528c389SSudarsana Reddy Kalluru int qed_mfw_process_tlv_req(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
7012528c389SSudarsana Reddy Kalluru 
702d8d6c5a7SIgor Russkikh /**
70319198e4eSPrabhakar Kushwaha  * qed_mcp_send_raw_debug_data(): Send raw debug data to the MFW
704d8d6c5a7SIgor Russkikh  *
70519198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
70619198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
70719198e4eSPrabhakar Kushwaha  * @p_buf: raw debug data buffer.
70819198e4eSPrabhakar Kushwaha  * @size: Buffer size.
70919198e4eSPrabhakar Kushwaha  *
71019198e4eSPrabhakar Kushwaha  * Return : Int.
711d8d6c5a7SIgor Russkikh  */
712d8d6c5a7SIgor Russkikh int
713d8d6c5a7SIgor Russkikh qed_mcp_send_raw_debug_data(struct qed_hwfn *p_hwfn,
714d8d6c5a7SIgor Russkikh 			    struct qed_ptt *p_ptt, u8 *p_buf, u32 size);
715d8d6c5a7SIgor Russkikh 
716fe56b9e6SYuval Mintz /* Using hwfn number (and not pf_num) is required since in CMT mode,
717fe56b9e6SYuval Mintz  * same pf_num may be used by two different hwfn
718fe56b9e6SYuval Mintz  * TODO - this shouldn't really be in .h file, but until all fields
719fe56b9e6SYuval Mintz  * required during hw-init will be placed in their correct place in shmem
720fe56b9e6SYuval Mintz  * we need it in qed_dev.c [for readin the nvram reflection in shmem].
721fe56b9e6SYuval Mintz  */
722fe56b9e6SYuval Mintz #define MCP_PF_ID_BY_REL(p_hwfn, rel_pfid) (QED_IS_BB((p_hwfn)->cdev) ?	       \
723fe56b9e6SYuval Mintz 					    ((rel_pfid) |		       \
724fe56b9e6SYuval Mintz 					     ((p_hwfn)->abs_pf_id & 1) << 3) : \
725fe56b9e6SYuval Mintz 					    rel_pfid)
726fe56b9e6SYuval Mintz #define MCP_PF_ID(p_hwfn) MCP_PF_ID_BY_REL(p_hwfn, (p_hwfn)->rel_pf_id)
727fe56b9e6SYuval Mintz 
728fe56b9e6SYuval Mintz struct qed_mcp_info {
7294ed1eea8STomer Tayar 	/* List for mailbox commands which were sent and wait for a response */
7304ed1eea8STomer Tayar 	struct list_head			cmd_list;
7314ed1eea8STomer Tayar 
7324ed1eea8STomer Tayar 	/* Spinlock used for protecting the access to the mailbox commands list
7334ed1eea8STomer Tayar 	 * and the sending of the commands.
7344ed1eea8STomer Tayar 	 */
7354ed1eea8STomer Tayar 	spinlock_t				cmd_lock;
73665ed2ffdSMintz, Yuval 
737b310974eSTomer Tayar 	/* Flag to indicate whether sending a MFW mailbox command is blocked */
738b310974eSTomer Tayar 	bool					b_block_cmd;
739b310974eSTomer Tayar 
74065ed2ffdSMintz, Yuval 	/* Spinlock used for syncing SW link-changes and link-changes
74165ed2ffdSMintz, Yuval 	 * originating from attention context.
74265ed2ffdSMintz, Yuval 	 */
74365ed2ffdSMintz, Yuval 	spinlock_t				link_lock;
744b310974eSTomer Tayar 
745fe56b9e6SYuval Mintz 	u32					public_base;
746fe56b9e6SYuval Mintz 	u32					drv_mb_addr;
747fe56b9e6SYuval Mintz 	u32					mfw_mb_addr;
748fe56b9e6SYuval Mintz 	u32					port_addr;
749fe56b9e6SYuval Mintz 	u16					drv_mb_seq;
750fe56b9e6SYuval Mintz 	u16					drv_pulse_seq;
751cc875c2eSYuval Mintz 	struct qed_mcp_link_params		link_input;
752cc875c2eSYuval Mintz 	struct qed_mcp_link_state		link_output;
753cc875c2eSYuval Mintz 	struct qed_mcp_link_capabilities	link_capabilities;
754fe56b9e6SYuval Mintz 	struct qed_mcp_function_info		func_info;
755fe56b9e6SYuval Mintz 	u8					*mfw_mb_cur;
756fe56b9e6SYuval Mintz 	u8					*mfw_mb_shadow;
757fe56b9e6SYuval Mintz 	u16					mfw_mb_length;
7584ed1eea8STomer Tayar 	u32					mcp_hist;
759645874e5SSudarsana Reddy Kalluru 
760645874e5SSudarsana Reddy Kalluru 	/* Capabilties negotiated with the MFW */
761645874e5SSudarsana Reddy Kalluru 	u32					capabilities;
762d8d6c5a7SIgor Russkikh 
763d8d6c5a7SIgor Russkikh 	/* S/N for debug data mailbox commands */
764d8d6c5a7SIgor Russkikh 	atomic_t dbg_data_seq;
765fe56b9e6SYuval Mintz };
766fe56b9e6SYuval Mintz 
7675529bad9STomer Tayar struct qed_mcp_mb_params {
7685529bad9STomer Tayar 	u32 cmd;
7695529bad9STomer Tayar 	u32 param;
7702f67af8cSTomer Tayar 	void *p_data_src;
7712f67af8cSTomer Tayar 	void *p_data_dst;
772eaa50fc5STomer Tayar 	u8 data_src_size;
7732f67af8cSTomer Tayar 	u8 data_dst_size;
7745529bad9STomer Tayar 	u32 mcp_resp;
7755529bad9STomer Tayar 	u32 mcp_param;
776eaa50fc5STomer Tayar 	u32 flags;
777eaa50fc5STomer Tayar #define QED_MB_FLAG_CAN_SLEEP	(0x1 << 0)
778b310974eSTomer Tayar #define QED_MB_FLAG_AVOID_BLOCK	(0x1 << 1)
779eaa50fc5STomer Tayar #define QED_MB_FLAGS_IS_SET(params, flag) \
780eaa50fc5STomer Tayar 	({ typeof(params) __params = (params); \
781eaa50fc5STomer Tayar 	   (__params && (__params->flags & QED_MB_FLAG_ ## flag)); })
7825529bad9STomer Tayar };
7835529bad9STomer Tayar 
7842528c389SSudarsana Reddy Kalluru struct qed_drv_tlv_hdr {
7852528c389SSudarsana Reddy Kalluru 	u8 tlv_type;
7862528c389SSudarsana Reddy Kalluru 	u8 tlv_length;	/* In dwords - not including this header */
7872528c389SSudarsana Reddy Kalluru 	u8 tlv_reserved;
7882528c389SSudarsana Reddy Kalluru #define QED_DRV_TLV_FLAGS_CHANGED 0x01
7892528c389SSudarsana Reddy Kalluru 	u8 tlv_flags;
7902528c389SSudarsana Reddy Kalluru };
7912528c389SSudarsana Reddy Kalluru 
792fe56b9e6SYuval Mintz /**
79399785a87SAlexander Lobakin  * qed_mcp_is_ext_speed_supported() - Check if management firmware supports
79499785a87SAlexander Lobakin  *                                    extended speeds.
79599785a87SAlexander Lobakin  * @p_hwfn: HW device data.
79699785a87SAlexander Lobakin  *
79799785a87SAlexander Lobakin  * Return: true if supported, false otherwise.
79899785a87SAlexander Lobakin  */
79999785a87SAlexander Lobakin static inline bool
80099785a87SAlexander Lobakin qed_mcp_is_ext_speed_supported(const struct qed_hwfn *p_hwfn)
80199785a87SAlexander Lobakin {
80299785a87SAlexander Lobakin 	return !!(p_hwfn->mcp_info->capabilities &
80399785a87SAlexander Lobakin 		  FW_MB_PARAM_FEATURE_SUPPORT_EXT_SPEED_FEC_CONTROL);
80499785a87SAlexander Lobakin }
80599785a87SAlexander Lobakin 
80699785a87SAlexander Lobakin /**
80719198e4eSPrabhakar Kushwaha  * qed_mcp_cmd_init(): Initialize the interface with the MCP.
808fe56b9e6SYuval Mintz  *
80919198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
81019198e4eSPrabhakar Kushwaha  * @p_ptt: PTT required for register access.
811fe56b9e6SYuval Mintz  *
81219198e4eSPrabhakar Kushwaha  * Return: Int.
813fe56b9e6SYuval Mintz  */
814fe56b9e6SYuval Mintz int qed_mcp_cmd_init(struct qed_hwfn *p_hwfn,
815fe56b9e6SYuval Mintz 		     struct qed_ptt *p_ptt);
816fe56b9e6SYuval Mintz 
817fe56b9e6SYuval Mintz /**
81819198e4eSPrabhakar Kushwaha  * qed_mcp_cmd_port_init(): Initialize the port interface with the MCP
819fe56b9e6SYuval Mintz  *
82019198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
82119198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
82219198e4eSPrabhakar Kushwaha  *
82319198e4eSPrabhakar Kushwaha  * Return: Void.
82419198e4eSPrabhakar Kushwaha  *
825fe56b9e6SYuval Mintz  * Can only be called after `num_ports_in_engines' is set
826fe56b9e6SYuval Mintz  */
827fe56b9e6SYuval Mintz void qed_mcp_cmd_port_init(struct qed_hwfn *p_hwfn,
828fe56b9e6SYuval Mintz 			   struct qed_ptt *p_ptt);
829fe56b9e6SYuval Mintz /**
83019198e4eSPrabhakar Kushwaha  * qed_mcp_free(): Releases resources allocated during the init process.
831fe56b9e6SYuval Mintz  *
83219198e4eSPrabhakar Kushwaha  * @p_hwfn: HW function.
833fe56b9e6SYuval Mintz  *
83419198e4eSPrabhakar Kushwaha  * Return: Int.
835fe56b9e6SYuval Mintz  */
836fe56b9e6SYuval Mintz 
837fe56b9e6SYuval Mintz int qed_mcp_free(struct qed_hwfn *p_hwfn);
838fe56b9e6SYuval Mintz 
839fe56b9e6SYuval Mintz /**
84019198e4eSPrabhakar Kushwaha  * qed_mcp_handle_events(): This function is called from the DPC context.
84119198e4eSPrabhakar Kushwaha  *           After pointing PTT to the mfw mb, check for events sent by
84219198e4eSPrabhakar Kushwaha  *           the MCP to the driver and ack them. In case a critical event
843cc875c2eSYuval Mintz  *           detected, it will be handled here, otherwise the work will be
844cc875c2eSYuval Mintz  *            queued to a sleepable work-queue.
845cc875c2eSYuval Mintz  *
84619198e4eSPrabhakar Kushwaha  * @p_hwfn: HW function.
84719198e4eSPrabhakar Kushwaha  * @p_ptt: PTT required for register access.
84819198e4eSPrabhakar Kushwaha  *
84919198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
850cc875c2eSYuval Mintz  */
851cc875c2eSYuval Mintz int qed_mcp_handle_events(struct qed_hwfn *p_hwfn,
852cc875c2eSYuval Mintz 			  struct qed_ptt *p_ptt);
853cc875c2eSYuval Mintz 
8545d24bcf1STomer Tayar enum qed_drv_role {
8555d24bcf1STomer Tayar 	QED_DRV_ROLE_OS,
8565d24bcf1STomer Tayar 	QED_DRV_ROLE_KDUMP,
8575d24bcf1STomer Tayar };
8585d24bcf1STomer Tayar 
8595d24bcf1STomer Tayar struct qed_load_req_params {
8605d24bcf1STomer Tayar 	/* Input params */
8615d24bcf1STomer Tayar 	enum qed_drv_role drv_role;
8625d24bcf1STomer Tayar 	u8 timeout_val;
8635d24bcf1STomer Tayar 	bool avoid_eng_reset;
8645d24bcf1STomer Tayar 	enum qed_override_force_load override_force_load;
8655d24bcf1STomer Tayar 
8665d24bcf1STomer Tayar 	/* Output params */
8675d24bcf1STomer Tayar 	u32 load_code;
8685d24bcf1STomer Tayar };
8695d24bcf1STomer Tayar 
870cc875c2eSYuval Mintz /**
87119198e4eSPrabhakar Kushwaha  * qed_mcp_load_req(): Sends a LOAD_REQ to the MFW, and in case the
87219198e4eSPrabhakar Kushwaha  *                     operation succeeds, returns whether this PF is
87319198e4eSPrabhakar Kushwaha  *                     the first on the engine/port or function.
874fe56b9e6SYuval Mintz  *
87519198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
87619198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
87719198e4eSPrabhakar Kushwaha  * @p_params: Params.
8785d24bcf1STomer Tayar  *
87919198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
880fe56b9e6SYuval Mintz  */
881fe56b9e6SYuval Mintz int qed_mcp_load_req(struct qed_hwfn *p_hwfn,
882fe56b9e6SYuval Mintz 		     struct qed_ptt *p_ptt,
8835d24bcf1STomer Tayar 		     struct qed_load_req_params *p_params);
884fe56b9e6SYuval Mintz 
885fe56b9e6SYuval Mintz /**
88619198e4eSPrabhakar Kushwaha  * qed_mcp_load_done(): Sends a LOAD_DONE message to the MFW.
887666db486STomer Tayar  *
88819198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
88919198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
890666db486STomer Tayar  *
89119198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
892666db486STomer Tayar  */
893666db486STomer Tayar int qed_mcp_load_done(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
894666db486STomer Tayar 
895666db486STomer Tayar /**
89619198e4eSPrabhakar Kushwaha  * qed_mcp_unload_req(): Sends a UNLOAD_REQ message to the MFW.
8971226337aSTomer Tayar  *
89819198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
89919198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
9001226337aSTomer Tayar  *
90119198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
9021226337aSTomer Tayar  */
9031226337aSTomer Tayar int qed_mcp_unload_req(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
9041226337aSTomer Tayar 
9051226337aSTomer Tayar /**
90619198e4eSPrabhakar Kushwaha  * qed_mcp_unload_done(): Sends a UNLOAD_DONE message to the MFW
9071226337aSTomer Tayar  *
90819198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
90919198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
9101226337aSTomer Tayar  *
91119198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
9121226337aSTomer Tayar  */
9131226337aSTomer Tayar int qed_mcp_unload_done(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
9141226337aSTomer Tayar 
9151226337aSTomer Tayar /**
91619198e4eSPrabhakar Kushwaha  * qed_mcp_read_mb(): Read the MFW mailbox into Current buffer.
917fe56b9e6SYuval Mintz  *
91819198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
91919198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
92019198e4eSPrabhakar Kushwaha  *
92119198e4eSPrabhakar Kushwaha  * Return: Void.
922fe56b9e6SYuval Mintz  */
923fe56b9e6SYuval Mintz void qed_mcp_read_mb(struct qed_hwfn *p_hwfn,
924fe56b9e6SYuval Mintz 		     struct qed_ptt *p_ptt);
925fe56b9e6SYuval Mintz 
926fe56b9e6SYuval Mintz /**
92719198e4eSPrabhakar Kushwaha  * qed_mcp_ack_vf_flr(): Ack to mfw that driver finished FLR process for VFs
9280b55e27dSYuval Mintz  *
92919198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
93019198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
93119198e4eSPrabhakar Kushwaha  * @vfs_to_ack: bit mask of all engine VFs for which the PF acks.
9320b55e27dSYuval Mintz  *
93319198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
9340b55e27dSYuval Mintz  */
9350b55e27dSYuval Mintz int qed_mcp_ack_vf_flr(struct qed_hwfn *p_hwfn,
9360b55e27dSYuval Mintz 		       struct qed_ptt *p_ptt, u32 *vfs_to_ack);
9370b55e27dSYuval Mintz 
9380b55e27dSYuval Mintz /**
93919198e4eSPrabhakar Kushwaha  * qed_mcp_fill_shmem_func_info(): Calls during init to read shmem of
94019198e4eSPrabhakar Kushwaha  *                                 all function-related info.
941fe56b9e6SYuval Mintz  *
94219198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
94319198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
944fe56b9e6SYuval Mintz  *
94519198e4eSPrabhakar Kushwaha  * Return: 0 upon success.
946fe56b9e6SYuval Mintz  */
947fe56b9e6SYuval Mintz int qed_mcp_fill_shmem_func_info(struct qed_hwfn *p_hwfn,
948fe56b9e6SYuval Mintz 				 struct qed_ptt *p_ptt);
949fe56b9e6SYuval Mintz 
950fe56b9e6SYuval Mintz /**
95119198e4eSPrabhakar Kushwaha  * qed_mcp_reset(): Reset the MCP using mailbox command.
952fe56b9e6SYuval Mintz  *
95319198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
95419198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
955fe56b9e6SYuval Mintz  *
95619198e4eSPrabhakar Kushwaha  * Return: 0 upon success.
957fe56b9e6SYuval Mintz  */
958fe56b9e6SYuval Mintz int qed_mcp_reset(struct qed_hwfn *p_hwfn,
959fe56b9e6SYuval Mintz 		  struct qed_ptt *p_ptt);
960fe56b9e6SYuval Mintz 
961fe56b9e6SYuval Mintz /**
96219198e4eSPrabhakar Kushwaha  * qed_mcp_nvm_rd_cmd(): Sends an NVM read command request to the MFW to get
9634102426fSTomer Tayar  *                       a buffer.
9644102426fSTomer Tayar  *
96519198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
96619198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
96719198e4eSPrabhakar Kushwaha  * @cmd: (Command) DRV_MSG_CODE_NVM_GET_FILE_DATA or
96819198e4eSPrabhakar Kushwaha  *            DRV_MSG_CODE_NVM_READ_NVRAM commands.
96919198e4eSPrabhakar Kushwaha  * @param: [0:23] - Offset [24:31] - Size.
97019198e4eSPrabhakar Kushwaha  * @o_mcp_resp: MCP response.
97119198e4eSPrabhakar Kushwaha  * @o_mcp_param: MCP response param.
97219198e4eSPrabhakar Kushwaha  * @o_txn_size: Buffer size output.
97319198e4eSPrabhakar Kushwaha  * @o_buf: Pointer to the buffer returned by the MFW.
9746c95dd8fSPrabhakar Kushwaha  * @b_can_sleep: Can sleep.
9754102426fSTomer Tayar  *
97619198e4eSPrabhakar Kushwaha  * Return: 0 upon success.
9774102426fSTomer Tayar  */
9784102426fSTomer Tayar int qed_mcp_nvm_rd_cmd(struct qed_hwfn *p_hwfn,
9794102426fSTomer Tayar 		       struct qed_ptt *p_ptt,
9804102426fSTomer Tayar 		       u32 cmd,
9814102426fSTomer Tayar 		       u32 param,
9824102426fSTomer Tayar 		       u32 *o_mcp_resp,
9836c95dd8fSPrabhakar Kushwaha 		       u32 *o_mcp_param,
9846c95dd8fSPrabhakar Kushwaha 		       u32 *o_txn_size, u32 *o_buf, bool b_can_sleep);
9854102426fSTomer Tayar 
9864102426fSTomer Tayar /**
98719198e4eSPrabhakar Kushwaha  * qed_mcp_phy_sfp_read(): Read from sfp.
988b51dab46SSudarsana Reddy Kalluru  *
98919198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
99019198e4eSPrabhakar Kushwaha  * @p_ptt: PTT required for register access.
99119198e4eSPrabhakar Kushwaha  * @port: transceiver port.
99219198e4eSPrabhakar Kushwaha  * @addr: I2C address.
99319198e4eSPrabhakar Kushwaha  * @offset: offset in sfp.
99419198e4eSPrabhakar Kushwaha  * @len: buffer length.
99519198e4eSPrabhakar Kushwaha  * @p_buf: buffer to read into.
996b51dab46SSudarsana Reddy Kalluru  *
99719198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
998b51dab46SSudarsana Reddy Kalluru  */
999b51dab46SSudarsana Reddy Kalluru int qed_mcp_phy_sfp_read(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
1000b51dab46SSudarsana Reddy Kalluru 			 u32 port, u32 addr, u32 offset, u32 len, u8 *p_buf);
1001b51dab46SSudarsana Reddy Kalluru 
1002b51dab46SSudarsana Reddy Kalluru /**
100319198e4eSPrabhakar Kushwaha  * qed_mcp_is_init(): indicates whether the MFW objects [under mcp_info]
100419198e4eSPrabhakar Kushwaha  *                    are accessible
1005fe56b9e6SYuval Mintz  *
100619198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
1007fe56b9e6SYuval Mintz  *
100819198e4eSPrabhakar Kushwaha  * Return: true if MFW is running and mcp_info is initialized.
1009fe56b9e6SYuval Mintz  */
1010fe56b9e6SYuval Mintz bool qed_mcp_is_init(struct qed_hwfn *p_hwfn);
10111408cc1fSYuval Mintz 
10121408cc1fSYuval Mintz /**
101319198e4eSPrabhakar Kushwaha  * qed_mcp_config_vf_msix(): Request MFW to configure MSI-X for a VF.
10141408cc1fSYuval Mintz  *
101519198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
101619198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
101719198e4eSPrabhakar Kushwaha  * @vf_id: absolute inside engine.
101819198e4eSPrabhakar Kushwaha  * @num: number of entries to request.
10191408cc1fSYuval Mintz  *
102019198e4eSPrabhakar Kushwaha  * Return: Int.
10211408cc1fSYuval Mintz  */
10221408cc1fSYuval Mintz int qed_mcp_config_vf_msix(struct qed_hwfn *p_hwfn,
10231408cc1fSYuval Mintz 			   struct qed_ptt *p_ptt, u8 vf_id, u8 num);
10241408cc1fSYuval Mintz 
10254102426fSTomer Tayar /**
102619198e4eSPrabhakar Kushwaha  * qed_mcp_halt(): Halt the MCP.
10274102426fSTomer Tayar  *
102819198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
102919198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
10304102426fSTomer Tayar  *
103119198e4eSPrabhakar Kushwaha  * Return: 0 upon success.
10324102426fSTomer Tayar  */
10334102426fSTomer Tayar int qed_mcp_halt(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
10344102426fSTomer Tayar 
10354102426fSTomer Tayar /**
103619198e4eSPrabhakar Kushwaha  * qed_mcp_resume: Wake up the MCP.
10374102426fSTomer Tayar  *
103819198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
103919198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
10404102426fSTomer Tayar  *
104119198e4eSPrabhakar Kushwaha  * Return: 0 upon success.
10424102426fSTomer Tayar  */
10434102426fSTomer Tayar int qed_mcp_resume(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
10444102426fSTomer Tayar 
1045a64b02d5SManish Chopra int qed_configure_pf_min_bandwidth(struct qed_dev *cdev, u8 min_bw);
10464b01e519SManish Chopra int qed_configure_pf_max_bandwidth(struct qed_dev *cdev, u8 max_bw);
10474b01e519SManish Chopra int __qed_configure_pf_max_bandwidth(struct qed_hwfn *p_hwfn,
10484b01e519SManish Chopra 				     struct qed_ptt *p_ptt,
10494b01e519SManish Chopra 				     struct qed_mcp_link_state *p_link,
10504b01e519SManish Chopra 				     u8 max_bw);
1051a64b02d5SManish Chopra int __qed_configure_pf_min_bandwidth(struct qed_hwfn *p_hwfn,
1052a64b02d5SManish Chopra 				     struct qed_ptt *p_ptt,
1053a64b02d5SManish Chopra 				     struct qed_mcp_link_state *p_link,
1054a64b02d5SManish Chopra 				     u8 min_bw);
1055351a4dedSYuval Mintz 
10564102426fSTomer Tayar int qed_mcp_mask_parities(struct qed_hwfn *p_hwfn,
10574102426fSTomer Tayar 			  struct qed_ptt *p_ptt, u32 mask_parities);
10584102426fSTomer Tayar 
105919198e4eSPrabhakar Kushwaha /* qed_mcp_mdump_get_retain(): Gets the mdump retained data from the MFW.
1060ebf64bf4SIgor Russkikh  *
106119198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
106219198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
106319198e4eSPrabhakar Kushwaha  * @p_mdump_retain: mdump retain.
1064ebf64bf4SIgor Russkikh  *
106519198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
1066ebf64bf4SIgor Russkikh  */
1067ebf64bf4SIgor Russkikh int
1068ebf64bf4SIgor Russkikh qed_mcp_mdump_get_retain(struct qed_hwfn *p_hwfn,
1069ebf64bf4SIgor Russkikh 			 struct qed_ptt *p_ptt,
1070ebf64bf4SIgor Russkikh 			 struct mdump_retain_data_stc *p_mdump_retain);
1071ebf64bf4SIgor Russkikh 
10720fefbfbaSSudarsana Kalluru /**
107319198e4eSPrabhakar Kushwaha  * qed_mcp_set_resc_max_val(): Sets the MFW's max value for the given resource.
10749c8517c4STomer Tayar  *
107519198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
107619198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
107719198e4eSPrabhakar Kushwaha  * @res_id: RES ID.
107819198e4eSPrabhakar Kushwaha  * @resc_max_val: Resec max val.
107919198e4eSPrabhakar Kushwaha  * @p_mcp_resp: MCP Resp
10809c8517c4STomer Tayar  *
108119198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
10829c8517c4STomer Tayar  */
10839c8517c4STomer Tayar int
10849c8517c4STomer Tayar qed_mcp_set_resc_max_val(struct qed_hwfn *p_hwfn,
10859c8517c4STomer Tayar 			 struct qed_ptt *p_ptt,
10869c8517c4STomer Tayar 			 enum qed_resources res_id,
10879c8517c4STomer Tayar 			 u32 resc_max_val, u32 *p_mcp_resp);
10889c8517c4STomer Tayar 
10899c8517c4STomer Tayar /**
109019198e4eSPrabhakar Kushwaha  * qed_mcp_get_resc_info(): Gets the MFW allocation info for the given
109119198e4eSPrabhakar Kushwaha  *                          resource.
10929c8517c4STomer Tayar  *
109319198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
109419198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
109519198e4eSPrabhakar Kushwaha  * @res_id: Res ID.
109619198e4eSPrabhakar Kushwaha  * @p_mcp_resp: MCP resp.
109719198e4eSPrabhakar Kushwaha  * @p_resc_num: Resc num.
109819198e4eSPrabhakar Kushwaha  * @p_resc_start: Resc start.
10999c8517c4STomer Tayar  *
110019198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
11019c8517c4STomer Tayar  */
11029c8517c4STomer Tayar int
11039c8517c4STomer Tayar qed_mcp_get_resc_info(struct qed_hwfn *p_hwfn,
11049c8517c4STomer Tayar 		      struct qed_ptt *p_ptt,
11059c8517c4STomer Tayar 		      enum qed_resources res_id,
11069c8517c4STomer Tayar 		      u32 *p_mcp_resp, u32 *p_resc_num, u32 *p_resc_start);
11079c8517c4STomer Tayar 
11089c8517c4STomer Tayar /**
110919198e4eSPrabhakar Kushwaha  * qed_mcp_ov_update_eswitch(): Send eswitch mode to MFW.
11100fefbfbaSSudarsana Kalluru  *
111119198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
111219198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
111319198e4eSPrabhakar Kushwaha  * @eswitch: eswitch mode.
11140fefbfbaSSudarsana Kalluru  *
111519198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
11160fefbfbaSSudarsana Kalluru  */
11170fefbfbaSSudarsana Kalluru int qed_mcp_ov_update_eswitch(struct qed_hwfn *p_hwfn,
11180fefbfbaSSudarsana Kalluru 			      struct qed_ptt *p_ptt,
11190fefbfbaSSudarsana Kalluru 			      enum qed_ov_eswitch eswitch);
11200fefbfbaSSudarsana Kalluru 
11219c8517c4STomer Tayar #define QED_MCP_RESC_LOCK_MIN_VAL       RESOURCE_DUMP
11229c8517c4STomer Tayar #define QED_MCP_RESC_LOCK_MAX_VAL       31
11239c8517c4STomer Tayar 
11249c8517c4STomer Tayar enum qed_resc_lock {
11259c8517c4STomer Tayar 	QED_RESC_LOCK_DBG_DUMP = QED_MCP_RESC_LOCK_MIN_VAL,
1126db82f70eSsudarsana.kalluru@cavium.com 	QED_RESC_LOCK_PTP_PORT0,
1127db82f70eSsudarsana.kalluru@cavium.com 	QED_RESC_LOCK_PTP_PORT1,
1128db82f70eSsudarsana.kalluru@cavium.com 	QED_RESC_LOCK_PTP_PORT2,
1129db82f70eSsudarsana.kalluru@cavium.com 	QED_RESC_LOCK_PTP_PORT3,
1130f470f22cSsudarsana.kalluru@cavium.com 	QED_RESC_LOCK_RESC_ALLOC = QED_MCP_RESC_LOCK_MAX_VAL,
1131f470f22cSsudarsana.kalluru@cavium.com 	QED_RESC_LOCK_RESC_INVALID
11329c8517c4STomer Tayar };
113318a69e36SMintz, Yuval 
113418a69e36SMintz, Yuval /**
113519198e4eSPrabhakar Kushwaha  * qed_mcp_initiate_pf_flr(): Initiates PF FLR.
113618a69e36SMintz, Yuval  *
113719198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
113819198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
113918a69e36SMintz, Yuval  *
114019198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
114118a69e36SMintz, Yuval  */
114218a69e36SMintz, Yuval int qed_mcp_initiate_pf_flr(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
114395691c9cSTomer Tayar struct qed_resc_lock_params {
114495691c9cSTomer Tayar 	/* Resource number [valid values are 0..31] */
114595691c9cSTomer Tayar 	u8 resource;
114695691c9cSTomer Tayar 
114795691c9cSTomer Tayar 	/* Lock timeout value in seconds [default, none or 1..254] */
114895691c9cSTomer Tayar 	u8 timeout;
114995691c9cSTomer Tayar #define QED_MCP_RESC_LOCK_TO_DEFAULT    0
115095691c9cSTomer Tayar #define QED_MCP_RESC_LOCK_TO_NONE       255
115195691c9cSTomer Tayar 
115295691c9cSTomer Tayar 	/* Number of times to retry locking */
115395691c9cSTomer Tayar 	u8 retry_num;
1154f470f22cSsudarsana.kalluru@cavium.com #define QED_MCP_RESC_LOCK_RETRY_CNT_DFLT        10
115595691c9cSTomer Tayar 
115695691c9cSTomer Tayar 	/* The interval in usec between retries */
115795691c9cSTomer Tayar 	u16 retry_interval;
1158f470f22cSsudarsana.kalluru@cavium.com #define QED_MCP_RESC_LOCK_RETRY_VAL_DFLT        10000
115995691c9cSTomer Tayar 
116095691c9cSTomer Tayar 	/* Use sleep or delay between retries */
116195691c9cSTomer Tayar 	bool sleep_b4_retry;
116295691c9cSTomer Tayar 
116395691c9cSTomer Tayar 	/* Will be set as true if the resource is free and granted */
116495691c9cSTomer Tayar 	bool b_granted;
116595691c9cSTomer Tayar 
116695691c9cSTomer Tayar 	/* Will be filled with the resource owner.
116795691c9cSTomer Tayar 	 * [0..15 = PF0-15, 16 = MFW]
116895691c9cSTomer Tayar 	 */
116995691c9cSTomer Tayar 	u8 owner;
117095691c9cSTomer Tayar };
117195691c9cSTomer Tayar 
117295691c9cSTomer Tayar /**
117319198e4eSPrabhakar Kushwaha  * qed_mcp_resc_lock(): Acquires MFW generic resource lock.
117495691c9cSTomer Tayar  *
117519198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
117619198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
117719198e4eSPrabhakar Kushwaha  * @p_params: Params.
117895691c9cSTomer Tayar  *
117919198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
118095691c9cSTomer Tayar  */
118195691c9cSTomer Tayar int
118295691c9cSTomer Tayar qed_mcp_resc_lock(struct qed_hwfn *p_hwfn,
118395691c9cSTomer Tayar 		  struct qed_ptt *p_ptt, struct qed_resc_lock_params *p_params);
118495691c9cSTomer Tayar 
118595691c9cSTomer Tayar struct qed_resc_unlock_params {
118695691c9cSTomer Tayar 	/* Resource number [valid values are 0..31] */
118795691c9cSTomer Tayar 	u8 resource;
118895691c9cSTomer Tayar 
118995691c9cSTomer Tayar 	/* Allow to release a resource even if belongs to another PF */
119095691c9cSTomer Tayar 	bool b_force;
119195691c9cSTomer Tayar 
119295691c9cSTomer Tayar 	/* Will be set as true if the resource is released */
119395691c9cSTomer Tayar 	bool b_released;
119495691c9cSTomer Tayar };
119595691c9cSTomer Tayar 
119695691c9cSTomer Tayar /**
119719198e4eSPrabhakar Kushwaha  * qed_mcp_resc_unlock(): Releases MFW generic resource lock.
119895691c9cSTomer Tayar  *
119919198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
120019198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
120119198e4eSPrabhakar Kushwaha  * @p_params: Params.
120295691c9cSTomer Tayar  *
120319198e4eSPrabhakar Kushwaha  * Return: Int - 0 - Operation was successul.
120495691c9cSTomer Tayar  */
120595691c9cSTomer Tayar int
120695691c9cSTomer Tayar qed_mcp_resc_unlock(struct qed_hwfn *p_hwfn,
120795691c9cSTomer Tayar 		    struct qed_ptt *p_ptt,
120895691c9cSTomer Tayar 		    struct qed_resc_unlock_params *p_params);
120995691c9cSTomer Tayar 
1210f470f22cSsudarsana.kalluru@cavium.com /**
121119198e4eSPrabhakar Kushwaha  * qed_mcp_resc_lock_default_init(): Default initialization for
121219198e4eSPrabhakar Kushwaha  *                                   lock/unlock resource structs.
1213f470f22cSsudarsana.kalluru@cavium.com  *
121419198e4eSPrabhakar Kushwaha  * @p_lock: lock params struct to be initialized; Can be NULL.
121519198e4eSPrabhakar Kushwaha  * @p_unlock: unlock params struct to be initialized; Can be NULL.
121619198e4eSPrabhakar Kushwaha  * @resource: the requested resource.
121719198e4eSPrabhakar Kushwaha  * @b_is_permanent: disable retries & aging when set.
121819198e4eSPrabhakar Kushwaha  *
121919198e4eSPrabhakar Kushwaha  * Return: Void.
1220f470f22cSsudarsana.kalluru@cavium.com  */
1221f470f22cSsudarsana.kalluru@cavium.com void qed_mcp_resc_lock_default_init(struct qed_resc_lock_params *p_lock,
1222f470f22cSsudarsana.kalluru@cavium.com 				    struct qed_resc_unlock_params *p_unlock,
1223f470f22cSsudarsana.kalluru@cavium.com 				    enum qed_resc_lock
1224f470f22cSsudarsana.kalluru@cavium.com 				    resource, bool b_is_permanent);
1225df9c716dSSudarsana Reddy Kalluru 
1226df9c716dSSudarsana Reddy Kalluru /**
122719198e4eSPrabhakar Kushwaha  * qed_mcp_is_smart_an_supported(): Return whether management firmware
122819198e4eSPrabhakar Kushwaha  *                                  support smart AN
1229df9c716dSSudarsana Reddy Kalluru  *
123019198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
1231df9c716dSSudarsana Reddy Kalluru  *
123219198e4eSPrabhakar Kushwaha  * Return: bool true if feature is supported.
1233df9c716dSSudarsana Reddy Kalluru  */
1234df9c716dSSudarsana Reddy Kalluru bool qed_mcp_is_smart_an_supported(struct qed_hwfn *p_hwfn);
1235df9c716dSSudarsana Reddy Kalluru 
1236645874e5SSudarsana Reddy Kalluru /**
123719198e4eSPrabhakar Kushwaha  * qed_mcp_get_capabilities(): Learn of supported MFW features;
123819198e4eSPrabhakar Kushwaha  *                             To be done during early init.
1239645874e5SSudarsana Reddy Kalluru  *
124019198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
124119198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
124219198e4eSPrabhakar Kushwaha  *
124319198e4eSPrabhakar Kushwaha  * Return: Int.
1244645874e5SSudarsana Reddy Kalluru  */
1245645874e5SSudarsana Reddy Kalluru int qed_mcp_get_capabilities(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
1246f470f22cSsudarsana.kalluru@cavium.com 
1247645874e5SSudarsana Reddy Kalluru /**
124819198e4eSPrabhakar Kushwaha  * qed_mcp_set_capabilities(): Inform MFW of set of features supported
124919198e4eSPrabhakar Kushwaha  *                             by driver. Should be done inside the content
125019198e4eSPrabhakar Kushwaha  *                             of the LOAD_REQ.
1251645874e5SSudarsana Reddy Kalluru  *
125219198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
125319198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
125419198e4eSPrabhakar Kushwaha  *
125519198e4eSPrabhakar Kushwaha  * Return: Int.
1256645874e5SSudarsana Reddy Kalluru  */
1257645874e5SSudarsana Reddy Kalluru int qed_mcp_set_capabilities(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
125843645ce0SSudarsana Reddy Kalluru 
125943645ce0SSudarsana Reddy Kalluru /**
126019198e4eSPrabhakar Kushwaha  * qed_mcp_read_ufp_config(): Read ufp config from the shared memory.
1261cac6f691SSudarsana Reddy Kalluru  *
126219198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
126319198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
126419198e4eSPrabhakar Kushwaha  *
126519198e4eSPrabhakar Kushwaha  * Return: Void.
1266cac6f691SSudarsana Reddy Kalluru  */
1267cac6f691SSudarsana Reddy Kalluru void qed_mcp_read_ufp_config(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
1268cac6f691SSudarsana Reddy Kalluru 
1269cac6f691SSudarsana Reddy Kalluru /**
127019198e4eSPrabhakar Kushwaha  * qed_mcp_nvm_info_populate(): Populate the nvm info shadow in the given
127119198e4eSPrabhakar Kushwaha  *                              hardware function.
127243645ce0SSudarsana Reddy Kalluru  *
127319198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
127419198e4eSPrabhakar Kushwaha  *
127519198e4eSPrabhakar Kushwaha  * Return: Int.
127643645ce0SSudarsana Reddy Kalluru  */
127743645ce0SSudarsana Reddy Kalluru int qed_mcp_nvm_info_populate(struct qed_hwfn *p_hwfn);
127843645ce0SSudarsana Reddy Kalluru 
127979284adeSMichal Kalderon /**
128019198e4eSPrabhakar Kushwaha  * qed_mcp_nvm_info_free(): Delete nvm info shadow in the given
128119198e4eSPrabhakar Kushwaha  *                          hardware function.
128213cf8aabSSudarsana Reddy Kalluru  *
128319198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
128419198e4eSPrabhakar Kushwaha  *
128519198e4eSPrabhakar Kushwaha  * Return: Void.
128613cf8aabSSudarsana Reddy Kalluru  */
128713cf8aabSSudarsana Reddy Kalluru void qed_mcp_nvm_info_free(struct qed_hwfn *p_hwfn);
128813cf8aabSSudarsana Reddy Kalluru 
128913cf8aabSSudarsana Reddy Kalluru /**
129019198e4eSPrabhakar Kushwaha  * qed_mcp_get_engine_config(): Get the engine affinity configuration.
129179284adeSMichal Kalderon  *
129219198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
129319198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
129419198e4eSPrabhakar Kushwaha  *
129519198e4eSPrabhakar Kushwaha  * Return: Int.
129679284adeSMichal Kalderon  */
129779284adeSMichal Kalderon int qed_mcp_get_engine_config(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
129879284adeSMichal Kalderon 
129979284adeSMichal Kalderon /**
130019198e4eSPrabhakar Kushwaha  * qed_mcp_get_ppfid_bitmap(): Get the PPFID bitmap.
130179284adeSMichal Kalderon  *
130219198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
130319198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
130419198e4eSPrabhakar Kushwaha  *
130519198e4eSPrabhakar Kushwaha  * Return: Int.
130679284adeSMichal Kalderon  */
130779284adeSMichal Kalderon int qed_mcp_get_ppfid_bitmap(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
130879284adeSMichal Kalderon 
130938eabdf0SSudarsana Reddy Kalluru /**
131019198e4eSPrabhakar Kushwaha  * qed_mcp_nvm_get_cfg(): Get NVM config attribute value.
13112d4c8495SSudarsana Reddy Kalluru  *
131219198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
131319198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
131419198e4eSPrabhakar Kushwaha  * @option_id: Option ID.
131519198e4eSPrabhakar Kushwaha  * @entity_id: Entity ID.
131619198e4eSPrabhakar Kushwaha  * @flags: Flags.
131719198e4eSPrabhakar Kushwaha  * @p_buf: Buf.
131819198e4eSPrabhakar Kushwaha  * @p_len: Len.
131919198e4eSPrabhakar Kushwaha  *
132019198e4eSPrabhakar Kushwaha  * Return: Int.
13212d4c8495SSudarsana Reddy Kalluru  */
13222d4c8495SSudarsana Reddy Kalluru int qed_mcp_nvm_get_cfg(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
13232d4c8495SSudarsana Reddy Kalluru 			u16 option_id, u8 entity_id, u16 flags, u8 *p_buf,
13242d4c8495SSudarsana Reddy Kalluru 			u32 *p_len);
13252d4c8495SSudarsana Reddy Kalluru 
13262d4c8495SSudarsana Reddy Kalluru /**
132719198e4eSPrabhakar Kushwaha  * qed_mcp_nvm_set_cfg(): Set NVM config attribute value.
132838eabdf0SSudarsana Reddy Kalluru  *
132919198e4eSPrabhakar Kushwaha  * @p_hwfn: HW device data.
133019198e4eSPrabhakar Kushwaha  * @p_ptt: P_ptt.
133119198e4eSPrabhakar Kushwaha  * @option_id: Option ID.
133219198e4eSPrabhakar Kushwaha  * @entity_id: Entity ID.
133319198e4eSPrabhakar Kushwaha  * @flags: Flags.
133419198e4eSPrabhakar Kushwaha  * @p_buf: Buf.
133519198e4eSPrabhakar Kushwaha  * @len: Len.
133619198e4eSPrabhakar Kushwaha  *
133719198e4eSPrabhakar Kushwaha  * Return: Int.
133838eabdf0SSudarsana Reddy Kalluru  */
133938eabdf0SSudarsana Reddy Kalluru int qed_mcp_nvm_set_cfg(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
134038eabdf0SSudarsana Reddy Kalluru 			u16 option_id, u8 entity_id, u16 flags, u8 *p_buf,
134138eabdf0SSudarsana Reddy Kalluru 			u32 len);
1342fe56b9e6SYuval Mintz #endif
1343