2 * Copyright (c) 2017-2018 Cavium, Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.
31 #ifndef __ECORE_MCP_API_H__
32 #define __ECORE_MCP_API_H__
34 #include "ecore_status.h"
36 struct ecore_mcp_link_speed_params {
38 u32 advertised_speeds; /* bitmask of DRV_SPEED_CAPABILITY */
39 u32 forced_speed; /* In Mb/s */
42 struct ecore_mcp_link_pause_params {
48 enum ecore_mcp_eee_mode {
49 ECORE_MCP_EEE_DISABLED,
50 ECORE_MCP_EEE_ENABLED,
51 ECORE_MCP_EEE_UNSUPPORTED
54 struct ecore_link_eee_params {
56 #define ECORE_EEE_1G_ADV (1 << 0)
57 #define ECORE_EEE_10G_ADV (1 << 1)
58 /* Capabilities are represented using ECORE_EEE_*_ADV values */
65 struct ecore_mcp_link_params {
66 struct ecore_mcp_link_speed_params speed;
67 struct ecore_mcp_link_pause_params pause;
68 u32 loopback_mode; /* in PMM_LOOPBACK values */
69 struct ecore_link_eee_params eee;
72 struct ecore_mcp_link_capabilities {
73 u32 speed_capabilities;
74 bool default_speed_autoneg; /* In Mb/s */
75 u32 default_speed; /* In Mb/s */
76 enum ecore_mcp_eee_mode default_eee;
80 struct ecore_mcp_link_state {
83 u32 line_speed; /* In Mb/s */
84 u32 min_pf_rate; /* In Mb/s */
85 u32 speed; /* In Mb/s */
90 bool parallel_detection;
93 #define ECORE_LINK_PARTNER_SPEED_1G_HD (1 << 0)
94 #define ECORE_LINK_PARTNER_SPEED_1G_FD (1 << 1)
95 #define ECORE_LINK_PARTNER_SPEED_10G (1 << 2)
96 #define ECORE_LINK_PARTNER_SPEED_20G (1 << 3)
97 #define ECORE_LINK_PARTNER_SPEED_25G (1 << 4)
98 #define ECORE_LINK_PARTNER_SPEED_40G (1 << 5)
99 #define ECORE_LINK_PARTNER_SPEED_50G (1 << 6)
100 #define ECORE_LINK_PARTNER_SPEED_100G (1 << 7)
101 u32 partner_adv_speed;
103 bool partner_tx_flow_ctrl_en;
104 bool partner_rx_flow_ctrl_en;
106 #define ECORE_LINK_PARTNER_SYMMETRIC_PAUSE (1)
107 #define ECORE_LINK_PARTNER_ASYMMETRIC_PAUSE (2)
108 #define ECORE_LINK_PARTNER_BOTH_PAUSE (3)
109 u8 partner_adv_pause;
118 struct ecore_mcp_function_info {
121 enum ecore_pci_personality protocol;
131 #define ECORE_MCP_VLAN_UNSET (0xffff)
137 struct ecore_mcp_nvm_common {
144 struct ecore_mcp_nvm_rd {
149 struct ecore_mcp_nvm_wr {
154 struct ecore_mcp_nvm_params {
155 #define ECORE_MCP_CMD (1 << 0)
156 #define ECORE_MCP_NVM_RD (1 << 1)
157 #define ECORE_MCP_NVM_WR (1 << 2)
160 struct ecore_mcp_nvm_common nvm_common;
163 struct ecore_mcp_nvm_rd nvm_rd;
164 struct ecore_mcp_nvm_wr nvm_wr;
168 enum ecore_nvm_images {
169 ECORE_NVM_IMAGE_ISCSI_CFG,
170 ECORE_NVM_IMAGE_FCOE_CFG,
171 ECORE_NVM_IMAGE_MDUMP,
174 struct ecore_mcp_drv_version {
176 u8 name[MCP_DRV_VER_STR_SIZE - 4];
179 struct ecore_mcp_lan_stats {
185 #ifndef ECORE_PROTO_STATS
186 #define ECORE_PROTO_STATS
187 struct ecore_mcp_fcoe_stats {
194 struct ecore_mcp_iscsi_stats {
201 struct ecore_mcp_rdma_stats {
208 enum ecore_mcp_protocol_type {
210 ECORE_MCP_FCOE_STATS,
211 ECORE_MCP_ISCSI_STATS,
215 union ecore_mcp_protocol_stats {
216 struct ecore_mcp_lan_stats lan_stats;
217 struct ecore_mcp_fcoe_stats fcoe_stats;
218 struct ecore_mcp_iscsi_stats iscsi_stats;
219 struct ecore_mcp_rdma_stats rdma_stats;
223 enum ecore_ov_client {
225 ECORE_OV_CLIENT_USER,
226 ECORE_OV_CLIENT_VENDOR_SPEC
229 enum ecore_ov_driver_state {
230 ECORE_OV_DRIVER_STATE_NOT_LOADED,
231 ECORE_OV_DRIVER_STATE_DISABLED,
232 ECORE_OV_DRIVER_STATE_ACTIVE
236 ECORE_OV_WOL_DEFAULT,
237 ECORE_OV_WOL_DISABLED,
241 #define ECORE_MAX_NPIV_ENTRIES 128
242 #define ECORE_WWN_SIZE 8
243 struct ecore_fc_npiv_tbl {
246 u8 wwpn[ECORE_MAX_NPIV_ENTRIES][ECORE_WWN_SIZE];
247 u8 wwnn[ECORE_MAX_NPIV_ENTRIES][ECORE_WWN_SIZE];
250 enum ecore_led_mode {
253 ECORE_LED_MODE_RESTORE
256 struct ecore_temperature_sensor {
263 #define ECORE_MAX_NUM_OF_SENSORS 7
264 struct ecore_temperature_info {
266 struct ecore_temperature_sensor sensors[ECORE_MAX_NUM_OF_SENSORS];
269 enum ecore_mba_img_idx {
270 ECORE_MBA_LEGACY_IDX,
271 ECORE_MBA_PCI3CLP_IDX,
278 ECORE_MAX_NUM_OF_ROMIMG
281 struct ecore_mba_vers {
282 u32 mba_vers[ECORE_MAX_NUM_OF_ROMIMG];
285 enum ecore_mfw_tlv_type {
286 ECORE_MFW_TLV_GENERIC = 0x1, /* Core driver TLVs */
287 ECORE_MFW_TLV_ETH = 0x2, /* L2 driver TLVs */
288 ECORE_MFW_TLV_FCOE = 0x4, /* FCoE protocol TLVs */
289 ECORE_MFW_TLV_ISCSI = 0x8, /* SCSI protocol TLVs */
290 ECORE_MFW_TLV_MAX = 0x16,
293 struct ecore_mfw_tlv_generic {
295 u8 ipv4_csum_offload;
300 #define ECORE_MFW_TLV_MAC_COUNT 3
301 /* First entry for primary MAC, 2 secondary MACs possible */
302 u8 mac[ECORE_MFW_TLV_MAC_COUNT][6];
303 bool mac_set[ECORE_MFW_TLV_MAC_COUNT];
315 struct ecore_mfw_tlv_eth {
317 bool lso_maxoff_size_set;
319 bool lso_minseg_size_set;
323 bool tx_descr_size_set;
325 bool rx_descr_size_set;
329 bool tcp4_offloads_set;
331 bool tcp6_offloads_set;
333 bool tx_descr_qdepth_set;
335 bool rx_descr_qdepth_set;
337 #define ECORE_MFW_TLV_IOV_OFFLOAD_NONE (0)
338 #define ECORE_MFW_TLV_IOV_OFFLOAD_MULTIQUEUE (1)
339 #define ECORE_MFW_TLV_IOV_OFFLOAD_VEB (2)
340 #define ECORE_MFW_TLV_IOV_OFFLOAD_VEPA (3)
341 bool iov_offload_set;
347 bool num_txqs_full_set;
349 bool num_rxqs_full_set;
352 struct ecore_mfw_tlv_time {
362 struct ecore_mfw_tlv_fcoe {
364 bool scsi_timeout_set;
378 bool num_npiv_ids_set;
380 bool switch_name_set;
382 bool switch_portnum_set;
384 bool switch_portid_set;
386 bool vendor_name_set;
388 bool switch_model_set;
389 u8 switch_fw_version[8];
390 bool switch_fw_version_set;
396 #define ECORE_MFW_TLV_PORT_STATE_OFFLINE (0)
397 #define ECORE_MFW_TLV_PORT_STATE_LOOP (1)
398 #define ECORE_MFW_TLV_PORT_STATE_P2P (2)
399 #define ECORE_MFW_TLV_PORT_STATE_FABRIC (3)
401 u16 fip_tx_descr_size;
402 bool fip_tx_descr_size_set;
403 u16 fip_rx_descr_size;
404 bool fip_rx_descr_size_set;
406 bool link_failures_set;
407 u8 fcoe_boot_progress;
408 bool fcoe_boot_progress_set;
414 bool fcoe_txq_depth_set;
416 bool fcoe_rxq_depth_set;
418 bool fcoe_rx_frames_set;
420 bool fcoe_rx_bytes_set;
422 bool fcoe_tx_frames_set;
424 bool fcoe_tx_bytes_set;
427 u32 crc_err_src_fcid[5];
428 bool crc_err_src_fcid_set[5];
429 struct ecore_mfw_tlv_time crc_err[5];
435 bool primtive_err_set;
437 bool disparity_err_set;
438 u16 code_violation_err;
439 bool code_violation_err_set;
441 bool flogi_param_set[4];
442 struct ecore_mfw_tlv_time flogi_tstamp;
443 u32 flogi_acc_param[4];
444 bool flogi_acc_param_set[4];
445 struct ecore_mfw_tlv_time flogi_acc_tstamp;
448 struct ecore_mfw_tlv_time flogi_rjt_tstamp;
461 u32 plogi_dst_fcid[5];
462 bool plogi_dst_fcid_set[5];
463 struct ecore_mfw_tlv_time plogi_tstamp[5];
464 u32 plogi_acc_src_fcid[5];
465 bool plogi_acc_src_fcid_set[5];
466 struct ecore_mfw_tlv_time plogi_acc_tstamp[5];
473 u32 plogo_src_fcid[5];
474 bool plogo_src_fcid_set[5];
475 struct ecore_mfw_tlv_time plogo_tstamp[5];
487 bool rx_abts_acc_set;
489 bool rx_abts_rjt_set;
490 u32 abts_dst_fcid[5];
491 bool abts_dst_fcid_set[5];
492 struct ecore_mfw_tlv_time abts_tstamp[5];
495 u32 rx_rscn_nport[4];
496 bool rx_rscn_nport_set[4];
500 bool abort_task_sets_set;
524 bool scsi_cond_met_set;
529 u8 scsi_inter_cond_met;
530 bool scsi_inter_cond_met_set;
531 u8 scsi_rsv_conflicts;
532 bool scsi_rsv_conflicts_set;
534 bool scsi_tsk_full_set;
536 bool scsi_aca_active_set;
538 bool scsi_tsk_abort_set;
540 bool scsi_rx_chk_set[5];
541 struct ecore_mfw_tlv_time scsi_chk_tstamp[5];
544 struct ecore_mfw_tlv_iscsi {
546 bool target_llmnr_set;
548 bool header_digest_set;
550 bool data_digest_set;
552 #define ECORE_MFW_TLV_AUTH_METHOD_NONE (1)
553 #define ECORE_MFW_TLV_AUTH_METHOD_CHAP (2)
554 #define ECORE_MFW_TLV_AUTH_METHOD_MUTUAL_CHAP (3)
555 bool auth_method_set;
556 u16 boot_taget_portal;
557 bool boot_taget_portal_set;
561 bool tx_desc_size_set;
563 bool rx_desc_size_set;
565 bool boot_progress_set;
567 bool tx_desc_qdepth_set;
569 bool rx_desc_qdepth_set;
580 union ecore_mfw_tlv_data {
581 struct ecore_mfw_tlv_generic generic;
582 struct ecore_mfw_tlv_eth eth;
583 struct ecore_mfw_tlv_fcoe fcoe;
584 struct ecore_mfw_tlv_iscsi iscsi;
587 enum ecore_hw_info_change {
588 ECORE_HW_INFO_CHANGE_OVLAN,
592 * @brief - returns the link params of the hw function
596 * @returns pointer to link params
598 struct ecore_mcp_link_params *ecore_mcp_get_link_params(struct ecore_hwfn*);
601 * @brief - return the link state of the hw function
605 * @returns pointer to link state
607 struct ecore_mcp_link_state *ecore_mcp_get_link_state(struct ecore_hwfn*);
610 * @brief - return the link capabilities of the hw function
614 * @returns pointer to link capabilities
616 struct ecore_mcp_link_capabilities
617 *ecore_mcp_get_link_capabilities(struct ecore_hwfn *p_hwfn);
620 * @brief Request the MFW to set the the link according to 'link_input'.
624 * @param b_up - raise link if `true'. Reset link if `false'.
626 * @return enum _ecore_status_t
628 enum _ecore_status_t ecore_mcp_set_link(struct ecore_hwfn *p_hwfn,
629 struct ecore_ptt *p_ptt,
633 * @brief Get the management firmware version value
637 * @param p_mfw_ver - mfw version value
638 * @param p_running_bundle_id - image id in nvram; Optional.
640 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
642 enum _ecore_status_t ecore_mcp_get_mfw_ver(struct ecore_hwfn *p_hwfn,
643 struct ecore_ptt *p_ptt,
645 u32 *p_running_bundle_id);
648 * @brief Get the MBI version value
652 * @param p_mbi_ver - A pointer to a variable to be filled with the MBI version.
654 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
656 enum _ecore_status_t ecore_mcp_get_mbi_ver(struct ecore_hwfn *p_hwfn,
657 struct ecore_ptt *p_ptt,
661 * @brief Get media type value of the port.
663 * @param p_dev - ecore dev pointer
664 * @param mfw_ver - media type value
666 * @return enum _ecore_status_t -
667 * ECORE_SUCCESS - Operation was successful.
668 * ECORE_BUSY - Operation failed
670 enum _ecore_status_t ecore_mcp_get_media_type(struct ecore_dev *p_dev,
674 * @brief - Sends a command to the MCP mailbox.
676 * @param p_hwfn - hw function
677 * @param p_ptt - PTT required for register access
678 * @param cmd - command to be sent to the MCP
679 * @param param - optional param
680 * @param o_mcp_resp - the MCP response code (exclude sequence)
681 * @param o_mcp_param - optional parameter provided by the MCP response
683 * @return enum _ecore_status_t -
684 * ECORE_SUCCESS - operation was successful
685 * ECORE_BUSY - operation failed
687 enum _ecore_status_t ecore_mcp_cmd(struct ecore_hwfn *p_hwfn,
688 struct ecore_ptt *p_ptt, u32 cmd, u32 param,
689 u32 *o_mcp_resp, u32 *o_mcp_param);
692 * @brief - drains the nig, allowing completion to pass in case of pauses.
693 * (Should be called only from sleepable context)
698 enum _ecore_status_t ecore_mcp_drain(struct ecore_hwfn *p_hwfn,
699 struct ecore_ptt *p_ptt);
702 * @brief - return the mcp function info of the hw function
706 * @returns pointer to mcp function info
708 const struct ecore_mcp_function_info
709 *ecore_mcp_get_function_info(struct ecore_hwfn *p_hwfn);
712 * @brief - Function for reading/manipulating the nvram. Following are supported
714 * 1. Read: Read the specified nvram offset.
716 * type - ECORE_MCP_NVM_RD
717 * cmd - command code (e.g. DRV_MSG_CODE_NVM_READ_NVRAM)
718 * offset - nvm offset
722 * buf_size - buffer size
724 * 2. Write: Write the data at the specified nvram offset
726 * type - ECORE_MCP_NVM_WR
727 * cmd - command code (e.g. DRV_MSG_CODE_NVM_WRITE_NVRAM)
728 * offset - nvm offset
730 * buf_size - buffer size
732 * 3. Command: Send the NVM command to MCP.
734 * type - ECORE_MCP_CMD
735 * cmd - command code (e.g. DRV_MSG_CODE_NVM_DEL_FILE)
736 * offset - nvm offset
743 * @return ECORE_SUCCESS - operation was successful.
745 enum _ecore_status_t ecore_mcp_nvm_command(struct ecore_hwfn *p_hwfn,
746 struct ecore_ptt *p_ptt,
747 struct ecore_mcp_nvm_params *params);
750 * @brief - count number of function with a matching personality on engine.
754 * @param personalities - a bitmask of ecore_pci_personality values
756 * @returns the count of all devices on engine whose personality match one of
759 int ecore_mcp_get_personality_cnt(struct ecore_hwfn *p_hwfn,
760 struct ecore_ptt *p_ptt,
764 * @brief Get the flash size value
768 * @param p_flash_size - flash size in bytes to be filled.
770 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
772 enum _ecore_status_t ecore_mcp_get_flash_size(struct ecore_hwfn *p_hwfn,
773 struct ecore_ptt *p_ptt,
777 * @brief Send driver version to MFW
781 * @param version - Version value
782 * @param name - Protocol driver name
784 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
787 ecore_mcp_send_drv_version(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
788 struct ecore_mcp_drv_version *p_ver);
791 * @brief Read the MFW process kill counter
798 u32 ecore_get_process_kill_counter(struct ecore_hwfn *p_hwfn,
799 struct ecore_ptt *p_ptt);
802 * @brief Trigger a recovery process
807 * @return enum _ecore_status_t
809 enum _ecore_status_t ecore_start_recovery_process(struct ecore_hwfn *p_hwfn,
810 struct ecore_ptt *p_ptt);
813 * @brief Notify MFW about the change in base device properties
817 * @param client - ecore client type
819 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
822 ecore_mcp_ov_update_current_config(struct ecore_hwfn *p_hwfn,
823 struct ecore_ptt *p_ptt,
824 enum ecore_ov_client client);
827 * @brief Notify MFW about the driver state
831 * @param drv_state - Driver state
833 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
836 ecore_mcp_ov_update_driver_state(struct ecore_hwfn *p_hwfn,
837 struct ecore_ptt *p_ptt,
838 enum ecore_ov_driver_state drv_state);
841 * @brief Read NPIV settings form the MFW
845 * @param p_table - Array to hold the FC NPIV data. Client need allocate the
846 * required buffer. The field 'count' specifies number of NPIV
847 * entries. A value of 0 means the table was not populated.
849 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
852 ecore_mcp_ov_get_fc_npiv(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
853 struct ecore_fc_npiv_tbl *p_table);
856 * @brief Send MTU size to MFW
860 * @param mtu - MTU size
862 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
864 enum _ecore_status_t ecore_mcp_ov_update_mtu(struct ecore_hwfn *p_hwfn,
865 struct ecore_ptt *p_ptt, u16 mtu);
868 * @brief Send MAC address to MFW
872 * @param mac - MAC address
874 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
877 ecore_mcp_ov_update_mac(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
881 * @brief Send WOL mode to MFW
885 * @param wol - WOL mode
887 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
890 ecore_mcp_ov_update_wol(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
891 enum ecore_ov_wol wol);
894 * @brief Set LED status
898 * @param mode - LED mode
900 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
902 enum _ecore_status_t ecore_mcp_set_led(struct ecore_hwfn *p_hwfn,
903 struct ecore_ptt *p_ptt,
904 enum ecore_led_mode mode);
907 * @brief Set secure mode
910 * @param addr - nvm offset
912 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
914 enum _ecore_status_t ecore_mcp_nvm_set_secure_mode(struct ecore_dev *p_dev,
918 * @brief Write to phy
921 * @param addr - nvm offset
922 * @param cmd - nvm command
923 * @param p_buf - nvm write buffer
924 * @param len - buffer len
926 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
928 enum _ecore_status_t ecore_mcp_phy_write(struct ecore_dev *p_dev, u32 cmd,
929 u32 addr, u8 *p_buf, u32 len);
932 * @brief Write to nvm
935 * @param addr - nvm offset
936 * @param cmd - nvm command
937 * @param p_buf - nvm write buffer
938 * @param len - buffer len
940 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
942 enum _ecore_status_t ecore_mcp_nvm_write(struct ecore_dev *p_dev, u32 cmd,
943 u32 addr, u8 *p_buf, u32 len);
946 * @brief Put file begin
949 * @param addr - nvm offset
951 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
953 enum _ecore_status_t ecore_mcp_nvm_put_file_begin(struct ecore_dev *p_dev,
960 * @param addr - nvm offset
962 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
964 enum _ecore_status_t ecore_mcp_nvm_del_file(struct ecore_dev *p_dev,
968 * @brief Check latest response
971 * @param p_buf - nvm write buffer
973 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
975 enum _ecore_status_t ecore_mcp_nvm_resp(struct ecore_dev *p_dev, u8 *p_buf);
978 * @brief Read from phy
981 * @param addr - nvm offset
982 * @param cmd - nvm command
983 * @param p_buf - nvm write buffer
984 * @param len - buffer len
986 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
988 enum _ecore_status_t ecore_mcp_phy_read(struct ecore_dev *p_dev, u32 cmd,
989 u32 addr, u8 *p_buf, u32 len);
992 * @brief Read from nvm
995 * @param addr - nvm offset
996 * @param p_buf - nvm write buffer
997 * @param len - buffer len
999 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1001 enum _ecore_status_t ecore_mcp_nvm_read(struct ecore_dev *p_dev, u32 addr,
1002 u8 *p_buf, u32 len);
1004 struct ecore_nvm_image_att {
1010 * @brief Allows reading a whole nvram image
1014 * @param image_id - image to get attributes for
1015 * @param p_image_att - image attributes structure into which to fill data
1017 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1019 enum _ecore_status_t
1020 ecore_mcp_get_nvm_image_att(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
1021 enum ecore_nvm_images image_id,
1022 struct ecore_nvm_image_att *p_image_att);
1025 * @brief Allows reading a whole nvram image
1029 * @param image_id - image requested for reading
1030 * @param p_buffer - allocated buffer into which to fill data
1031 * @param buffer_len - length of the allocated buffer.
1033 * @return ECORE_SUCCESS iff p_buffer now contains the nvram image.
1035 enum _ecore_status_t ecore_mcp_get_nvm_image(struct ecore_hwfn *p_hwfn,
1036 struct ecore_ptt *p_ptt,
1037 enum ecore_nvm_images image_id,
1038 u8 *p_buffer, u32 buffer_len);
1041 * @brief Read from sfp
1043 * @param p_hwfn - hw function
1044 * @param p_ptt - PTT required for register access
1045 * @param port - transceiver port
1046 * @param addr - I2C address
1047 * @param offset - offset in sfp
1048 * @param len - buffer length
1049 * @param p_buf - buffer to read into
1051 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1053 enum _ecore_status_t ecore_mcp_phy_sfp_read(struct ecore_hwfn *p_hwfn,
1054 struct ecore_ptt *p_ptt,
1055 u32 port, u32 addr, u32 offset,
1056 u32 len, u8 *p_buf);
1059 * @brief Write to sfp
1061 * @param p_hwfn - hw function
1062 * @param p_ptt - PTT required for register access
1063 * @param port - transceiver port
1064 * @param addr - I2C address
1065 * @param offset - offset in sfp
1066 * @param len - buffer length
1067 * @param p_buf - buffer to write from
1069 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1071 enum _ecore_status_t ecore_mcp_phy_sfp_write(struct ecore_hwfn *p_hwfn,
1072 struct ecore_ptt *p_ptt,
1073 u32 port, u32 addr, u32 offset,
1074 u32 len, u8 *p_buf);
1079 * @param p_hwfn - hw function
1080 * @param p_ptt - PTT required for register access
1081 * @param gpio - gpio number
1082 * @param gpio_val - value read from gpio
1084 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1086 enum _ecore_status_t ecore_mcp_gpio_read(struct ecore_hwfn *p_hwfn,
1087 struct ecore_ptt *p_ptt,
1088 u16 gpio, u32 *gpio_val);
1093 * @param p_hwfn - hw function
1094 * @param p_ptt - PTT required for register access
1095 * @param gpio - gpio number
1096 * @param gpio_val - value to write to gpio
1098 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1100 enum _ecore_status_t ecore_mcp_gpio_write(struct ecore_hwfn *p_hwfn,
1101 struct ecore_ptt *p_ptt,
1102 u16 gpio, u16 gpio_val);
1105 * @brief Gpio get information
1107 * @param p_hwfn - hw function
1108 * @param p_ptt - PTT required for register access
1109 * @param gpio - gpio number
1110 * @param gpio_direction - gpio is output (0) or input (1)
1111 * @param gpio_ctrl - gpio control is uninitialized (0),
1112 * path 0 (1), path 1 (2) or shared(3)
1114 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1116 enum _ecore_status_t ecore_mcp_gpio_info(struct ecore_hwfn *p_hwfn,
1117 struct ecore_ptt *p_ptt,
1118 u16 gpio, u32 *gpio_direction,
1122 * @brief Bist register test
1124 * @param p_hwfn - hw function
1125 * @param p_ptt - PTT required for register access
1127 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1129 enum _ecore_status_t ecore_mcp_bist_register_test(struct ecore_hwfn *p_hwfn,
1130 struct ecore_ptt *p_ptt);
1133 * @brief Bist clock test
1135 * @param p_hwfn - hw function
1136 * @param p_ptt - PTT required for register access
1138 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1140 enum _ecore_status_t ecore_mcp_bist_clock_test(struct ecore_hwfn *p_hwfn,
1141 struct ecore_ptt *p_ptt);
1144 * @brief Bist nvm test - get number of images
1146 * @param p_hwfn - hw function
1147 * @param p_ptt - PTT required for register access
1148 * @param num_images - number of images if operation was
1149 * successful. 0 if not.
1151 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1153 enum _ecore_status_t ecore_mcp_bist_nvm_test_get_num_images(struct ecore_hwfn *p_hwfn,
1154 struct ecore_ptt *p_ptt,
1158 * @brief Bist nvm test - get image attributes by index
1160 * @param p_hwfn - hw function
1161 * @param p_ptt - PTT required for register access
1162 * @param p_image_att - Attributes of image
1163 * @param image_index - Index of image to get information for
1165 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1167 enum _ecore_status_t ecore_mcp_bist_nvm_test_get_image_att(struct ecore_hwfn *p_hwfn,
1168 struct ecore_ptt *p_ptt,
1169 struct bist_nvm_image_att *p_image_att,
1173 * @brief ecore_mcp_get_temperature_info - get the status of the temperature
1176 * @param p_hwfn - hw function
1177 * @param p_ptt - PTT required for register access
1178 * @param p_temp_status - A pointer to an ecore_temperature_info structure to
1179 * be filled with the temperature data
1181 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1183 enum _ecore_status_t
1184 ecore_mcp_get_temperature_info(struct ecore_hwfn *p_hwfn,
1185 struct ecore_ptt *p_ptt,
1186 struct ecore_temperature_info *p_temp_info);
1189 * @brief Get MBA versions - get MBA sub images versions
1191 * @param p_hwfn - hw function
1192 * @param p_ptt - PTT required for register access
1193 * @param p_mba_vers - MBA versions array to fill
1195 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1197 enum _ecore_status_t ecore_mcp_get_mba_versions(
1198 struct ecore_hwfn *p_hwfn,
1199 struct ecore_ptt *p_ptt,
1200 struct ecore_mba_vers *p_mba_vers);
1203 * @brief Count memory ecc events
1205 * @param p_hwfn - hw function
1206 * @param p_ptt - PTT required for register access
1207 * @param num_events - number of memory ecc events
1209 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1211 enum _ecore_status_t ecore_mcp_mem_ecc_events(struct ecore_hwfn *p_hwfn,
1212 struct ecore_ptt *p_ptt,
1215 struct ecore_mdump_info {
1225 * @brief - Gets the MFW crash dump configuration and logs info.
1229 * @param p_mdump_info
1231 * @param return ECORE_SUCCESS upon success.
1233 enum _ecore_status_t
1234 ecore_mcp_mdump_get_info(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
1235 struct ecore_mdump_info *p_mdump_info);
1238 * @brief - Clears the MFW crash dump logs.
1243 * @param return ECORE_SUCCESS upon success.
1245 enum _ecore_status_t ecore_mcp_mdump_clear_logs(struct ecore_hwfn *p_hwfn,
1246 struct ecore_ptt *p_ptt);
1249 * @brief - Gets the LLDP MAC address.
1253 * @param lldp_mac_addr - a buffer to be filled with the read LLDP MAC address.
1255 * @param return ECORE_SUCCESS upon success.
1257 enum _ecore_status_t ecore_mcp_get_lldp_mac(struct ecore_hwfn *p_hwfn,
1258 struct ecore_ptt *p_ptt,
1259 u8 lldp_mac_addr[ETH_ALEN]);
1262 * @brief - Sets the LLDP MAC address.
1266 * @param lldp_mac_addr - a buffer with the LLDP MAC address to be written.
1268 * @param return ECORE_SUCCESS upon success.
1270 enum _ecore_status_t ecore_mcp_set_lldp_mac(struct ecore_hwfn *p_hwfn,
1271 struct ecore_ptt *p_ptt,
1272 u8 lldp_mac_addr[ETH_ALEN]);
1275 * @brief - Processes the TLV request from MFW i.e., get the required TLV info
1276 * from the ecore client and send it to the MFW.
1281 * @param return ECORE_SUCCESS upon success.
1283 enum _ecore_status_t ecore_mfw_process_tlv_req(struct ecore_hwfn *p_hwfn,
1284 struct ecore_ptt *p_ptt);
1287 * @brief - Update fcoe vlan id value to the MFW.
1291 * @param vlan - fcoe vlan
1293 * @param return ECORE_SUCCESS upon success.
1295 enum _ecore_status_t
1296 ecore_mcp_update_fcoe_cvid(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
1300 * @brief - Update fabric name (wwn) value to the MFW.
1304 * @param wwn - world wide name
1306 * @param return ECORE_SUCCESS upon success.
1308 enum _ecore_status_t
1309 ecore_mcp_update_fcoe_fabric_name(struct ecore_hwfn *p_hwfn,
1310 struct ecore_ptt *p_ptt, u8 *wwn);