1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(c) 2015-2020 3 */ 4 5 #ifndef _TXGBE_HW_H_ 6 #define _TXGBE_HW_H_ 7 8 #include "txgbe_type.h" 9 10 s32 txgbe_init_hw(struct txgbe_hw *hw); 11 s32 txgbe_start_hw(struct txgbe_hw *hw); 12 s32 txgbe_stop_hw(struct txgbe_hw *hw); 13 s32 txgbe_start_hw_gen2(struct txgbe_hw *hw); 14 s32 txgbe_clear_hw_cntrs(struct txgbe_hw *hw); 15 s32 txgbe_get_mac_addr(struct txgbe_hw *hw, u8 *mac_addr); 16 17 void txgbe_set_lan_id_multi_port(struct txgbe_hw *hw); 18 19 s32 txgbe_led_on(struct txgbe_hw *hw, u32 index); 20 s32 txgbe_led_off(struct txgbe_hw *hw, u32 index); 21 22 s32 txgbe_set_rar(struct txgbe_hw *hw, u32 index, u8 *addr, u32 vmdq, 23 u32 enable_addr); 24 s32 txgbe_clear_rar(struct txgbe_hw *hw, u32 index); 25 s32 txgbe_init_rx_addrs(struct txgbe_hw *hw); 26 s32 txgbe_update_mc_addr_list(struct txgbe_hw *hw, u8 *mc_addr_list, 27 u32 mc_addr_count, 28 txgbe_mc_addr_itr func, bool clear); 29 s32 txgbe_disable_sec_rx_path(struct txgbe_hw *hw); 30 s32 txgbe_enable_sec_rx_path(struct txgbe_hw *hw); 31 s32 txgbe_disable_sec_tx_path(struct txgbe_hw *hw); 32 s32 txgbe_enable_sec_tx_path(struct txgbe_hw *hw); 33 34 s32 txgbe_fc_enable(struct txgbe_hw *hw); 35 bool txgbe_device_supports_autoneg_fc(struct txgbe_hw *hw); 36 void txgbe_fc_autoneg(struct txgbe_hw *hw); 37 s32 txgbe_setup_fc(struct txgbe_hw *hw); 38 39 s32 txgbe_validate_mac_addr(u8 *mac_addr); 40 s32 txgbe_acquire_swfw_sync(struct txgbe_hw *hw, u32 mask); 41 void txgbe_release_swfw_sync(struct txgbe_hw *hw, u32 mask); 42 43 s32 txgbe_get_san_mac_addr(struct txgbe_hw *hw, u8 *san_mac_addr); 44 s32 txgbe_set_san_mac_addr(struct txgbe_hw *hw, u8 *san_mac_addr); 45 46 s32 txgbe_set_vmdq(struct txgbe_hw *hw, u32 rar, u32 vmdq); 47 s32 txgbe_clear_vmdq(struct txgbe_hw *hw, u32 rar, u32 vmdq); 48 s32 txgbe_init_uta_tables(struct txgbe_hw *hw); 49 s32 txgbe_set_vfta(struct txgbe_hw *hw, u32 vlan, 50 u32 vind, bool vlan_on, bool vlvf_bypass); 51 s32 txgbe_set_vlvf(struct txgbe_hw *hw, u32 vlan, u32 vind, 52 bool vlan_on, u32 *vfta_delta, u32 vfta, 53 bool vlvf_bypass); 54 s32 txgbe_clear_vfta(struct txgbe_hw *hw); 55 s32 txgbe_find_vlvf_slot(struct txgbe_hw *hw, u32 vlan, bool vlvf_bypass); 56 57 s32 txgbe_check_mac_link(struct txgbe_hw *hw, 58 u32 *speed, 59 bool *link_up, bool link_up_wait_to_complete); 60 61 s32 txgbe_get_wwn_prefix(struct txgbe_hw *hw, u16 *wwnn_prefix, 62 u16 *wwpn_prefix); 63 64 void txgbe_set_mac_anti_spoofing(struct txgbe_hw *hw, bool enable, int vf); 65 void txgbe_set_ethertype_anti_spoofing(struct txgbe_hw *hw, 66 bool enable, int vf); 67 s32 txgbe_get_device_caps(struct txgbe_hw *hw, u16 *device_caps); 68 void txgbe_set_pba(struct txgbe_hw *hw, int num_pb, u32 headroom, 69 int strategy); 70 void txgbe_clear_tx_pending(struct txgbe_hw *hw); 71 72 s32 txgbe_reset_pipeline_raptor(struct txgbe_hw *hw); 73 74 s32 txgbe_get_thermal_sensor_data(struct txgbe_hw *hw); 75 s32 txgbe_init_thermal_sensor_thresh(struct txgbe_hw *hw); 76 77 void txgbe_disable_rx(struct txgbe_hw *hw); 78 void txgbe_enable_rx(struct txgbe_hw *hw); 79 s32 txgbe_setup_mac_link_multispeed_fiber(struct txgbe_hw *hw, 80 u32 speed, 81 bool autoneg_wait_to_complete); 82 void txgbe_set_mta(struct txgbe_hw *hw, u8 *mc_addr); 83 s32 txgbe_negotiate_fc(struct txgbe_hw *hw, u32 adv_reg, u32 lp_reg, 84 u32 adv_sym, u32 adv_asm, u32 lp_sym, u32 lp_asm); 85 s32 txgbe_init_shared_code(struct txgbe_hw *hw); 86 s32 txgbe_set_mac_type(struct txgbe_hw *hw); 87 s32 txgbe_init_ops_pf(struct txgbe_hw *hw); 88 s32 txgbe_get_link_capabilities_raptor(struct txgbe_hw *hw, 89 u32 *speed, bool *autoneg); 90 u32 txgbe_get_media_type_raptor(struct txgbe_hw *hw); 91 void txgbe_disable_tx_laser_multispeed_fiber(struct txgbe_hw *hw); 92 void txgbe_enable_tx_laser_multispeed_fiber(struct txgbe_hw *hw); 93 void txgbe_flap_tx_laser_multispeed_fiber(struct txgbe_hw *hw); 94 void txgbe_set_hard_rate_select_speed(struct txgbe_hw *hw, 95 u32 speed); 96 s32 txgbe_setup_mac_link_smartspeed(struct txgbe_hw *hw, 97 u32 speed, 98 bool autoneg_wait_to_complete); 99 s32 txgbe_start_mac_link_raptor(struct txgbe_hw *hw, 100 bool autoneg_wait_to_complete); 101 s32 txgbe_setup_mac_link(struct txgbe_hw *hw, u32 speed, 102 bool autoneg_wait_to_complete); 103 s32 txgbe_setup_sfp_modules(struct txgbe_hw *hw); 104 void txgbe_init_mac_link_ops(struct txgbe_hw *hw); 105 s32 txgbe_reset_hw(struct txgbe_hw *hw); 106 s32 txgbe_start_hw_raptor(struct txgbe_hw *hw); 107 s32 txgbe_init_phy_raptor(struct txgbe_hw *hw); 108 s32 txgbe_enable_rx_dma_raptor(struct txgbe_hw *hw, u32 regval); 109 s32 txgbe_prot_autoc_read_raptor(struct txgbe_hw *hw, bool *locked, u64 *value); 110 s32 txgbe_prot_autoc_write_raptor(struct txgbe_hw *hw, bool locked, u64 value); 111 bool txgbe_verify_lesm_fw_enabled_raptor(struct txgbe_hw *hw); 112 #endif /* _TXGBE_HW_H_ */ 113