171d10453SEric Joyner /* SPDX-License-Identifier: BSD-3-Clause */ 2015f8cc5SEric Joyner /* Copyright (c) 2024, Intel Corporation 371d10453SEric Joyner * All rights reserved. 471d10453SEric Joyner * 571d10453SEric Joyner * Redistribution and use in source and binary forms, with or without 671d10453SEric Joyner * modification, are permitted provided that the following conditions are met: 771d10453SEric Joyner * 871d10453SEric Joyner * 1. Redistributions of source code must retain the above copyright notice, 971d10453SEric Joyner * this list of conditions and the following disclaimer. 1071d10453SEric Joyner * 1171d10453SEric Joyner * 2. Redistributions in binary form must reproduce the above copyright 1271d10453SEric Joyner * notice, this list of conditions and the following disclaimer in the 1371d10453SEric Joyner * documentation and/or other materials provided with the distribution. 1471d10453SEric Joyner * 1571d10453SEric Joyner * 3. Neither the name of the Intel Corporation nor the names of its 1671d10453SEric Joyner * contributors may be used to endorse or promote products derived from 1771d10453SEric Joyner * this software without specific prior written permission. 1871d10453SEric Joyner * 1971d10453SEric Joyner * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 2071d10453SEric Joyner * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2171d10453SEric Joyner * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2271d10453SEric Joyner * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 2371d10453SEric Joyner * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2471d10453SEric Joyner * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2571d10453SEric Joyner * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2671d10453SEric Joyner * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2771d10453SEric Joyner * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2871d10453SEric Joyner * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 2971d10453SEric Joyner * POSSIBILITY OF SUCH DAMAGE. 3071d10453SEric Joyner */ 3171d10453SEric Joyner 3271d10453SEric Joyner #ifndef _ICE_COMMON_H_ 3371d10453SEric Joyner #define _ICE_COMMON_H_ 3471d10453SEric Joyner 3571d10453SEric Joyner #include "ice_type.h" 3671d10453SEric Joyner #include "ice_nvm.h" 3771d10453SEric Joyner #include "ice_flex_pipe.h" 3871d10453SEric Joyner #include "virtchnl.h" 3971d10453SEric Joyner #include "ice_switch.h" 4071d10453SEric Joyner 419cf1841cSEric Joyner #define ICE_SQ_SEND_DELAY_TIME_MS 10 429cf1841cSEric Joyner #define ICE_SQ_SEND_MAX_EXECUTE 3 439cf1841cSEric Joyner 44*f2635e84SEric Joyner #define LOOPBACK_MODE_NO 0 45*f2635e84SEric Joyner #define LOOPBACK_MODE_HIGH 2 46*f2635e84SEric Joyner 4771d10453SEric Joyner enum ice_fw_modes { 4871d10453SEric Joyner ICE_FW_MODE_NORMAL, 4971d10453SEric Joyner ICE_FW_MODE_DBG, 5071d10453SEric Joyner ICE_FW_MODE_REC, 5171d10453SEric Joyner ICE_FW_MODE_ROLLBACK 5271d10453SEric Joyner }; 5371d10453SEric Joyner 5471d10453SEric Joyner void ice_idle_aq(struct ice_hw *hw, struct ice_ctl_q_info *cq); 5571d10453SEric Joyner bool ice_sq_done(struct ice_hw *hw, struct ice_ctl_q_info *cq); 5671d10453SEric Joyner 57*f2635e84SEric Joyner int ice_init_fltr_mgmt_struct(struct ice_hw *hw); 58*f2635e84SEric Joyner void ice_cleanup_fltr_mgmt_struct(struct ice_hw *hw); 5956429daeSEric Joyner void ice_set_umac_shared(struct ice_hw *hw); 60*f2635e84SEric Joyner int ice_init_hw(struct ice_hw *hw); 6171d10453SEric Joyner void ice_deinit_hw(struct ice_hw *hw); 62*f2635e84SEric Joyner int ice_check_reset(struct ice_hw *hw); 63*f2635e84SEric Joyner int ice_reset(struct ice_hw *hw, enum ice_reset_req req); 64*f2635e84SEric Joyner int ice_create_all_ctrlq(struct ice_hw *hw); 65*f2635e84SEric Joyner int ice_init_all_ctrlq(struct ice_hw *hw); 668923de59SPiotr Kubaj void ice_shutdown_all_ctrlq(struct ice_hw *hw, bool unloading); 6771d10453SEric Joyner void ice_destroy_all_ctrlq(struct ice_hw *hw); 68*f2635e84SEric Joyner int 6971d10453SEric Joyner ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq, 7071d10453SEric Joyner struct ice_rq_event_info *e, u16 *pending); 71*f2635e84SEric Joyner int 7271d10453SEric Joyner ice_get_link_status(struct ice_port_info *pi, bool *link_up); 73*f2635e84SEric Joyner int ice_update_link_info(struct ice_port_info *pi); 74*f2635e84SEric Joyner int 7571d10453SEric Joyner ice_acquire_res(struct ice_hw *hw, enum ice_aq_res_ids res, 7671d10453SEric Joyner enum ice_aq_res_access_type access, u32 timeout); 7771d10453SEric Joyner void ice_release_res(struct ice_hw *hw, enum ice_aq_res_ids res); 78*f2635e84SEric Joyner int 7971d10453SEric Joyner ice_alloc_hw_res(struct ice_hw *hw, u16 type, u16 num, bool btm, u16 *res); 80*f2635e84SEric Joyner int 8171d10453SEric Joyner ice_free_hw_res(struct ice_hw *hw, u16 type, u16 num, u16 *res); 82*f2635e84SEric Joyner int 8371d10453SEric Joyner ice_aq_alloc_free_res(struct ice_hw *hw, u16 num_entries, 8471d10453SEric Joyner struct ice_aqc_alloc_free_res_elem *buf, u16 buf_size, 8571d10453SEric Joyner enum ice_adminq_opc opc, struct ice_sq_cd *cd); 86*f2635e84SEric Joyner int 87*f2635e84SEric Joyner ice_sq_send_cmd_nolock(struct ice_hw *hw, struct ice_ctl_q_info *cq, 88*f2635e84SEric Joyner struct ice_aq_desc *desc, void *buf, u16 buf_size, 89*f2635e84SEric Joyner struct ice_sq_cd *cd); 90*f2635e84SEric Joyner int 9171d10453SEric Joyner ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq, 9271d10453SEric Joyner struct ice_aq_desc *desc, void *buf, u16 buf_size, 9371d10453SEric Joyner struct ice_sq_cd *cd); 9471d10453SEric Joyner void ice_clear_pxe_mode(struct ice_hw *hw); 95*f2635e84SEric Joyner int ice_get_caps(struct ice_hw *hw); 9671d10453SEric Joyner 9771d10453SEric Joyner void ice_set_safe_mode_caps(struct ice_hw *hw); 9871d10453SEric Joyner 99*f2635e84SEric Joyner int 1009e54973fSEric Joyner ice_aq_get_internal_data(struct ice_hw *hw, u16 cluster_id, u16 table_id, 10156429daeSEric Joyner u32 start, void *buf, u16 buf_size, u16 *ret_buf_size, 1029e54973fSEric Joyner u16 *ret_next_cluster, u16 *ret_next_table, 1039e54973fSEric Joyner u32 *ret_next_index, struct ice_sq_cd *cd); 10456429daeSEric Joyner 105*f2635e84SEric Joyner int ice_set_mac_type(struct ice_hw *hw); 10671d10453SEric Joyner 10771d10453SEric Joyner /* Define a macro that will align a pointer to point to the next memory address 10871d10453SEric Joyner * that falls on the given power of 2 (i.e., 2, 4, 8, 16, 32, 64...). For 10971d10453SEric Joyner * example, given the variable pointer = 0x1006, then after the following call: 11071d10453SEric Joyner * 11171d10453SEric Joyner * pointer = ICE_ALIGN(pointer, 4) 11271d10453SEric Joyner * 11371d10453SEric Joyner * ... the value of pointer would equal 0x1008, since 0x1008 is the next 11471d10453SEric Joyner * address after 0x1006 which is divisible by 4. 11571d10453SEric Joyner */ 11671d10453SEric Joyner #define ICE_ALIGN(ptr, align) (((ptr) + ((align) - 1)) & ~((align) - 1)) 11771d10453SEric Joyner 1189dc2f6e2SEric Joyner #define ice_arr_elem_idx(idx, val) [(idx)] = (val) 1199dc2f6e2SEric Joyner 120*f2635e84SEric Joyner int 12171d10453SEric Joyner ice_write_rxq_ctx(struct ice_hw *hw, struct ice_rlan_ctx *rlan_ctx, 12271d10453SEric Joyner u32 rxq_index); 123*f2635e84SEric Joyner int 1249dc2f6e2SEric Joyner ice_read_rxq_ctx(struct ice_hw *hw, struct ice_rlan_ctx *rlan_ctx, 1259dc2f6e2SEric Joyner u32 rxq_index); 126*f2635e84SEric Joyner int ice_clear_rxq_ctx(struct ice_hw *hw, u32 rxq_index); 127*f2635e84SEric Joyner int 12871d10453SEric Joyner ice_clear_tx_cmpltnq_ctx(struct ice_hw *hw, u32 tx_cmpltnq_index); 129*f2635e84SEric Joyner int 13071d10453SEric Joyner ice_write_tx_cmpltnq_ctx(struct ice_hw *hw, 13171d10453SEric Joyner struct ice_tx_cmpltnq_ctx *tx_cmpltnq_ctx, 13271d10453SEric Joyner u32 tx_cmpltnq_index); 133*f2635e84SEric Joyner int 13471d10453SEric Joyner ice_clear_tx_drbell_q_ctx(struct ice_hw *hw, u32 tx_drbell_q_index); 135*f2635e84SEric Joyner int 13671d10453SEric Joyner ice_write_tx_drbell_q_ctx(struct ice_hw *hw, 13771d10453SEric Joyner struct ice_tx_drbell_q_ctx *tx_drbell_q_ctx, 13871d10453SEric Joyner u32 tx_drbell_q_index); 13971d10453SEric Joyner 1409c30461dSEric Joyner int ice_lut_size_to_type(int lut_size); 141*f2635e84SEric Joyner int 142d08b8680SEric Joyner ice_aq_get_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params *get_params); 143*f2635e84SEric Joyner int 144d08b8680SEric Joyner ice_aq_set_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params *set_params); 145*f2635e84SEric Joyner int 14671d10453SEric Joyner ice_aq_get_rss_key(struct ice_hw *hw, u16 vsi_handle, 14771d10453SEric Joyner struct ice_aqc_get_set_rss_keys *keys); 148*f2635e84SEric Joyner int 14971d10453SEric Joyner ice_aq_set_rss_key(struct ice_hw *hw, u16 vsi_handle, 15071d10453SEric Joyner struct ice_aqc_get_set_rss_keys *keys); 151*f2635e84SEric Joyner int 15271d10453SEric Joyner ice_aq_add_lan_txq(struct ice_hw *hw, u8 count, 15371d10453SEric Joyner struct ice_aqc_add_tx_qgrp *qg_list, u16 buf_size, 15471d10453SEric Joyner struct ice_sq_cd *cd); 155*f2635e84SEric Joyner int 15671d10453SEric Joyner ice_aq_move_recfg_lan_txq(struct ice_hw *hw, u8 num_qs, bool is_move, 15771d10453SEric Joyner bool is_tc_change, bool subseq_call, bool flush_pipe, 15871d10453SEric Joyner u8 timeout, u32 *blocked_cgds, 15971d10453SEric Joyner struct ice_aqc_move_txqs_data *buf, u16 buf_size, 16071d10453SEric Joyner u8 *txqs_moved, struct ice_sq_cd *cd); 16171d10453SEric Joyner 162*f2635e84SEric Joyner int 1638a13362dSEric Joyner ice_aq_add_rdma_qsets(struct ice_hw *hw, u8 num_qset_grps, 1648a13362dSEric Joyner struct ice_aqc_add_rdma_qset_data *qset_list, 1658a13362dSEric Joyner u16 buf_size, struct ice_sq_cd *cd); 1668a13362dSEric Joyner 16771d10453SEric Joyner bool ice_check_sq_alive(struct ice_hw *hw, struct ice_ctl_q_info *cq); 168*f2635e84SEric Joyner int ice_aq_q_shutdown(struct ice_hw *hw, bool unloading); 16971d10453SEric Joyner void ice_fill_dflt_direct_cmd_desc(struct ice_aq_desc *desc, u16 opcode); 17071d10453SEric Joyner extern const struct ice_ctx_ele ice_tlan_ctx_info[]; 171*f2635e84SEric Joyner int 1727d7af7f8SEric Joyner ice_set_ctx(struct ice_hw *hw, u8 *src_ctx, u8 *dest_ctx, 1737d7af7f8SEric Joyner const struct ice_ctx_ele *ce_info); 174*f2635e84SEric Joyner int 1759dc2f6e2SEric Joyner ice_get_ctx(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info); 17671d10453SEric Joyner 177*f2635e84SEric Joyner int 17871d10453SEric Joyner ice_aq_send_cmd(struct ice_hw *hw, struct ice_aq_desc *desc, 17971d10453SEric Joyner void *buf, u16 buf_size, struct ice_sq_cd *cd); 180*f2635e84SEric Joyner int ice_aq_get_fw_ver(struct ice_hw *hw, struct ice_sq_cd *cd); 18171d10453SEric Joyner 182*f2635e84SEric Joyner int 18371d10453SEric Joyner ice_aq_send_driver_ver(struct ice_hw *hw, struct ice_driver_ver *dv, 18471d10453SEric Joyner struct ice_sq_cd *cd); 185*f2635e84SEric Joyner int 18671d10453SEric Joyner ice_aq_set_port_params(struct ice_port_info *pi, u16 bad_frame_vsi, 18771d10453SEric Joyner bool save_bad_pac, bool pad_short_pac, bool double_vlan, 18871d10453SEric Joyner struct ice_sq_cd *cd); 189*f2635e84SEric Joyner int 19071d10453SEric Joyner ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode, 19171d10453SEric Joyner struct ice_aqc_get_phy_caps_data *caps, 19271d10453SEric Joyner struct ice_sq_cd *cd); 193*f2635e84SEric Joyner int 19456429daeSEric Joyner ice_aq_get_netlist_node(struct ice_hw *hw, struct ice_aqc_get_link_topo *cmd, 19556429daeSEric Joyner u8 *node_part_number, u16 *node_handle); 196*f2635e84SEric Joyner int 19756429daeSEric Joyner ice_find_netlist_node(struct ice_hw *hw, u8 node_type_ctx, u8 node_part_number, 19856429daeSEric Joyner u16 *node_handle); 19971d10453SEric Joyner void 20071d10453SEric Joyner ice_update_phy_type(u64 *phy_type_low, u64 *phy_type_high, 20171d10453SEric Joyner u16 link_speeds_bitmap); 202*f2635e84SEric Joyner int 20371d10453SEric Joyner ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size, 20471d10453SEric Joyner struct ice_sq_cd *cd); 205*f2635e84SEric Joyner int 20671d10453SEric Joyner ice_aq_manage_mac_write(struct ice_hw *hw, const u8 *mac_addr, u8 flags, 20771d10453SEric Joyner struct ice_sq_cd *cd); 20871d10453SEric Joyner 209*f2635e84SEric Joyner int ice_clear_pf_cfg(struct ice_hw *hw); 210*f2635e84SEric Joyner int 21171d10453SEric Joyner ice_aq_set_phy_cfg(struct ice_hw *hw, struct ice_port_info *pi, 21271d10453SEric Joyner struct ice_aqc_set_phy_cfg_data *cfg, struct ice_sq_cd *cd); 21371d10453SEric Joyner bool ice_fw_supports_link_override(struct ice_hw *hw); 2148923de59SPiotr Kubaj bool ice_fw_supports_fec_dis_auto(struct ice_hw *hw); 215*f2635e84SEric Joyner int 21671d10453SEric Joyner ice_get_link_default_override(struct ice_link_default_override_tlv *ldo, 21771d10453SEric Joyner struct ice_port_info *pi); 2187d7af7f8SEric Joyner bool ice_is_phy_caps_an_enabled(struct ice_aqc_get_phy_caps_data *caps); 219*f2635e84SEric Joyner int ice_aq_get_phy_equalization(struct ice_hw *hw, u16 data_in, u16 op_code, 220*f2635e84SEric Joyner u8 serdes_num, int *output); 22171d10453SEric Joyner enum ice_fc_mode ice_caps_to_fc_mode(u8 caps); 22271d10453SEric Joyner enum ice_fec_mode ice_caps_to_fec_mode(u8 caps, u8 fec_options); 223*f2635e84SEric Joyner int 22471d10453SEric Joyner ice_set_fc(struct ice_port_info *pi, u8 *aq_failures, 22571d10453SEric Joyner bool ena_auto_link_update); 22671d10453SEric Joyner bool 22771d10453SEric Joyner ice_phy_caps_equals_cfg(struct ice_aqc_get_phy_caps_data *caps, 22871d10453SEric Joyner struct ice_aqc_set_phy_cfg_data *cfg); 22971d10453SEric Joyner void 23071d10453SEric Joyner ice_copy_phy_caps_to_cfg(struct ice_port_info *pi, 23171d10453SEric Joyner struct ice_aqc_get_phy_caps_data *caps, 23271d10453SEric Joyner struct ice_aqc_set_phy_cfg_data *cfg); 233*f2635e84SEric Joyner int 23471d10453SEric Joyner ice_cfg_phy_fec(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg, 23571d10453SEric Joyner enum ice_fec_mode fec); 236*f2635e84SEric Joyner int 23771d10453SEric Joyner ice_aq_set_link_restart_an(struct ice_port_info *pi, bool ena_link, 23871d10453SEric Joyner struct ice_sq_cd *cd); 239*f2635e84SEric Joyner int 24056429daeSEric Joyner ice_aq_set_mac_cfg(struct ice_hw *hw, u16 max_frame_size, bool auto_drop, 24156429daeSEric Joyner struct ice_sq_cd *cd); 242*f2635e84SEric Joyner int 24371d10453SEric Joyner ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse, 24471d10453SEric Joyner struct ice_link_status *link, struct ice_sq_cd *cd); 245*f2635e84SEric Joyner int 24671d10453SEric Joyner ice_aq_set_event_mask(struct ice_hw *hw, u8 port_num, u16 mask, 24771d10453SEric Joyner struct ice_sq_cd *cd); 248*f2635e84SEric Joyner int 24971d10453SEric Joyner ice_aq_set_mac_loopback(struct ice_hw *hw, bool ena_lpbk, struct ice_sq_cd *cd); 25071d10453SEric Joyner 251*f2635e84SEric Joyner int 25271d10453SEric Joyner ice_aq_set_port_id_led(struct ice_port_info *pi, bool is_orig_mode, 25371d10453SEric Joyner struct ice_sq_cd *cd); 254*f2635e84SEric Joyner int 25571d10453SEric Joyner ice_aq_sff_eeprom(struct ice_hw *hw, u16 lport, u8 bus_addr, 25671d10453SEric Joyner u16 mem_addr, u8 page, u8 set_page, u8 *data, u8 length, 25771d10453SEric Joyner bool write, struct ice_sq_cd *cd); 2589dc2f6e2SEric Joyner u32 ice_get_link_speed(u16 index); 25971d10453SEric Joyner 260*f2635e84SEric Joyner int 26156429daeSEric Joyner ice_aq_prog_topo_dev_nvm(struct ice_hw *hw, 26256429daeSEric Joyner struct ice_aqc_link_topo_params *topo_params, 26356429daeSEric Joyner struct ice_sq_cd *cd); 264*f2635e84SEric Joyner int 26556429daeSEric Joyner ice_aq_read_topo_dev_nvm(struct ice_hw *hw, 26656429daeSEric Joyner struct ice_aqc_link_topo_params *topo_params, 26756429daeSEric Joyner u32 start_address, u8 *buf, u8 buf_size, 26856429daeSEric Joyner struct ice_sq_cd *cd); 26956429daeSEric Joyner 270*f2635e84SEric Joyner int 2719cf1841cSEric Joyner ice_aq_get_port_options(struct ice_hw *hw, 2729cf1841cSEric Joyner struct ice_aqc_get_port_options_elem *options, 2739cf1841cSEric Joyner u8 *option_count, u8 lport, bool lport_valid, 2749dc2f6e2SEric Joyner u8 *active_option_idx, bool *active_option_valid, 2759dc2f6e2SEric Joyner u8 *pending_option_idx, bool *pending_option_valid); 276*f2635e84SEric Joyner int 2779dc2f6e2SEric Joyner ice_aq_set_port_option(struct ice_hw *hw, u8 lport, u8 lport_valid, 2789dc2f6e2SEric Joyner u8 new_option); 279*f2635e84SEric Joyner int 28071d10453SEric Joyner __ice_write_sr_word(struct ice_hw *hw, u32 offset, const u16 *data); 281*f2635e84SEric Joyner int 28271d10453SEric Joyner __ice_write_sr_buf(struct ice_hw *hw, u32 offset, u16 words, const u16 *data); 283*f2635e84SEric Joyner int 2848a13362dSEric Joyner ice_cfg_vsi_rdma(struct ice_port_info *pi, u16 vsi_handle, u16 tc_bitmap, 2858a13362dSEric Joyner u16 *max_rdmaqs); 286*f2635e84SEric Joyner int 2878a13362dSEric Joyner ice_ena_vsi_rdma_qset(struct ice_port_info *pi, u16 vsi_handle, u8 tc, 2888a13362dSEric Joyner u16 *rdma_qset, u16 num_qsets, u32 *qset_teid); 289*f2635e84SEric Joyner int 2908a13362dSEric Joyner ice_dis_vsi_rdma_qset(struct ice_port_info *pi, u16 count, u32 *qset_teid, 2918a13362dSEric Joyner u16 *q_id); 292*f2635e84SEric Joyner int 29371d10453SEric Joyner ice_dis_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u8 num_queues, 29471d10453SEric Joyner u16 *q_handle, u16 *q_ids, u32 *q_teids, 29571d10453SEric Joyner enum ice_disq_rst_src rst_src, u16 vmvf_num, 29671d10453SEric Joyner struct ice_sq_cd *cd); 297*f2635e84SEric Joyner int 29871d10453SEric Joyner ice_cfg_vsi_lan(struct ice_port_info *pi, u16 vsi_handle, u16 tc_bitmap, 29971d10453SEric Joyner u16 *max_lanqs); 300*f2635e84SEric Joyner int 30171d10453SEric Joyner ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 q_handle, 30271d10453SEric Joyner u8 num_qgrps, struct ice_aqc_add_tx_qgrp *buf, u16 buf_size, 30371d10453SEric Joyner struct ice_sq_cd *cd); 304*f2635e84SEric Joyner int 30556429daeSEric Joyner ice_replay_pre_init(struct ice_hw *hw, struct ice_switch_info *sw); 306*f2635e84SEric Joyner int ice_replay_vsi(struct ice_hw *hw, u16 vsi_handle); 30771d10453SEric Joyner void ice_replay_post(struct ice_hw *hw); 30871d10453SEric Joyner struct ice_q_ctx * 30971d10453SEric Joyner ice_get_lan_q_ctx(struct ice_hw *hw, u16 vsi_handle, u8 tc, u16 q_handle); 310*f2635e84SEric Joyner int ice_sbq_rw_reg_lp(struct ice_hw *hw, struct ice_sbq_msg_input *in, 311*f2635e84SEric Joyner u16 flag, bool lock); 312*f2635e84SEric Joyner void ice_sbq_lock(struct ice_hw *hw); 313*f2635e84SEric Joyner void ice_sbq_unlock(struct ice_hw *hw); 314*f2635e84SEric Joyner int ice_sbq_rw_reg(struct ice_hw *hw, struct ice_sbq_msg_input *in, u16 flag); 315*f2635e84SEric Joyner int 3169c30461dSEric Joyner ice_aq_get_sensor_reading(struct ice_hw *hw, u8 sensor, u8 format, 3179c30461dSEric Joyner struct ice_aqc_get_sensor_reading_resp *data, 3189c30461dSEric Joyner struct ice_sq_cd *cd); 31971d10453SEric Joyner void 32071d10453SEric Joyner ice_stat_update40(struct ice_hw *hw, u32 reg, bool prev_stat_loaded, 32171d10453SEric Joyner u64 *prev_stat, u64 *cur_stat); 32271d10453SEric Joyner void 32371d10453SEric Joyner ice_stat_update32(struct ice_hw *hw, u32 reg, bool prev_stat_loaded, 32471d10453SEric Joyner u64 *prev_stat, u64 *cur_stat); 32571d10453SEric Joyner void 32671d10453SEric Joyner ice_stat_update_repc(struct ice_hw *hw, u16 vsi_handle, bool prev_stat_loaded, 32771d10453SEric Joyner struct ice_eth_stats *cur_stats); 32871d10453SEric Joyner enum ice_fw_modes ice_get_fw_mode(struct ice_hw *hw); 32971d10453SEric Joyner void ice_print_rollback_msg(struct ice_hw *hw); 330*f2635e84SEric Joyner bool ice_is_generic_mac(struct ice_hw *hw); 33156429daeSEric Joyner bool ice_is_e810(struct ice_hw *hw); 33256429daeSEric Joyner bool ice_is_e810t(struct ice_hw *hw); 333*f2635e84SEric Joyner bool ice_is_e830(struct ice_hw *hw); 334*f2635e84SEric Joyner bool ice_is_e825c(struct ice_hw *hw); 3358923de59SPiotr Kubaj bool ice_is_e823(struct ice_hw *hw); 336*f2635e84SEric Joyner int 33771d10453SEric Joyner ice_aq_alternate_write(struct ice_hw *hw, u32 reg_addr0, u32 reg_val0, 33871d10453SEric Joyner u32 reg_addr1, u32 reg_val1); 339*f2635e84SEric Joyner int 34071d10453SEric Joyner ice_aq_alternate_read(struct ice_hw *hw, u32 reg_addr0, u32 *reg_val0, 34171d10453SEric Joyner u32 reg_addr1, u32 *reg_val1); 342*f2635e84SEric Joyner int 34371d10453SEric Joyner ice_aq_alternate_write_done(struct ice_hw *hw, u8 bios_mode, 34471d10453SEric Joyner bool *reset_needed); 345*f2635e84SEric Joyner int ice_aq_alternate_clear(struct ice_hw *hw); 346*f2635e84SEric Joyner int 34771d10453SEric Joyner ice_sched_query_elem(struct ice_hw *hw, u32 node_teid, 3487d7af7f8SEric Joyner struct ice_aqc_txsched_elem_data *buf); 349*f2635e84SEric Joyner int 35071d10453SEric Joyner ice_get_cur_lldp_persist_status(struct ice_hw *hw, u32 *lldp_status); 351*f2635e84SEric Joyner int 35271d10453SEric Joyner ice_get_dflt_lldp_persist_status(struct ice_hw *hw, u32 *lldp_status); 353*f2635e84SEric Joyner int 35456429daeSEric Joyner ice_aq_set_gpio(struct ice_hw *hw, u16 gpio_ctrl_handle, u8 pin_idx, bool value, 35556429daeSEric Joyner struct ice_sq_cd *cd); 356*f2635e84SEric Joyner int 35756429daeSEric Joyner ice_aq_get_gpio(struct ice_hw *hw, u16 gpio_ctrl_handle, u8 pin_idx, 35856429daeSEric Joyner bool *value, struct ice_sq_cd *cd); 35956429daeSEric Joyner bool ice_is_100m_speed_supported(struct ice_hw *hw); 360*f2635e84SEric Joyner int ice_get_netlist_ver_info(struct ice_hw *hw, struct ice_netlist_info *netlist); 361*f2635e84SEric Joyner int 3627d7af7f8SEric Joyner ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size, 3637d7af7f8SEric Joyner struct ice_sq_cd *cd); 3647d7af7f8SEric Joyner bool ice_fw_supports_lldp_fltr_ctrl(struct ice_hw *hw); 365*f2635e84SEric Joyner int 3667d7af7f8SEric Joyner ice_lldp_fltr_add_remove(struct ice_hw *hw, u16 vsi_num, bool add); 367*f2635e84SEric Joyner int ice_lldp_execute_pending_mib(struct ice_hw *hw); 368*f2635e84SEric Joyner int 36956429daeSEric Joyner ice_aq_read_i2c(struct ice_hw *hw, struct ice_aqc_link_topo_addr topo_addr, 37056429daeSEric Joyner u16 bus_addr, __le16 addr, u8 params, u8 *data, 37156429daeSEric Joyner struct ice_sq_cd *cd); 372*f2635e84SEric Joyner int 37356429daeSEric Joyner ice_aq_write_i2c(struct ice_hw *hw, struct ice_aqc_link_topo_addr topo_addr, 3749e54973fSEric Joyner u16 bus_addr, __le16 addr, u8 params, const u8 *data, 37556429daeSEric Joyner struct ice_sq_cd *cd); 376*f2635e84SEric Joyner int 3779cf1841cSEric Joyner ice_aq_set_health_status_config(struct ice_hw *hw, u8 event_source, 3789cf1841cSEric Joyner struct ice_sq_cd *cd); 3799cf1841cSEric Joyner bool ice_is_fw_health_report_supported(struct ice_hw *hw); 3809cf1841cSEric Joyner bool ice_fw_supports_report_dflt_cfg(struct ice_hw *hw); 38156429daeSEric Joyner /* AQ API version for FW auto drop reports */ 38256429daeSEric Joyner bool ice_is_fw_auto_drop_supported(struct ice_hw *hw); 38371d10453SEric Joyner #endif /* _ICE_COMMON_H_ */ 384