18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* Copyright (c) 2018, Intel Corporation. */ 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ci#ifndef _ICE_LIB_H_ 58c2ecf20Sopenharmony_ci#define _ICE_LIB_H_ 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#include "ice.h" 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ciconst char *ice_vsi_type_str(enum ice_vsi_type vsi_type); 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_cibool ice_pf_state_is_nominal(struct ice_pf *pf); 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_civoid ice_update_eth_stats(struct ice_vsi *vsi); 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ciint ice_vsi_cfg_rxqs(struct ice_vsi *vsi); 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ciint ice_vsi_cfg_lan_txqs(struct ice_vsi *vsi); 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_civoid ice_vsi_cfg_msix(struct ice_vsi *vsi); 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ciint 228c2ecf20Sopenharmony_ciice_vsi_add_vlan(struct ice_vsi *vsi, u16 vid, enum ice_sw_fwd_act_type action); 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ciint ice_vsi_kill_vlan(struct ice_vsi *vsi, u16 vid); 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ciint ice_vsi_manage_vlan_insertion(struct ice_vsi *vsi); 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ciint ice_vsi_manage_vlan_stripping(struct ice_vsi *vsi, bool ena); 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ciint ice_vsi_start_all_rx_rings(struct ice_vsi *vsi); 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ciint ice_vsi_stop_all_rx_rings(struct ice_vsi *vsi); 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ciint 358c2ecf20Sopenharmony_ciice_vsi_stop_lan_tx_rings(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src, 368c2ecf20Sopenharmony_ci u16 rel_vmvf_num); 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ciint ice_vsi_cfg_xdp_txqs(struct ice_vsi *vsi); 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ciint ice_vsi_stop_xdp_tx_rings(struct ice_vsi *vsi); 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_cibool ice_vsi_is_vlan_pruning_ena(struct ice_vsi *vsi); 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ciint ice_cfg_vlan_pruning(struct ice_vsi *vsi, bool ena, bool vlan_promisc); 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_civoid ice_cfg_sw_lldp(struct ice_vsi *vsi, bool tx, bool create); 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_ci#ifdef CONFIG_DCB 498c2ecf20Sopenharmony_ciint ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc); 508c2ecf20Sopenharmony_ci#endif /* CONFIG_DCB */ 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_cistruct ice_vsi * 538c2ecf20Sopenharmony_ciice_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi, 548c2ecf20Sopenharmony_ci enum ice_vsi_type vsi_type, u16 vf_id); 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_civoid ice_napi_del(struct ice_vsi *vsi); 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_ciint ice_vsi_release(struct ice_vsi *vsi); 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_civoid ice_vsi_close(struct ice_vsi *vsi); 618c2ecf20Sopenharmony_ci 628c2ecf20Sopenharmony_ciint ice_ena_vsi(struct ice_vsi *vsi, bool locked); 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_civoid ice_dis_vsi(struct ice_vsi *vsi, bool locked); 658c2ecf20Sopenharmony_ci 668c2ecf20Sopenharmony_ciint ice_free_res(struct ice_res_tracker *res, u16 index, u16 id); 678c2ecf20Sopenharmony_ci 688c2ecf20Sopenharmony_ciint 698c2ecf20Sopenharmony_ciice_get_res(struct ice_pf *pf, struct ice_res_tracker *res, u16 needed, u16 id); 708c2ecf20Sopenharmony_ci 718c2ecf20Sopenharmony_ciint ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi); 728c2ecf20Sopenharmony_ci 738c2ecf20Sopenharmony_cibool ice_is_reset_in_progress(unsigned long *state); 748c2ecf20Sopenharmony_ci 758c2ecf20Sopenharmony_civoid 768c2ecf20Sopenharmony_ciice_write_qrxflxp_cntxt(struct ice_hw *hw, u16 pf_q, u32 rxdid, u32 prio); 778c2ecf20Sopenharmony_ci 788c2ecf20Sopenharmony_civoid ice_vsi_dis_irq(struct ice_vsi *vsi); 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_civoid ice_vsi_free_irq(struct ice_vsi *vsi); 818c2ecf20Sopenharmony_ci 828c2ecf20Sopenharmony_civoid ice_vsi_free_rx_rings(struct ice_vsi *vsi); 838c2ecf20Sopenharmony_ci 848c2ecf20Sopenharmony_civoid ice_vsi_free_tx_rings(struct ice_vsi *vsi); 858c2ecf20Sopenharmony_ci 868c2ecf20Sopenharmony_ciint ice_vsi_manage_rss_lut(struct ice_vsi *vsi, bool ena); 878c2ecf20Sopenharmony_ci 888c2ecf20Sopenharmony_civoid ice_update_tx_ring_stats(struct ice_ring *ring, u64 pkts, u64 bytes); 898c2ecf20Sopenharmony_ci 908c2ecf20Sopenharmony_civoid ice_update_rx_ring_stats(struct ice_ring *ring, u64 pkts, u64 bytes); 918c2ecf20Sopenharmony_ci 928c2ecf20Sopenharmony_civoid ice_vsi_cfg_frame_size(struct ice_vsi *vsi); 938c2ecf20Sopenharmony_ci 948c2ecf20Sopenharmony_ciint ice_status_to_errno(enum ice_status err); 958c2ecf20Sopenharmony_ci 968c2ecf20Sopenharmony_ciu32 ice_intrl_usec_to_reg(u8 intrl, u8 gran); 978c2ecf20Sopenharmony_ci 988c2ecf20Sopenharmony_cienum ice_status 998c2ecf20Sopenharmony_ciice_vsi_cfg_mac_fltr(struct ice_vsi *vsi, const u8 *macaddr, bool set); 1008c2ecf20Sopenharmony_ci 1018c2ecf20Sopenharmony_cibool ice_is_safe_mode(struct ice_pf *pf); 1028c2ecf20Sopenharmony_ci 1038c2ecf20Sopenharmony_cibool ice_is_dflt_vsi_in_use(struct ice_sw *sw); 1048c2ecf20Sopenharmony_ci 1058c2ecf20Sopenharmony_cibool ice_is_vsi_dflt_vsi(struct ice_sw *sw, struct ice_vsi *vsi); 1068c2ecf20Sopenharmony_ci 1078c2ecf20Sopenharmony_ciint ice_set_dflt_vsi(struct ice_sw *sw, struct ice_vsi *vsi); 1088c2ecf20Sopenharmony_ci 1098c2ecf20Sopenharmony_ciint ice_clear_dflt_vsi(struct ice_sw *sw); 1108c2ecf20Sopenharmony_ci#endif /* !_ICE_LIB_H_ */ 111