1 /* QLogic qed NIC Driver
2 * Copyright (c) 2015-2017 QLogic Corporation
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:
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
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.
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
36 #include <linux/types.h>
37 #include <linux/delay.h>
38 #include <linux/slab.h>
39 #include <linux/spinlock.h>
40 #include <linux/qed/qed_fcoe_if.h>
42 #include "qed_dev_api.h"
44 struct qed_mcp_link_speed_params {
46 u32 advertised_speeds; /* bitmask of DRV_SPEED_CAPABILITY */
47 u32 forced_speed; /* In Mb/s */
50 struct qed_mcp_link_pause_params {
56 enum qed_mcp_eee_mode {
59 QED_MCP_EEE_UNSUPPORTED
62 struct qed_mcp_link_params {
63 struct qed_mcp_link_speed_params speed;
64 struct qed_mcp_link_pause_params pause;
66 struct qed_link_eee_params eee;
69 struct qed_mcp_link_capabilities {
70 u32 speed_capabilities;
71 bool default_speed_autoneg;
72 enum qed_mcp_eee_mode default_eee;
77 struct qed_mcp_link_state {
82 /* Actual link speed in Mb/s */
85 /* PF max speed in Mb/s, deduced from line_speed
86 * according to PF max bandwidth configuration.
93 bool parallel_detection;
96 #define QED_LINK_PARTNER_SPEED_1G_HD BIT(0)
97 #define QED_LINK_PARTNER_SPEED_1G_FD BIT(1)
98 #define QED_LINK_PARTNER_SPEED_10G BIT(2)
99 #define QED_LINK_PARTNER_SPEED_20G BIT(3)
100 #define QED_LINK_PARTNER_SPEED_25G BIT(4)
101 #define QED_LINK_PARTNER_SPEED_40G BIT(5)
102 #define QED_LINK_PARTNER_SPEED_50G BIT(6)
103 #define QED_LINK_PARTNER_SPEED_100G BIT(7)
104 u32 partner_adv_speed;
106 bool partner_tx_flow_ctrl_en;
107 bool partner_rx_flow_ctrl_en;
109 #define QED_LINK_PARTNER_SYMMETRIC_PAUSE (1)
110 #define QED_LINK_PARTNER_ASYMMETRIC_PAUSE (2)
111 #define QED_LINK_PARTNER_BOTH_PAUSE (3)
112 u8 partner_adv_pause;
120 struct qed_mcp_function_info {
123 enum qed_pci_personality protocol;
133 #define QED_MCP_VLAN_UNSET (0xffff)
139 struct qed_mcp_nvm_common {
146 struct qed_mcp_drv_version {
148 u8 name[MCP_DRV_VER_STR_SIZE - 4];
151 struct qed_mcp_lan_stats {
157 struct qed_mcp_fcoe_stats {
164 struct qed_mcp_iscsi_stats {
171 struct qed_mcp_rdma_stats {
178 enum qed_mcp_protocol_type {
185 union qed_mcp_protocol_stats {
186 struct qed_mcp_lan_stats lan_stats;
187 struct qed_mcp_fcoe_stats fcoe_stats;
188 struct qed_mcp_iscsi_stats iscsi_stats;
189 struct qed_mcp_rdma_stats rdma_stats;
192 enum qed_ov_eswitch {
201 QED_OV_CLIENT_VENDOR_SPEC
204 enum qed_ov_driver_state {
205 QED_OV_DRIVER_STATE_NOT_LOADED,
206 QED_OV_DRIVER_STATE_DISABLED,
207 QED_OV_DRIVER_STATE_ACTIVE
216 enum qed_mfw_tlv_type {
217 QED_MFW_TLV_GENERIC = 0x1, /* Core driver TLVs */
218 QED_MFW_TLV_ETH = 0x2, /* L2 driver TLVs */
219 QED_MFW_TLV_FCOE = 0x4, /* FCoE protocol TLVs */
220 QED_MFW_TLV_MAX = 0x8,
223 struct qed_mfw_tlv_generic {
224 #define QED_MFW_TLV_FLAGS_SIZE 2
226 u8 ipv4_csum_offload;
231 #define QED_MFW_TLV_MAC_COUNT 3
232 /* First entry for primary MAC, 2 secondary MACs possible */
233 u8 mac[QED_MFW_TLV_MAC_COUNT][6];
234 bool mac_set[QED_MFW_TLV_MAC_COUNT];
246 union qed_mfw_tlv_data {
247 struct qed_mfw_tlv_generic generic;
248 struct qed_mfw_tlv_eth eth;
249 struct qed_mfw_tlv_fcoe fcoe;
253 * @brief - returns the link params of the hw function
257 * @returns pointer to link params
259 struct qed_mcp_link_params *qed_mcp_get_link_params(struct qed_hwfn *);
262 * @brief - return the link state of the hw function
266 * @returns pointer to link state
268 struct qed_mcp_link_state *qed_mcp_get_link_state(struct qed_hwfn *);
271 * @brief - return the link capabilities of the hw function
275 * @returns pointer to link capabilities
277 struct qed_mcp_link_capabilities
278 *qed_mcp_get_link_capabilities(struct qed_hwfn *p_hwfn);
281 * @brief Request the MFW to set the the link according to 'link_input'.
285 * @param b_up - raise link if `true'. Reset link if `false'.
289 int qed_mcp_set_link(struct qed_hwfn *p_hwfn,
290 struct qed_ptt *p_ptt,
294 * @brief Get the management firmware version value
298 * @param p_mfw_ver - mfw version value
299 * @param p_running_bundle_id - image id in nvram; Optional.
301 * @return int - 0 - operation was successful.
303 int qed_mcp_get_mfw_ver(struct qed_hwfn *p_hwfn,
304 struct qed_ptt *p_ptt,
305 u32 *p_mfw_ver, u32 *p_running_bundle_id);
308 * @brief Get the MBI version value
312 * @param p_mbi_ver - A pointer to a variable to be filled with the MBI version.
314 * @return int - 0 - operation was successful.
316 int qed_mcp_get_mbi_ver(struct qed_hwfn *p_hwfn,
317 struct qed_ptt *p_ptt, u32 *p_mbi_ver);
320 * @brief Get media type value of the port.
322 * @param cdev - qed dev pointer
323 * @param mfw_ver - media type value
326 * 0 - Operation was successul.
327 * -EBUSY - Operation failed
329 int qed_mcp_get_media_type(struct qed_dev *cdev,
333 * @brief General function for sending commands to the MCP
334 * mailbox. It acquire mutex lock for the entire
335 * operation, from sending the request until the MCP
336 * response. Waiting for MCP response will be checked up
337 * to 5 seconds every 5ms.
339 * @param p_hwfn - hw function
340 * @param p_ptt - PTT required for register access
341 * @param cmd - command to be sent to the MCP.
342 * @param param - Optional param
343 * @param o_mcp_resp - The MCP response code (exclude sequence).
344 * @param o_mcp_param- Optional parameter provided by the MCP
346 * @return int - 0 - operation
349 int qed_mcp_cmd(struct qed_hwfn *p_hwfn,
350 struct qed_ptt *p_ptt,
357 * @brief - drains the nig, allowing completion to pass in case of pauses.
358 * (Should be called only from sleepable context)
363 int qed_mcp_drain(struct qed_hwfn *p_hwfn,
364 struct qed_ptt *p_ptt);
367 * @brief Get the flash size value
371 * @param p_flash_size - flash size in bytes to be filled.
373 * @return int - 0 - operation was successul.
375 int qed_mcp_get_flash_size(struct qed_hwfn *p_hwfn,
376 struct qed_ptt *p_ptt,
380 * @brief Send driver version to MFW
384 * @param version - Version value
385 * @param name - Protocol driver name
387 * @return int - 0 - operation was successul.
390 qed_mcp_send_drv_version(struct qed_hwfn *p_hwfn,
391 struct qed_ptt *p_ptt,
392 struct qed_mcp_drv_version *p_ver);
395 * @brief Notify MFW about the change in base device properties
399 * @param client - qed client type
401 * @return int - 0 - operation was successful.
403 int qed_mcp_ov_update_current_config(struct qed_hwfn *p_hwfn,
404 struct qed_ptt *p_ptt,
405 enum qed_ov_client client);
408 * @brief Notify MFW about the driver state
412 * @param drv_state - Driver state
414 * @return int - 0 - operation was successful.
416 int qed_mcp_ov_update_driver_state(struct qed_hwfn *p_hwfn,
417 struct qed_ptt *p_ptt,
418 enum qed_ov_driver_state drv_state);
421 * @brief Send MTU size to MFW
425 * @param mtu - MTU size
427 * @return int - 0 - operation was successful.
429 int qed_mcp_ov_update_mtu(struct qed_hwfn *p_hwfn,
430 struct qed_ptt *p_ptt, u16 mtu);
433 * @brief Send MAC address to MFW
437 * @param mac - MAC address
439 * @return int - 0 - operation was successful.
441 int qed_mcp_ov_update_mac(struct qed_hwfn *p_hwfn,
442 struct qed_ptt *p_ptt, u8 *mac);
445 * @brief Send WOL mode to MFW
449 * @param wol - WOL mode
451 * @return int - 0 - operation was successful.
453 int qed_mcp_ov_update_wol(struct qed_hwfn *p_hwfn,
454 struct qed_ptt *p_ptt,
455 enum qed_ov_wol wol);
458 * @brief Set LED status
462 * @param mode - LED mode
464 * @return int - 0 - operation was successful.
466 int qed_mcp_set_led(struct qed_hwfn *p_hwfn,
467 struct qed_ptt *p_ptt,
468 enum qed_led_mode mode);
471 * @brief Read from nvm
474 * @param addr - nvm offset
475 * @param p_buf - nvm read buffer
476 * @param len - buffer len
478 * @return int - 0 - operation was successful.
480 int qed_mcp_nvm_read(struct qed_dev *cdev, u32 addr, u8 *p_buf, u32 len);
483 * @brief Write to nvm
486 * @param addr - nvm offset
487 * @param cmd - nvm command
488 * @param p_buf - nvm write buffer
489 * @param len - buffer len
491 * @return int - 0 - operation was successful.
493 int qed_mcp_nvm_write(struct qed_dev *cdev,
494 u32 cmd, u32 addr, u8 *p_buf, u32 len);
497 * @brief Put file begin
500 * @param addr - nvm offset
502 * @return int - 0 - operation was successful.
504 int qed_mcp_nvm_put_file_begin(struct qed_dev *cdev, u32 addr);
507 * @brief Check latest response
510 * @param p_buf - nvm write buffer
512 * @return int - 0 - operation was successful.
514 int qed_mcp_nvm_resp(struct qed_dev *cdev, u8 *p_buf);
516 struct qed_nvm_image_att {
522 * @brief Allows reading a whole nvram image
525 * @param image_id - image to get attributes for
526 * @param p_image_att - image attributes structure into which to fill data
528 * @return int - 0 - operation was successful.
531 qed_mcp_get_nvm_image_att(struct qed_hwfn *p_hwfn,
532 enum qed_nvm_images image_id,
533 struct qed_nvm_image_att *p_image_att);
536 * @brief Allows reading a whole nvram image
539 * @param image_id - image requested for reading
540 * @param p_buffer - allocated buffer into which to fill data
541 * @param buffer_len - length of the allocated buffer.
543 * @return 0 iff p_buffer now contains the nvram image.
545 int qed_mcp_get_nvm_image(struct qed_hwfn *p_hwfn,
546 enum qed_nvm_images image_id,
547 u8 *p_buffer, u32 buffer_len);
550 * @brief Bist register test
552 * @param p_hwfn - hw function
553 * @param p_ptt - PTT required for register access
555 * @return int - 0 - operation was successful.
557 int qed_mcp_bist_register_test(struct qed_hwfn *p_hwfn,
558 struct qed_ptt *p_ptt);
561 * @brief Bist clock test
563 * @param p_hwfn - hw function
564 * @param p_ptt - PTT required for register access
566 * @return int - 0 - operation was successful.
568 int qed_mcp_bist_clock_test(struct qed_hwfn *p_hwfn,
569 struct qed_ptt *p_ptt);
572 * @brief Bist nvm test - get number of images
574 * @param p_hwfn - hw function
575 * @param p_ptt - PTT required for register access
576 * @param num_images - number of images if operation was
577 * successful. 0 if not.
579 * @return int - 0 - operation was successful.
581 int qed_mcp_bist_nvm_get_num_images(struct qed_hwfn *p_hwfn,
582 struct qed_ptt *p_ptt,
586 * @brief Bist nvm test - get image attributes by index
588 * @param p_hwfn - hw function
589 * @param p_ptt - PTT required for register access
590 * @param p_image_att - Attributes of image
591 * @param image_index - Index of image to get information for
593 * @return int - 0 - operation was successful.
595 int qed_mcp_bist_nvm_get_image_att(struct qed_hwfn *p_hwfn,
596 struct qed_ptt *p_ptt,
597 struct bist_nvm_image_att *p_image_att,
601 * @brief - Processes the TLV request from MFW i.e., get the required TLV info
602 * from the qed client and send it to the MFW.
607 * @param return 0 upon success.
609 int qed_mfw_process_tlv_req(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
611 /* Using hwfn number (and not pf_num) is required since in CMT mode,
612 * same pf_num may be used by two different hwfn
613 * TODO - this shouldn't really be in .h file, but until all fields
614 * required during hw-init will be placed in their correct place in shmem
615 * we need it in qed_dev.c [for readin the nvram reflection in shmem].
617 #define MCP_PF_ID_BY_REL(p_hwfn, rel_pfid) (QED_IS_BB((p_hwfn)->cdev) ? \
619 ((p_hwfn)->abs_pf_id & 1) << 3) : \
621 #define MCP_PF_ID(p_hwfn) MCP_PF_ID_BY_REL(p_hwfn, (p_hwfn)->rel_pf_id)
623 #define MFW_PORT(_p_hwfn) ((_p_hwfn)->abs_pf_id % \
624 ((_p_hwfn)->cdev->num_ports_in_engine * \
625 qed_device_num_engines((_p_hwfn)->cdev)))
627 struct qed_mcp_info {
628 /* List for mailbox commands which were sent and wait for a response */
629 struct list_head cmd_list;
631 /* Spinlock used for protecting the access to the mailbox commands list
632 * and the sending of the commands.
636 /* Spinlock used for syncing SW link-changes and link-changes
637 * originating from attention context.
639 spinlock_t link_lock;
640 bool block_mb_sending;
647 struct qed_mcp_link_params link_input;
648 struct qed_mcp_link_state link_output;
649 struct qed_mcp_link_capabilities link_capabilities;
650 struct qed_mcp_function_info func_info;
656 /* Capabilties negotiated with the MFW */
660 struct qed_mcp_mb_params {
671 struct qed_drv_tlv_hdr {
673 u8 tlv_length; /* In dwords - not including this header */
675 #define QED_DRV_TLV_FLAGS_CHANGED 0x01
680 * @brief Initialize the interface with the MCP
682 * @param p_hwfn - HW func
683 * @param p_ptt - PTT required for register access
687 int qed_mcp_cmd_init(struct qed_hwfn *p_hwfn,
688 struct qed_ptt *p_ptt);
691 * @brief Initialize the port interface with the MCP
695 * Can only be called after `num_ports_in_engines' is set
697 void qed_mcp_cmd_port_init(struct qed_hwfn *p_hwfn,
698 struct qed_ptt *p_ptt);
700 * @brief Releases resources allocated during the init process.
702 * @param p_hwfn - HW func
703 * @param p_ptt - PTT required for register access
708 int qed_mcp_free(struct qed_hwfn *p_hwfn);
711 * @brief This function is called from the DPC context. After
712 * pointing PTT to the mfw mb, check for events sent by the MCP
713 * to the driver and ack them. In case a critical event
714 * detected, it will be handled here, otherwise the work will be
715 * queued to a sleepable work-queue.
717 * @param p_hwfn - HW function
718 * @param p_ptt - PTT required for register access
719 * @return int - 0 - operation
722 int qed_mcp_handle_events(struct qed_hwfn *p_hwfn,
723 struct qed_ptt *p_ptt);
730 struct qed_load_req_params {
732 enum qed_drv_role drv_role;
734 bool avoid_eng_reset;
735 enum qed_override_force_load override_force_load;
742 * @brief Sends a LOAD_REQ to the MFW, and in case the operation succeeds,
743 * returns whether this PF is the first on the engine/port or function.
749 * @return int - 0 - Operation was successful.
751 int qed_mcp_load_req(struct qed_hwfn *p_hwfn,
752 struct qed_ptt *p_ptt,
753 struct qed_load_req_params *p_params);
756 * @brief Sends a UNLOAD_REQ message to the MFW
761 * @return int - 0 - Operation was successful.
763 int qed_mcp_unload_req(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
766 * @brief Sends a UNLOAD_DONE message to the MFW
771 * @return int - 0 - Operation was successful.
773 int qed_mcp_unload_done(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
776 * @brief Read the MFW mailbox into Current buffer.
781 void qed_mcp_read_mb(struct qed_hwfn *p_hwfn,
782 struct qed_ptt *p_ptt);
785 * @brief Ack to mfw that driver finished FLR process for VFs
789 * @param vfs_to_ack - bit mask of all engine VFs for which the PF acks.
791 * @param return int - 0 upon success.
793 int qed_mcp_ack_vf_flr(struct qed_hwfn *p_hwfn,
794 struct qed_ptt *p_ptt, u32 *vfs_to_ack);
797 * @brief - calls during init to read shmem of all function-related info.
801 * @param return 0 upon success.
803 int qed_mcp_fill_shmem_func_info(struct qed_hwfn *p_hwfn,
804 struct qed_ptt *p_ptt);
807 * @brief - Reset the MCP using mailbox command.
812 * @param return 0 upon success.
814 int qed_mcp_reset(struct qed_hwfn *p_hwfn,
815 struct qed_ptt *p_ptt);
818 * @brief - Sends an NVM read command request to the MFW to get
823 * @param cmd - Command: DRV_MSG_CODE_NVM_GET_FILE_DATA or
824 * DRV_MSG_CODE_NVM_READ_NVRAM commands
825 * @param param - [0:23] - Offset [24:31] - Size
826 * @param o_mcp_resp - MCP response
827 * @param o_mcp_param - MCP response param
828 * @param o_txn_size - Buffer size output
829 * @param o_buf - Pointer to the buffer returned by the MFW.
831 * @param return 0 upon success.
833 int qed_mcp_nvm_rd_cmd(struct qed_hwfn *p_hwfn,
834 struct qed_ptt *p_ptt,
838 u32 *o_mcp_param, u32 *o_txn_size, u32 *o_buf);
841 * @brief indicates whether the MFW objects [under mcp_info] are accessible
845 * @return true iff MFW is running and mcp_info is initialized
847 bool qed_mcp_is_init(struct qed_hwfn *p_hwfn);
850 * @brief request MFW to configure MSI-X for a VF
854 * @param vf_id - absolute inside engine
855 * @param num_sbs - number of entries to request
859 int qed_mcp_config_vf_msix(struct qed_hwfn *p_hwfn,
860 struct qed_ptt *p_ptt, u8 vf_id, u8 num);
863 * @brief - Halt the MCP.
868 * @param return 0 upon success.
870 int qed_mcp_halt(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
873 * @brief - Wake up the MCP.
878 * @param return 0 upon success.
880 int qed_mcp_resume(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
882 int qed_configure_pf_min_bandwidth(struct qed_dev *cdev, u8 min_bw);
883 int qed_configure_pf_max_bandwidth(struct qed_dev *cdev, u8 max_bw);
884 int __qed_configure_pf_max_bandwidth(struct qed_hwfn *p_hwfn,
885 struct qed_ptt *p_ptt,
886 struct qed_mcp_link_state *p_link,
888 int __qed_configure_pf_min_bandwidth(struct qed_hwfn *p_hwfn,
889 struct qed_ptt *p_ptt,
890 struct qed_mcp_link_state *p_link,
893 int qed_mcp_mask_parities(struct qed_hwfn *p_hwfn,
894 struct qed_ptt *p_ptt, u32 mask_parities);
897 * @brief - Sets the MFW's max value for the given resource
902 * @param resc_max_val
905 * @return int - 0 - operation was successful.
908 qed_mcp_set_resc_max_val(struct qed_hwfn *p_hwfn,
909 struct qed_ptt *p_ptt,
910 enum qed_resources res_id,
911 u32 resc_max_val, u32 *p_mcp_resp);
914 * @brief - Gets the MFW allocation info for the given resource
921 * @param p_resc_start
923 * @return int - 0 - operation was successful.
926 qed_mcp_get_resc_info(struct qed_hwfn *p_hwfn,
927 struct qed_ptt *p_ptt,
928 enum qed_resources res_id,
929 u32 *p_mcp_resp, u32 *p_resc_num, u32 *p_resc_start);
932 * @brief Send eswitch mode to MFW
936 * @param eswitch - eswitch mode
938 * @return int - 0 - operation was successful.
940 int qed_mcp_ov_update_eswitch(struct qed_hwfn *p_hwfn,
941 struct qed_ptt *p_ptt,
942 enum qed_ov_eswitch eswitch);
944 #define QED_MCP_RESC_LOCK_MIN_VAL RESOURCE_DUMP
945 #define QED_MCP_RESC_LOCK_MAX_VAL 31
948 QED_RESC_LOCK_DBG_DUMP = QED_MCP_RESC_LOCK_MIN_VAL,
949 QED_RESC_LOCK_PTP_PORT0,
950 QED_RESC_LOCK_PTP_PORT1,
951 QED_RESC_LOCK_PTP_PORT2,
952 QED_RESC_LOCK_PTP_PORT3,
953 QED_RESC_LOCK_RESC_ALLOC = QED_MCP_RESC_LOCK_MAX_VAL,
954 QED_RESC_LOCK_RESC_INVALID
958 * @brief - Initiates PF FLR
963 * @return int - 0 - operation was successful.
965 int qed_mcp_initiate_pf_flr(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
966 struct qed_resc_lock_params {
967 /* Resource number [valid values are 0..31] */
970 /* Lock timeout value in seconds [default, none or 1..254] */
972 #define QED_MCP_RESC_LOCK_TO_DEFAULT 0
973 #define QED_MCP_RESC_LOCK_TO_NONE 255
975 /* Number of times to retry locking */
977 #define QED_MCP_RESC_LOCK_RETRY_CNT_DFLT 10
979 /* The interval in usec between retries */
981 #define QED_MCP_RESC_LOCK_RETRY_VAL_DFLT 10000
983 /* Use sleep or delay between retries */
986 /* Will be set as true if the resource is free and granted */
989 /* Will be filled with the resource owner.
990 * [0..15 = PF0-15, 16 = MFW]
996 * @brief Acquires MFW generic resource lock
1002 * @return int - 0 - operation was successful.
1005 qed_mcp_resc_lock(struct qed_hwfn *p_hwfn,
1006 struct qed_ptt *p_ptt, struct qed_resc_lock_params *p_params);
1008 struct qed_resc_unlock_params {
1009 /* Resource number [valid values are 0..31] */
1012 /* Allow to release a resource even if belongs to another PF */
1015 /* Will be set as true if the resource is released */
1020 * @brief Releases MFW generic resource lock
1026 * @return int - 0 - operation was successful.
1029 qed_mcp_resc_unlock(struct qed_hwfn *p_hwfn,
1030 struct qed_ptt *p_ptt,
1031 struct qed_resc_unlock_params *p_params);
1034 * @brief - default initialization for lock/unlock resource structs
1036 * @param p_lock - lock params struct to be initialized; Can be NULL
1037 * @param p_unlock - unlock params struct to be initialized; Can be NULL
1038 * @param resource - the requested resource
1039 * @paral b_is_permanent - disable retries & aging when set
1041 void qed_mcp_resc_lock_default_init(struct qed_resc_lock_params *p_lock,
1042 struct qed_resc_unlock_params *p_unlock,
1044 resource, bool b_is_permanent);
1046 * @brief Learn of supported MFW features; To be done during early init
1051 int qed_mcp_get_capabilities(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
1054 * @brief Inform MFW of set of features supported by driver. Should be done
1055 * inside the content of the LOAD_REQ.
1060 int qed_mcp_set_capabilities(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
1063 * @brief Read ufp config from the shared memory.
1068 void qed_mcp_read_ufp_config(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
1071 * @brief Populate the nvm info shadow in the given hardware function
1075 int qed_mcp_nvm_info_populate(struct qed_hwfn *p_hwfn);