xref: /openbmc/linux/drivers/net/ethernet/qlogic/qed/qed_mcp.h (revision e4781421e883340b796da5a724bda7226817990b)
1 /* QLogic qed NIC Driver
2  * Copyright (c) 2015-2017  QLogic Corporation
3  *
4  * This software is available to you under a choice of one of two
5  * licenses.  You may choose to be licensed under the terms of the GNU
6  * General Public License (GPL) Version 2, available from the file
7  * COPYING in the main directory of this source tree, or the
8  * OpenIB.org BSD license below:
9  *
10  *     Redistribution and use in source and binary forms, with or
11  *     without modification, are permitted provided that the following
12  *     conditions are met:
13  *
14  *      - Redistributions of source code must retain the above
15  *        copyright notice, this list of conditions and the following
16  *        disclaimer.
17  *
18  *      - Redistributions in binary form must reproduce the above
19  *        copyright notice, this list of conditions and the following
20  *        disclaimer in the documentation and /or other materials
21  *        provided with the distribution.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30  * SOFTWARE.
31  */
32 
33 #ifndef _QED_MCP_H
34 #define _QED_MCP_H
35 
36 #include <linux/types.h>
37 #include <linux/delay.h>
38 #include <linux/slab.h>
39 #include <linux/spinlock.h>
40 #include "qed_hsi.h"
41 
42 struct qed_mcp_link_speed_params {
43 	bool    autoneg;
44 	u32     advertised_speeds;      /* bitmask of DRV_SPEED_CAPABILITY */
45 	u32     forced_speed;	   /* In Mb/s */
46 };
47 
48 struct qed_mcp_link_pause_params {
49 	bool    autoneg;
50 	bool    forced_rx;
51 	bool    forced_tx;
52 };
53 
54 struct qed_mcp_link_params {
55 	struct qed_mcp_link_speed_params	speed;
56 	struct qed_mcp_link_pause_params	pause;
57 	u32				     loopback_mode;
58 };
59 
60 struct qed_mcp_link_capabilities {
61 	u32 speed_capabilities;
62 };
63 
64 struct qed_mcp_link_state {
65 	bool    link_up;
66 
67 	u32	min_pf_rate;
68 
69 	/* Actual link speed in Mb/s */
70 	u32	line_speed;
71 
72 	/* PF max speed in Mb/s, deduced from line_speed
73 	 * according to PF max bandwidth configuration.
74 	 */
75 	u32     speed;
76 	bool    full_duplex;
77 
78 	bool    an;
79 	bool    an_complete;
80 	bool    parallel_detection;
81 	bool    pfc_enabled;
82 
83 #define QED_LINK_PARTNER_SPEED_1G_HD    BIT(0)
84 #define QED_LINK_PARTNER_SPEED_1G_FD    BIT(1)
85 #define QED_LINK_PARTNER_SPEED_10G      BIT(2)
86 #define QED_LINK_PARTNER_SPEED_20G      BIT(3)
87 #define QED_LINK_PARTNER_SPEED_25G      BIT(4)
88 #define QED_LINK_PARTNER_SPEED_40G      BIT(5)
89 #define QED_LINK_PARTNER_SPEED_50G      BIT(6)
90 #define QED_LINK_PARTNER_SPEED_100G     BIT(7)
91 	u32     partner_adv_speed;
92 
93 	bool    partner_tx_flow_ctrl_en;
94 	bool    partner_rx_flow_ctrl_en;
95 
96 #define QED_LINK_PARTNER_SYMMETRIC_PAUSE (1)
97 #define QED_LINK_PARTNER_ASYMMETRIC_PAUSE (2)
98 #define QED_LINK_PARTNER_BOTH_PAUSE (3)
99 	u8      partner_adv_pause;
100 
101 	bool    sfp_tx_fault;
102 };
103 
104 struct qed_mcp_function_info {
105 	u8				pause_on_host;
106 
107 	enum qed_pci_personality	protocol;
108 
109 	u8				bandwidth_min;
110 	u8				bandwidth_max;
111 
112 	u8				mac[ETH_ALEN];
113 
114 	u64				wwn_port;
115 	u64				wwn_node;
116 
117 #define QED_MCP_VLAN_UNSET              (0xffff)
118 	u16				ovlan;
119 
120 	u16				mtu;
121 };
122 
123 struct qed_mcp_nvm_common {
124 	u32	offset;
125 	u32	param;
126 	u32	resp;
127 	u32	cmd;
128 };
129 
130 struct qed_mcp_drv_version {
131 	u32	version;
132 	u8	name[MCP_DRV_VER_STR_SIZE - 4];
133 };
134 
135 struct qed_mcp_lan_stats {
136 	u64 ucast_rx_pkts;
137 	u64 ucast_tx_pkts;
138 	u32 fcs_err;
139 };
140 
141 struct qed_mcp_fcoe_stats {
142 	u64 rx_pkts;
143 	u64 tx_pkts;
144 	u32 fcs_err;
145 	u32 login_failure;
146 };
147 
148 struct qed_mcp_iscsi_stats {
149 	u64 rx_pdus;
150 	u64 tx_pdus;
151 	u64 rx_bytes;
152 	u64 tx_bytes;
153 };
154 
155 struct qed_mcp_rdma_stats {
156 	u64 rx_pkts;
157 	u64 tx_pkts;
158 	u64 rx_bytes;
159 	u64 tx_byts;
160 };
161 
162 enum qed_mcp_protocol_type {
163 	QED_MCP_LAN_STATS,
164 	QED_MCP_FCOE_STATS,
165 	QED_MCP_ISCSI_STATS,
166 	QED_MCP_RDMA_STATS
167 };
168 
169 union qed_mcp_protocol_stats {
170 	struct qed_mcp_lan_stats lan_stats;
171 	struct qed_mcp_fcoe_stats fcoe_stats;
172 	struct qed_mcp_iscsi_stats iscsi_stats;
173 	struct qed_mcp_rdma_stats rdma_stats;
174 };
175 
176 enum qed_ov_eswitch {
177 	QED_OV_ESWITCH_NONE,
178 	QED_OV_ESWITCH_VEB,
179 	QED_OV_ESWITCH_VEPA
180 };
181 
182 enum qed_ov_client {
183 	QED_OV_CLIENT_DRV,
184 	QED_OV_CLIENT_USER,
185 	QED_OV_CLIENT_VENDOR_SPEC
186 };
187 
188 enum qed_ov_driver_state {
189 	QED_OV_DRIVER_STATE_NOT_LOADED,
190 	QED_OV_DRIVER_STATE_DISABLED,
191 	QED_OV_DRIVER_STATE_ACTIVE
192 };
193 
194 enum qed_ov_wol {
195 	QED_OV_WOL_DEFAULT,
196 	QED_OV_WOL_DISABLED,
197 	QED_OV_WOL_ENABLED
198 };
199 
200 /**
201  * @brief - returns the link params of the hw function
202  *
203  * @param p_hwfn
204  *
205  * @returns pointer to link params
206  */
207 struct qed_mcp_link_params *qed_mcp_get_link_params(struct qed_hwfn *);
208 
209 /**
210  * @brief - return the link state of the hw function
211  *
212  * @param p_hwfn
213  *
214  * @returns pointer to link state
215  */
216 struct qed_mcp_link_state *qed_mcp_get_link_state(struct qed_hwfn *);
217 
218 /**
219  * @brief - return the link capabilities of the hw function
220  *
221  * @param p_hwfn
222  *
223  * @returns pointer to link capabilities
224  */
225 struct qed_mcp_link_capabilities
226 	*qed_mcp_get_link_capabilities(struct qed_hwfn *p_hwfn);
227 
228 /**
229  * @brief Request the MFW to set the the link according to 'link_input'.
230  *
231  * @param p_hwfn
232  * @param p_ptt
233  * @param b_up - raise link if `true'. Reset link if `false'.
234  *
235  * @return int
236  */
237 int qed_mcp_set_link(struct qed_hwfn   *p_hwfn,
238 		     struct qed_ptt     *p_ptt,
239 		     bool               b_up);
240 
241 /**
242  * @brief Get the management firmware version value
243  *
244  * @param p_hwfn
245  * @param p_ptt
246  * @param p_mfw_ver    - mfw version value
247  * @param p_running_bundle_id	- image id in nvram; Optional.
248  *
249  * @return int - 0 - operation was successful.
250  */
251 int qed_mcp_get_mfw_ver(struct qed_hwfn *p_hwfn,
252 			struct qed_ptt *p_ptt,
253 			u32 *p_mfw_ver, u32 *p_running_bundle_id);
254 
255 /**
256  * @brief Get media type value of the port.
257  *
258  * @param cdev      - qed dev pointer
259  * @param mfw_ver    - media type value
260  *
261  * @return int -
262  *      0 - Operation was successul.
263  *      -EBUSY - Operation failed
264  */
265 int qed_mcp_get_media_type(struct qed_dev      *cdev,
266 			   u32                  *media_type);
267 
268 /**
269  * @brief General function for sending commands to the MCP
270  *        mailbox. It acquire mutex lock for the entire
271  *        operation, from sending the request until the MCP
272  *        response. Waiting for MCP response will be checked up
273  *        to 5 seconds every 5ms.
274  *
275  * @param p_hwfn     - hw function
276  * @param p_ptt      - PTT required for register access
277  * @param cmd        - command to be sent to the MCP.
278  * @param param      - Optional param
279  * @param o_mcp_resp - The MCP response code (exclude sequence).
280  * @param o_mcp_param- Optional parameter provided by the MCP
281  *                     response
282  * @return int - 0 - operation
283  * was successul.
284  */
285 int qed_mcp_cmd(struct qed_hwfn *p_hwfn,
286 		struct qed_ptt *p_ptt,
287 		u32 cmd,
288 		u32 param,
289 		u32 *o_mcp_resp,
290 		u32 *o_mcp_param);
291 
292 /**
293  * @brief - drains the nig, allowing completion to pass in case of pauses.
294  *          (Should be called only from sleepable context)
295  *
296  * @param p_hwfn
297  * @param p_ptt
298  */
299 int qed_mcp_drain(struct qed_hwfn *p_hwfn,
300 		  struct qed_ptt *p_ptt);
301 
302 /**
303  * @brief Get the flash size value
304  *
305  * @param p_hwfn
306  * @param p_ptt
307  * @param p_flash_size  - flash size in bytes to be filled.
308  *
309  * @return int - 0 - operation was successul.
310  */
311 int qed_mcp_get_flash_size(struct qed_hwfn     *p_hwfn,
312 			   struct qed_ptt       *p_ptt,
313 			   u32 *p_flash_size);
314 
315 /**
316  * @brief Send driver version to MFW
317  *
318  * @param p_hwfn
319  * @param p_ptt
320  * @param version - Version value
321  * @param name - Protocol driver name
322  *
323  * @return int - 0 - operation was successul.
324  */
325 int
326 qed_mcp_send_drv_version(struct qed_hwfn *p_hwfn,
327 			 struct qed_ptt *p_ptt,
328 			 struct qed_mcp_drv_version *p_ver);
329 
330 /**
331  * @brief Notify MFW about the change in base device properties
332  *
333  *  @param p_hwfn
334  *  @param p_ptt
335  *  @param client - qed client type
336  *
337  * @return int - 0 - operation was successful.
338  */
339 int qed_mcp_ov_update_current_config(struct qed_hwfn *p_hwfn,
340 				     struct qed_ptt *p_ptt,
341 				     enum qed_ov_client client);
342 
343 /**
344  * @brief Notify MFW about the driver state
345  *
346  *  @param p_hwfn
347  *  @param p_ptt
348  *  @param drv_state - Driver state
349  *
350  * @return int - 0 - operation was successful.
351  */
352 int qed_mcp_ov_update_driver_state(struct qed_hwfn *p_hwfn,
353 				   struct qed_ptt *p_ptt,
354 				   enum qed_ov_driver_state drv_state);
355 
356 /**
357  * @brief Send MTU size to MFW
358  *
359  *  @param p_hwfn
360  *  @param p_ptt
361  *  @param mtu - MTU size
362  *
363  * @return int - 0 - operation was successful.
364  */
365 int qed_mcp_ov_update_mtu(struct qed_hwfn *p_hwfn,
366 			  struct qed_ptt *p_ptt, u16 mtu);
367 
368 /**
369  * @brief Send MAC address to MFW
370  *
371  *  @param p_hwfn
372  *  @param p_ptt
373  *  @param mac - MAC address
374  *
375  * @return int - 0 - operation was successful.
376  */
377 int qed_mcp_ov_update_mac(struct qed_hwfn *p_hwfn,
378 			  struct qed_ptt *p_ptt, u8 *mac);
379 
380 /**
381  * @brief Send WOL mode to MFW
382  *
383  *  @param p_hwfn
384  *  @param p_ptt
385  *  @param wol - WOL mode
386  *
387  * @return int - 0 - operation was successful.
388  */
389 int qed_mcp_ov_update_wol(struct qed_hwfn *p_hwfn,
390 			  struct qed_ptt *p_ptt,
391 			  enum qed_ov_wol wol);
392 
393 /**
394  * @brief Set LED status
395  *
396  *  @param p_hwfn
397  *  @param p_ptt
398  *  @param mode - LED mode
399  *
400  * @return int - 0 - operation was successful.
401  */
402 int qed_mcp_set_led(struct qed_hwfn *p_hwfn,
403 		    struct qed_ptt *p_ptt,
404 		    enum qed_led_mode mode);
405 
406 /**
407  * @brief Read from nvm
408  *
409  *  @param cdev
410  *  @param addr - nvm offset
411  *  @param p_buf - nvm read buffer
412  *  @param len - buffer len
413  *
414  * @return int - 0 - operation was successful.
415  */
416 int qed_mcp_nvm_read(struct qed_dev *cdev, u32 addr, u8 *p_buf, u32 len);
417 
418 /**
419  * @brief Bist register test
420  *
421  *  @param p_hwfn    - hw function
422  *  @param p_ptt     - PTT required for register access
423  *
424  * @return int - 0 - operation was successful.
425  */
426 int qed_mcp_bist_register_test(struct qed_hwfn *p_hwfn,
427 			       struct qed_ptt *p_ptt);
428 
429 /**
430  * @brief Bist clock test
431  *
432  *  @param p_hwfn    - hw function
433  *  @param p_ptt     - PTT required for register access
434  *
435  * @return int - 0 - operation was successful.
436  */
437 int qed_mcp_bist_clock_test(struct qed_hwfn *p_hwfn,
438 			    struct qed_ptt *p_ptt);
439 
440 /**
441  * @brief Bist nvm test - get number of images
442  *
443  *  @param p_hwfn       - hw function
444  *  @param p_ptt        - PTT required for register access
445  *  @param num_images   - number of images if operation was
446  *			  successful. 0 if not.
447  *
448  * @return int - 0 - operation was successful.
449  */
450 int qed_mcp_bist_nvm_test_get_num_images(struct qed_hwfn *p_hwfn,
451 					 struct qed_ptt *p_ptt,
452 					 u32 *num_images);
453 
454 /**
455  * @brief Bist nvm test - get image attributes by index
456  *
457  *  @param p_hwfn      - hw function
458  *  @param p_ptt       - PTT required for register access
459  *  @param p_image_att - Attributes of image
460  *  @param image_index - Index of image to get information for
461  *
462  * @return int - 0 - operation was successful.
463  */
464 int qed_mcp_bist_nvm_test_get_image_att(struct qed_hwfn *p_hwfn,
465 					struct qed_ptt *p_ptt,
466 					struct bist_nvm_image_att *p_image_att,
467 					u32 image_index);
468 
469 /* Using hwfn number (and not pf_num) is required since in CMT mode,
470  * same pf_num may be used by two different hwfn
471  * TODO - this shouldn't really be in .h file, but until all fields
472  * required during hw-init will be placed in their correct place in shmem
473  * we need it in qed_dev.c [for readin the nvram reflection in shmem].
474  */
475 #define MCP_PF_ID_BY_REL(p_hwfn, rel_pfid) (QED_IS_BB((p_hwfn)->cdev) ?	       \
476 					    ((rel_pfid) |		       \
477 					     ((p_hwfn)->abs_pf_id & 1) << 3) : \
478 					    rel_pfid)
479 #define MCP_PF_ID(p_hwfn) MCP_PF_ID_BY_REL(p_hwfn, (p_hwfn)->rel_pf_id)
480 
481 /* TODO - this is only correct as long as only BB is supported, and
482  * no port-swapping is implemented; Afterwards we'll need to fix it.
483  */
484 #define MFW_PORT(_p_hwfn)       ((_p_hwfn)->abs_pf_id %	\
485 				 ((_p_hwfn)->cdev->num_ports_in_engines * 2))
486 struct qed_mcp_info {
487 	spinlock_t				lock;
488 	bool					block_mb_sending;
489 	u32					public_base;
490 	u32					drv_mb_addr;
491 	u32					mfw_mb_addr;
492 	u32					port_addr;
493 	u16					drv_mb_seq;
494 	u16					drv_pulse_seq;
495 	struct qed_mcp_link_params		link_input;
496 	struct qed_mcp_link_state		link_output;
497 	struct qed_mcp_link_capabilities	link_capabilities;
498 	struct qed_mcp_function_info		func_info;
499 	u8					*mfw_mb_cur;
500 	u8					*mfw_mb_shadow;
501 	u16					mfw_mb_length;
502 	u16					mcp_hist;
503 };
504 
505 struct qed_mcp_mb_params {
506 	u32			cmd;
507 	u32			param;
508 	union drv_union_data	*p_data_src;
509 	union drv_union_data	*p_data_dst;
510 	u32			mcp_resp;
511 	u32			mcp_param;
512 };
513 
514 /**
515  * @brief Initialize the interface with the MCP
516  *
517  * @param p_hwfn - HW func
518  * @param p_ptt - PTT required for register access
519  *
520  * @return int
521  */
522 int qed_mcp_cmd_init(struct qed_hwfn *p_hwfn,
523 		     struct qed_ptt *p_ptt);
524 
525 /**
526  * @brief Initialize the port interface with the MCP
527  *
528  * @param p_hwfn
529  * @param p_ptt
530  * Can only be called after `num_ports_in_engines' is set
531  */
532 void qed_mcp_cmd_port_init(struct qed_hwfn *p_hwfn,
533 			   struct qed_ptt *p_ptt);
534 /**
535  * @brief Releases resources allocated during the init process.
536  *
537  * @param p_hwfn - HW func
538  * @param p_ptt - PTT required for register access
539  *
540  * @return int
541  */
542 
543 int qed_mcp_free(struct qed_hwfn *p_hwfn);
544 
545 /**
546  * @brief This function is called from the DPC context. After
547  * pointing PTT to the mfw mb, check for events sent by the MCP
548  * to the driver and ack them. In case a critical event
549  * detected, it will be handled here, otherwise the work will be
550  * queued to a sleepable work-queue.
551  *
552  * @param p_hwfn - HW function
553  * @param p_ptt - PTT required for register access
554  * @return int - 0 - operation
555  * was successul.
556  */
557 int qed_mcp_handle_events(struct qed_hwfn *p_hwfn,
558 			  struct qed_ptt *p_ptt);
559 
560 /**
561  * @brief Sends a LOAD_REQ to the MFW, and in case operation
562  *        succeed, returns whether this PF is the first on the
563  *        chip/engine/port or function. This function should be
564  *        called when driver is ready to accept MFW events after
565  *        Storms initializations are done.
566  *
567  * @param p_hwfn       - hw function
568  * @param p_ptt        - PTT required for register access
569  * @param p_load_code  - The MCP response param containing one
570  *      of the following:
571  *      FW_MSG_CODE_DRV_LOAD_ENGINE
572  *      FW_MSG_CODE_DRV_LOAD_PORT
573  *      FW_MSG_CODE_DRV_LOAD_FUNCTION
574  * @return int -
575  *      0 - Operation was successul.
576  *      -EBUSY - Operation failed
577  */
578 int qed_mcp_load_req(struct qed_hwfn *p_hwfn,
579 		     struct qed_ptt *p_ptt,
580 		     u32 *p_load_code);
581 
582 /**
583  * @brief Read the MFW mailbox into Current buffer.
584  *
585  * @param p_hwfn
586  * @param p_ptt
587  */
588 void qed_mcp_read_mb(struct qed_hwfn *p_hwfn,
589 		     struct qed_ptt *p_ptt);
590 
591 /**
592  * @brief Ack to mfw that driver finished FLR process for VFs
593  *
594  * @param p_hwfn
595  * @param p_ptt
596  * @param vfs_to_ack - bit mask of all engine VFs for which the PF acks.
597  *
598  * @param return int - 0 upon success.
599  */
600 int qed_mcp_ack_vf_flr(struct qed_hwfn *p_hwfn,
601 		       struct qed_ptt *p_ptt, u32 *vfs_to_ack);
602 
603 /**
604  * @brief - calls during init to read shmem of all function-related info.
605  *
606  * @param p_hwfn
607  *
608  * @param return 0 upon success.
609  */
610 int qed_mcp_fill_shmem_func_info(struct qed_hwfn *p_hwfn,
611 				 struct qed_ptt *p_ptt);
612 
613 /**
614  * @brief - Reset the MCP using mailbox command.
615  *
616  * @param p_hwfn
617  * @param p_ptt
618  *
619  * @param return 0 upon success.
620  */
621 int qed_mcp_reset(struct qed_hwfn *p_hwfn,
622 		  struct qed_ptt *p_ptt);
623 
624 /**
625  * @brief - Sends an NVM read command request to the MFW to get
626  *        a buffer.
627  *
628  * @param p_hwfn
629  * @param p_ptt
630  * @param cmd - Command: DRV_MSG_CODE_NVM_GET_FILE_DATA or
631  *            DRV_MSG_CODE_NVM_READ_NVRAM commands
632  * @param param - [0:23] - Offset [24:31] - Size
633  * @param o_mcp_resp - MCP response
634  * @param o_mcp_param - MCP response param
635  * @param o_txn_size -  Buffer size output
636  * @param o_buf - Pointer to the buffer returned by the MFW.
637  *
638  * @param return 0 upon success.
639  */
640 int qed_mcp_nvm_rd_cmd(struct qed_hwfn *p_hwfn,
641 		       struct qed_ptt *p_ptt,
642 		       u32 cmd,
643 		       u32 param,
644 		       u32 *o_mcp_resp,
645 		       u32 *o_mcp_param, u32 *o_txn_size, u32 *o_buf);
646 
647 /**
648  * @brief indicates whether the MFW objects [under mcp_info] are accessible
649  *
650  * @param p_hwfn
651  *
652  * @return true iff MFW is running and mcp_info is initialized
653  */
654 bool qed_mcp_is_init(struct qed_hwfn *p_hwfn);
655 
656 /**
657  * @brief request MFW to configure MSI-X for a VF
658  *
659  * @param p_hwfn
660  * @param p_ptt
661  * @param vf_id - absolute inside engine
662  * @param num_sbs - number of entries to request
663  *
664  * @return int
665  */
666 int qed_mcp_config_vf_msix(struct qed_hwfn *p_hwfn,
667 			   struct qed_ptt *p_ptt, u8 vf_id, u8 num);
668 
669 /**
670  * @brief - Halt the MCP.
671  *
672  * @param p_hwfn
673  * @param p_ptt
674  *
675  * @param return 0 upon success.
676  */
677 int qed_mcp_halt(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
678 
679 /**
680  * @brief - Wake up the MCP.
681  *
682  * @param p_hwfn
683  * @param p_ptt
684  *
685  * @param return 0 upon success.
686  */
687 int qed_mcp_resume(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
688 
689 int qed_configure_pf_min_bandwidth(struct qed_dev *cdev, u8 min_bw);
690 int qed_configure_pf_max_bandwidth(struct qed_dev *cdev, u8 max_bw);
691 int __qed_configure_pf_max_bandwidth(struct qed_hwfn *p_hwfn,
692 				     struct qed_ptt *p_ptt,
693 				     struct qed_mcp_link_state *p_link,
694 				     u8 max_bw);
695 int __qed_configure_pf_min_bandwidth(struct qed_hwfn *p_hwfn,
696 				     struct qed_ptt *p_ptt,
697 				     struct qed_mcp_link_state *p_link,
698 				     u8 min_bw);
699 
700 int qed_mcp_mask_parities(struct qed_hwfn *p_hwfn,
701 			  struct qed_ptt *p_ptt, u32 mask_parities);
702 
703 /**
704  * @brief Send eswitch mode to MFW
705  *
706  *  @param p_hwfn
707  *  @param p_ptt
708  *  @param eswitch - eswitch mode
709  *
710  * @return int - 0 - operation was successful.
711  */
712 int qed_mcp_ov_update_eswitch(struct qed_hwfn *p_hwfn,
713 			      struct qed_ptt *p_ptt,
714 			      enum qed_ov_eswitch eswitch);
715 
716 /**
717  * @brief - Gets the MFW allocation info for the given resource
718  *
719  *  @param p_hwfn
720  *  @param p_ptt
721  *  @param p_resc_info - descriptor of requested resource
722  *  @param p_mcp_resp
723  *  @param p_mcp_param
724  *
725  * @return int - 0 - operation was successful.
726  */
727 int qed_mcp_get_resc_info(struct qed_hwfn *p_hwfn,
728 			  struct qed_ptt *p_ptt,
729 			  struct resource_info *p_resc_info,
730 			  u32 *p_mcp_resp, u32 *p_mcp_param);
731 #endif
732