1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(c) 2018-2021 Beijing WangXun Technology Co., Ltd. 3 * Copyright(c) 2010-2017 Intel Corporation 4 */ 5 6 #ifndef _NGBE_HW_H_ 7 #define _NGBE_HW_H_ 8 9 #include "ngbe_type.h" 10 11 #define NGBE_EM_MAX_TX_QUEUES 8 12 #define NGBE_EM_MAX_RX_QUEUES 8 13 #define NGBE_EM_RAR_ENTRIES 32 14 #define NGBE_EM_MC_TBL_SIZE 32 15 #define NGBE_EM_VFT_TBL_SIZE 128 16 #define NGBE_EM_RX_PB_SIZE 42 /*KB*/ 17 18 s32 ngbe_init_hw(struct ngbe_hw *hw); 19 s32 ngbe_start_hw(struct ngbe_hw *hw); 20 s32 ngbe_reset_hw_em(struct ngbe_hw *hw); 21 s32 ngbe_stop_hw(struct ngbe_hw *hw); 22 s32 ngbe_clear_hw_cntrs(struct ngbe_hw *hw); 23 s32 ngbe_get_mac_addr(struct ngbe_hw *hw, u8 *mac_addr); 24 25 void ngbe_set_lan_id_multi_port(struct ngbe_hw *hw); 26 27 s32 ngbe_check_mac_link_em(struct ngbe_hw *hw, u32 *speed, 28 bool *link_up, bool link_up_wait_to_complete); 29 s32 ngbe_get_link_capabilities_em(struct ngbe_hw *hw, 30 u32 *speed, 31 bool *autoneg); 32 s32 ngbe_setup_mac_link_em(struct ngbe_hw *hw, 33 u32 speed, 34 bool autoneg_wait_to_complete); 35 36 s32 ngbe_led_on(struct ngbe_hw *hw, u32 index); 37 s32 ngbe_led_off(struct ngbe_hw *hw, u32 index); 38 39 s32 ngbe_set_rar(struct ngbe_hw *hw, u32 index, u8 *addr, u32 vmdq, 40 u32 enable_addr); 41 s32 ngbe_clear_rar(struct ngbe_hw *hw, u32 index); 42 s32 ngbe_init_rx_addrs(struct ngbe_hw *hw); 43 s32 ngbe_update_mc_addr_list(struct ngbe_hw *hw, u8 *mc_addr_list, 44 u32 mc_addr_count, 45 ngbe_mc_addr_itr func, bool clear); 46 s32 ngbe_disable_sec_rx_path(struct ngbe_hw *hw); 47 s32 ngbe_enable_sec_rx_path(struct ngbe_hw *hw); 48 void ngbe_set_pba(struct ngbe_hw *hw); 49 50 s32 ngbe_setup_fc_em(struct ngbe_hw *hw); 51 s32 ngbe_fc_enable(struct ngbe_hw *hw); 52 void ngbe_fc_autoneg(struct ngbe_hw *hw); 53 54 s32 ngbe_validate_mac_addr(u8 *mac_addr); 55 s32 ngbe_acquire_swfw_sync(struct ngbe_hw *hw, u32 mask); 56 void ngbe_release_swfw_sync(struct ngbe_hw *hw, u32 mask); 57 s32 ngbe_set_pcie_master(struct ngbe_hw *hw, bool enable); 58 59 s32 ngbe_set_vmdq(struct ngbe_hw *hw, u32 rar, u32 vmdq); 60 s32 ngbe_clear_vmdq(struct ngbe_hw *hw, u32 rar, u32 vmdq); 61 s32 ngbe_init_uta_tables(struct ngbe_hw *hw); 62 s32 ngbe_set_vfta(struct ngbe_hw *hw, u32 vlan, 63 u32 vind, bool vlan_on, bool vlvf_bypass); 64 s32 ngbe_set_vlvf(struct ngbe_hw *hw, u32 vlan, u32 vind, 65 bool vlan_on, u32 *vfta_delta, u32 vfta, 66 bool vlvf_bypass); 67 s32 ngbe_clear_vfta(struct ngbe_hw *hw); 68 s32 ngbe_find_vlvf_slot(struct ngbe_hw *hw, u32 vlan, bool vlvf_bypass); 69 70 void ngbe_set_mac_anti_spoofing(struct ngbe_hw *hw, bool enable, int vf); 71 void ngbe_set_vlan_anti_spoofing(struct ngbe_hw *hw, bool enable, int vf); 72 s32 ngbe_init_thermal_sensor_thresh(struct ngbe_hw *hw); 73 s32 ngbe_mac_check_overtemp(struct ngbe_hw *hw); 74 void ngbe_disable_rx(struct ngbe_hw *hw); 75 void ngbe_enable_rx(struct ngbe_hw *hw); 76 void ngbe_set_mta(struct ngbe_hw *hw, u8 *mc_addr); 77 s32 ngbe_negotiate_fc(struct ngbe_hw *hw, u32 adv_reg, u32 lp_reg, 78 u32 adv_sym, u32 adv_asm, u32 lp_sym, u32 lp_asm); 79 s32 ngbe_init_shared_code(struct ngbe_hw *hw); 80 s32 ngbe_set_mac_type(struct ngbe_hw *hw); 81 s32 ngbe_init_ops_pf(struct ngbe_hw *hw); 82 s32 ngbe_init_phy(struct ngbe_hw *hw); 83 s32 ngbe_enable_rx_dma(struct ngbe_hw *hw, u32 regval); 84 void ngbe_map_device_id(struct ngbe_hw *hw); 85 86 #endif /* _NGBE_HW_H_ */ 87