1 /****************************************************************************** 2 * 3 * Copyright(c) 2007 - 2017 Realtek Corporation. 4 * 5 * This program is free software; you can redistribute it and/or modify it 6 * under the terms of version 2 of the GNU General Public License as 7 * published by the Free Software Foundation. 8 * 9 * This program is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 * more details. 13 * 14 *****************************************************************************/ 15 #ifndef __HAL_DM_H__ 16 #define __HAL_DM_H__ 17 18 #define adapter_to_phydm(adapter) (&(GET_HAL_DATA(adapter)->odmpriv)) 19 #define dvobj_to_phydm(dvobj) adapter_to_phydm(dvobj_get_primary_adapter(dvobj)) 20 #ifdef CONFIG_TDMADIG 21 void rtw_phydm_tdmadig(_adapter *adapter, u8 state); 22 #endif 23 void rtw_phydm_priv_init(_adapter *adapter); 24 void Init_ODM_ComInfo(_adapter *adapter); 25 void rtw_phydm_init(_adapter *adapter); 26 27 void rtw_hal_turbo_edca(_adapter *adapter); 28 u8 rtw_phydm_is_iqk_in_progress(_adapter *adapter); 29 30 void GetHalODMVar( 31 PADAPTER Adapter, 32 HAL_ODM_VARIABLE eVariable, 33 void *pValue1, 34 void *pValue2); 35 void SetHalODMVar( 36 PADAPTER Adapter, 37 HAL_ODM_VARIABLE eVariable, 38 void *pValue1, 39 BOOLEAN bSet); 40 41 void rtw_phydm_ra_registed(_adapter *adapter, struct sta_info *psta); 42 43 #ifdef CONFIG_DYNAMIC_SOML 44 void rtw_dyn_soml_byte_update(_adapter *adapter, u8 data_rate, u32 size); 45 void rtw_dyn_soml_para_set(_adapter *adapter, u8 train_num, u8 intvl, 46 u8 period, u8 delay); 47 void rtw_dyn_soml_config(_adapter *adapter); 48 #endif 49 void rtw_phydm_set_rrsr(_adapter *adapter, u32 rrsr_value, bool write_rrsr); 50 void rtw_phydm_watchdog(_adapter *adapter, bool in_lps); 51 52 void rtw_hal_update_iqk_fw_offload_cap(_adapter *adapter); 53 void dump_sta_info(void *sel, struct sta_info *psta); 54 void dump_sta_traffic(void *sel, _adapter *adapter, struct sta_info *psta); 55 56 #ifdef CONFIG_DBG_RF_CAL 57 void rtw_hal_iqk_test(_adapter *adapter, bool recovery, bool clear, bool segment); 58 void rtw_hal_lck_test(_adapter *adapter); 59 #endif 60 61 s8 rtw_dm_get_min_rssi(_adapter *adapter); 62 s8 rtw_phydm_get_min_rssi(_adapter *adapter); 63 u8 rtw_phydm_get_cur_igi(_adapter *adapter); 64 bool rtw_phydm_get_edcca_flag(_adapter *adapter); 65 66 67 #ifdef CONFIG_LPS_LCLK_WD_TIMER 68 extern void phydm_rssi_monitor_check(void *p_dm_void); 69 70 void rtw_phydm_wd_lps_lclk_hdl(_adapter *adapter); 71 void rtw_phydm_watchdog_in_lps_lclk(_adapter *adapter); 72 #endif 73 #ifdef CONFIG_TDMADIG 74 enum rtw_tdmadig_state{ 75 TDMADIG_INIT, 76 TDMADIG_NON_INIT, 77 }; 78 #endif 79 enum phy_cnt { 80 FA_OFDM, 81 FA_CCK, 82 FA_TOTAL, 83 CCA_OFDM, 84 CCA_CCK, 85 CCA_ALL, 86 CRC32_OK_VHT, 87 CRC32_OK_HT, 88 CRC32_OK_LEGACY, 89 CRC32_OK_CCK, 90 CRC32_ERROR_VHT, 91 CRC32_ERROR_HT, 92 CRC32_ERROR_LEGACY, 93 CRC32_ERROR_CCK, 94 }; 95 u32 rtw_phydm_get_phy_cnt(_adapter *adapter, enum phy_cnt cnt); 96 #if ((RTL8822B_SUPPORT == 1) || (RTL8821C_SUPPORT == 1) || (RTL8814B_SUPPORT == 1) || (RTL8822C_SUPPORT == 1)) 97 void rtw_phydm_iqk_trigger(_adapter *adapter); 98 #endif 99 void rtw_phydm_read_efuse(_adapter *adapter); 100 bool rtw_phydm_set_crystal_cap(_adapter *adapter, u8 crystal_cap); 101 102 #ifdef CONFIG_SUPPORT_DYNAMIC_TXPWR 103 void rtw_phydm_set_dyntxpwr(_adapter *adapter, u8 *desc, u8 mac_id); 104 #endif 105 106 #ifdef CONFIG_LPS_PG 107 void rtw_phydm_lps_pg_hdl(_adapter *adapter, struct sta_info *sta, bool in_lpspg); 108 #endif 109 #ifdef CONFIG_LPS_PWR_TRACKING 110 void rtw_phydm_pwr_tracking_directly(_adapter *adapter); 111 #endif 112 113 #ifdef CONFIG_CTRL_TXSS_BY_TP 114 void rtw_phydm_trx_cfg(_adapter *adapter, bool tx_1ss); 115 #endif 116 117 #endif /* __HAL_DM_H__ */ 118