OSDN Git Service

Add rtl8821ce driver version 5.5.2
[android-x86/external-kernel-drivers.git] / rtl8821ce / hal / hal_dm.h
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
21 void rtw_phydm_priv_init(_adapter *adapter);
22 void Init_ODM_ComInfo(_adapter *adapter);
23 void rtw_phydm_init(_adapter *adapter);
24
25 void rtw_hal_turbo_edca(_adapter *adapter);
26 u8 rtw_phydm_is_iqk_in_progress(_adapter *adapter);
27
28 void GetHalODMVar(
29         PADAPTER                                Adapter,
30         HAL_ODM_VARIABLE                eVariable,
31         PVOID                                   pValue1,
32         PVOID                                   pValue2);
33 void SetHalODMVar(
34         PADAPTER                                Adapter,
35         HAL_ODM_VARIABLE                eVariable,
36         PVOID                                   pValue1,
37         BOOLEAN                                 bSet);
38
39 void rtw_phydm_ra_registed(_adapter *adapter, struct sta_info *psta);
40
41 #ifdef CONFIG_DYNAMIC_SOML
42 void rtw_dyn_soml_byte_update(_adapter *adapter, u8 data_rate, u32 size);
43 void rtw_dyn_soml_para_set(_adapter *adapter, u8 train_num, u8 intvl,
44                         u8 period, u8 delay);
45 void rtw_dyn_soml_config(_adapter *adapter);
46 #endif
47 void rtw_phydm_watchdog(_adapter *adapter);
48
49 void rtw_hal_update_iqk_fw_offload_cap(_adapter *adapter);
50 void dump_sta_info(void *sel, struct sta_info *psta);
51 void dump_sta_traffic(void *sel, _adapter *adapter, struct sta_info *psta);
52
53 #ifdef CONFIG_DBG_RF_CAL
54 void rtw_hal_iqk_test(_adapter *adapter, bool recovery, bool clear, bool segment);
55 void rtw_hal_lck_test(_adapter *adapter);
56 #endif
57
58 s8 rtw_phydm_get_min_rssi(_adapter *adapter);
59 u8 rtw_phydm_get_cur_igi(_adapter *adapter);
60
61
62 #ifdef CONFIG_LPS_LCLK_WD_TIMER
63 extern void phydm_rssi_monitor_check(void *p_dm_void);
64
65 void rtw_phydm_wd_lps_lclk_hdl(_adapter *adapter);
66 void rtw_phydm_watchdog_in_lps_lclk(_adapter *adapter);
67 #endif
68
69 enum phy_cnt {
70         FA_OFDM,
71         FA_CCK,
72         FA_TOTAL,
73         CCA_OFDM,
74         CCA_CCK,
75         CCA_ALL,
76         CRC32_OK_VHT,
77         CRC32_OK_HT,
78         CRC32_OK_LEGACY,
79         CRC32_OK_CCK,
80         CRC32_ERROR_VHT,
81         CRC32_ERROR_HT,
82         CRC32_ERROR_LEGACY,
83         CRC32_ERROR_CCK,
84 };
85 u32 rtw_phydm_get_phy_cnt(_adapter *adapter, enum phy_cnt cnt);
86 #if ((RTL8822B_SUPPORT == 1) || (RTL8821C_SUPPORT == 1) || (RTL8814B_SUPPORT == 1))
87 void rtw_phydm_iqk_trigger(_adapter *adapter);
88 #endif
89 void rtw_phydm_read_efuse(_adapter *adapter);
90
91 #ifdef CONFIG_SUPPORT_DYNAMIC_TXPWR
92 void rtw_phydm_set_dyntxpwr(_adapter *adapter, u8 *desc, u8 mac_id);
93 #endif
94 #ifdef CONFIG_RTW_TX_2PATH_EN
95 void rtw_phydm_tx_2path_en(_adapter *adapter);
96 #endif
97 #ifdef CONFIG_LPS_PG
98 void rtw_phydm_lps_pg_hdl(_adapter *adapter, struct sta_info *sta, bool in_lpspg);
99 #endif
100 #endif /* __HAL_DM_H__ */