1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(c) 2001-2020 Intel Corporation 3 */ 4 5 #ifndef _IGC_API_H_ 6 #define _IGC_API_H_ 7 8 #include "igc_hw.h" 9 10 /* I2C SDA and SCL timing parameters for standard mode */ 11 #define IGC_I2C_T_HD_STA 4 12 #define IGC_I2C_T_LOW 5 13 #define IGC_I2C_T_HIGH 4 14 #define IGC_I2C_T_SU_STA 5 15 #define IGC_I2C_T_HD_DATA 5 16 #define IGC_I2C_T_SU_DATA 1 17 #define IGC_I2C_T_RISE 1 18 #define IGC_I2C_T_FALL 1 19 #define IGC_I2C_T_SU_STO 4 20 #define IGC_I2C_T_BUF 5 21 22 s32 igc_set_i2c_bb(struct igc_hw *hw); 23 s32 igc_read_i2c_byte_generic(struct igc_hw *hw, u8 byte_offset, 24 u8 dev_addr, u8 *data); 25 s32 igc_write_i2c_byte_generic(struct igc_hw *hw, u8 byte_offset, 26 u8 dev_addr, u8 data); 27 void igc_i2c_bus_clear(struct igc_hw *hw); 28 29 void igc_init_function_pointers_82542(struct igc_hw *hw); 30 void igc_init_function_pointers_82543(struct igc_hw *hw); 31 void igc_init_function_pointers_82540(struct igc_hw *hw); 32 void igc_init_function_pointers_82571(struct igc_hw *hw); 33 void igc_init_function_pointers_82541(struct igc_hw *hw); 34 void igc_init_function_pointers_80003es2lan(struct igc_hw *hw); 35 void igc_init_function_pointers_ich8lan(struct igc_hw *hw); 36 void igc_init_function_pointers_82575(struct igc_hw *hw); 37 void igc_init_function_pointers_vf(struct igc_hw *hw); 38 void igc_power_up_fiber_serdes_link(struct igc_hw *hw); 39 void igc_shutdown_fiber_serdes_link(struct igc_hw *hw); 40 void igc_init_function_pointers_i210(struct igc_hw *hw); 41 void igc_init_function_pointers_i225(struct igc_hw *hw); 42 43 s32 igc_set_obff_timer(struct igc_hw *hw, u32 itr); 44 s32 igc_set_mac_type(struct igc_hw *hw); 45 s32 igc_setup_init_funcs(struct igc_hw *hw, bool init_device); 46 s32 igc_init_mac_params(struct igc_hw *hw); 47 s32 igc_init_nvm_params(struct igc_hw *hw); 48 s32 igc_init_phy_params(struct igc_hw *hw); 49 s32 igc_init_mbx_params(struct igc_hw *hw); 50 s32 igc_get_bus_info(struct igc_hw *hw); 51 void igc_clear_vfta(struct igc_hw *hw); 52 void igc_write_vfta(struct igc_hw *hw, u32 offset, u32 value); 53 s32 igc_force_mac_fc(struct igc_hw *hw); 54 s32 igc_check_for_link(struct igc_hw *hw); 55 s32 igc_reset_hw(struct igc_hw *hw); 56 s32 igc_init_hw(struct igc_hw *hw); 57 s32 igc_setup_link(struct igc_hw *hw); 58 s32 igc_get_speed_and_duplex(struct igc_hw *hw, u16 *speed, u16 *duplex); 59 s32 igc_disable_pcie_master(struct igc_hw *hw); 60 void igc_config_collision_dist(struct igc_hw *hw); 61 int igc_rar_set(struct igc_hw *hw, u8 *addr, u32 index); 62 u32 igc_hash_mc_addr(struct igc_hw *hw, u8 *mc_addr); 63 void igc_update_mc_addr_list(struct igc_hw *hw, u8 *mc_addr_list, 64 u32 mc_addr_count); 65 s32 igc_setup_led(struct igc_hw *hw); 66 s32 igc_cleanup_led(struct igc_hw *hw); 67 s32 igc_check_reset_block(struct igc_hw *hw); 68 s32 igc_blink_led(struct igc_hw *hw); 69 s32 igc_led_on(struct igc_hw *hw); 70 s32 igc_led_off(struct igc_hw *hw); 71 s32 igc_id_led_init(struct igc_hw *hw); 72 void igc_reset_adaptive(struct igc_hw *hw); 73 void igc_update_adaptive(struct igc_hw *hw); 74 s32 igc_get_cable_length(struct igc_hw *hw); 75 s32 igc_validate_mdi_setting(struct igc_hw *hw); 76 s32 igc_read_phy_reg(struct igc_hw *hw, u32 offset, u16 *data); 77 s32 igc_write_phy_reg(struct igc_hw *hw, u32 offset, u16 data); 78 s32 igc_write_8bit_ctrl_reg(struct igc_hw *hw, u32 reg, u32 offset, 79 u8 data); 80 s32 igc_get_phy_info(struct igc_hw *hw); 81 void igc_release_phy(struct igc_hw *hw); 82 s32 igc_acquire_phy(struct igc_hw *hw); 83 s32 igc_cfg_on_link_up(struct igc_hw *hw); 84 s32 igc_phy_hw_reset(struct igc_hw *hw); 85 s32 igc_phy_commit(struct igc_hw *hw); 86 void igc_power_up_phy(struct igc_hw *hw); 87 void igc_power_down_phy(struct igc_hw *hw); 88 s32 igc_read_mac_addr(struct igc_hw *hw); 89 s32 igc_read_pba_num(struct igc_hw *hw, u32 *part_num); 90 s32 igc_read_pba_string(struct igc_hw *hw, u8 *pba_num, u32 pba_num_size); 91 s32 igc_read_pba_length(struct igc_hw *hw, u32 *pba_num_size); 92 void igc_reload_nvm(struct igc_hw *hw); 93 s32 igc_update_nvm_checksum(struct igc_hw *hw); 94 s32 igc_validate_nvm_checksum(struct igc_hw *hw); 95 s32 igc_read_nvm(struct igc_hw *hw, u16 offset, u16 words, u16 *data); 96 s32 igc_read_kmrn_reg(struct igc_hw *hw, u32 offset, u16 *data); 97 s32 igc_write_kmrn_reg(struct igc_hw *hw, u32 offset, u16 data); 98 s32 igc_write_nvm(struct igc_hw *hw, u16 offset, u16 words, u16 *data); 99 s32 igc_set_d3_lplu_state(struct igc_hw *hw, bool active); 100 s32 igc_set_d0_lplu_state(struct igc_hw *hw, bool active); 101 bool igc_check_mng_mode(struct igc_hw *hw); 102 bool igc_enable_tx_pkt_filtering(struct igc_hw *hw); 103 s32 igc_mng_enable_host_if(struct igc_hw *hw); 104 s32 igc_mng_host_if_write(struct igc_hw *hw, u8 *buffer, u16 length, 105 u16 offset, u8 *sum); 106 s32 igc_mng_write_cmd_header(struct igc_hw *hw, 107 struct igc_host_mng_command_header *hdr); 108 s32 igc_mng_write_dhcp_info(struct igc_hw *hw, u8 *buffer, u16 length); 109 u32 igc_translate_register_82542(u32 reg); 110 111 #endif /* _IGC_API_H_ */ 112