halphyrf_ap.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
  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. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
  17. *
  18. *
  19. ******************************************************************************/
  20. #ifndef __HAL_PHY_RF_H__
  21. #define __HAL_PHY_RF_H__
  22. #include "phydm_powertracking_ap.h"
  23. #if (RTL8814A_SUPPORT == 1)
  24. #include "rtl8814a/phydm_iqk_8814a.h"
  25. #endif
  26. #if (RTL8822B_SUPPORT == 1)
  27. #include "rtl8822b/phydm_iqk_8822b.h"
  28. #endif
  29. #if (RTL8821C_SUPPORT == 1)
  30. #include "rtl8822b/phydm_iqk_8821c.h"
  31. #endif
  32. enum pwrtrack_method {
  33. BBSWING,
  34. TXAGC,
  35. MIX_MODE,
  36. TSSI_MODE
  37. };
  38. typedef void (*func_set_pwr)(void *, enum pwrtrack_method, u8, u8);
  39. typedef void(*func_iqk)(void *, u8, u8, u8);
  40. typedef void (*func_lck)(void *);
  41. /* refine by YuChen for 8814A */
  42. typedef void (*func_swing)(void *, u8 **, u8 **, u8 **, u8 **);
  43. typedef void (*func_swing8814only)(void *, u8 **, u8 **, u8 **, u8 **);
  44. typedef void (*func_all_swing)(void *, u8 **, u8 **, u8 **, u8 **, u8 **, u8 **, u8 **, u8 **);
  45. struct _TXPWRTRACK_CFG {
  46. u8 swing_table_size_cck;
  47. u8 swing_table_size_ofdm;
  48. u8 threshold_iqk;
  49. u8 threshold_dpk;
  50. u8 average_thermal_num;
  51. u8 rf_path_count;
  52. u32 thermal_reg_addr;
  53. func_set_pwr odm_tx_pwr_track_set_pwr;
  54. func_iqk do_iqk;
  55. func_lck phy_lc_calibrate;
  56. func_swing get_delta_swing_table;
  57. func_swing8814only get_delta_swing_table8814only;
  58. func_all_swing get_delta_all_swing_table;
  59. };
  60. void
  61. configure_txpower_track(
  62. void *p_dm_void,
  63. struct _TXPWRTRACK_CFG *p_config
  64. );
  65. void
  66. odm_txpowertracking_callback_thermal_meter(
  67. #if (DM_ODM_SUPPORT_TYPE & ODM_AP)
  68. void *p_dm_void
  69. #else
  70. struct _ADAPTER *adapter
  71. #endif
  72. );
  73. #if (RTL8192E_SUPPORT == 1)
  74. void
  75. odm_txpowertracking_callback_thermal_meter_92e(
  76. #if (DM_ODM_SUPPORT_TYPE & ODM_AP)
  77. void *p_dm_void
  78. #else
  79. struct _ADAPTER *adapter
  80. #endif
  81. );
  82. #endif
  83. #if (RTL8814A_SUPPORT == 1)
  84. void
  85. odm_txpowertracking_callback_thermal_meter_jaguar_series2(
  86. #if (DM_ODM_SUPPORT_TYPE & ODM_AP)
  87. void *p_dm_void
  88. #else
  89. struct _ADAPTER *adapter
  90. #endif
  91. );
  92. #elif ODM_IC_11AC_SERIES_SUPPORT
  93. void
  94. odm_txpowertracking_callback_thermal_meter_jaguar_series(
  95. #if (DM_ODM_SUPPORT_TYPE & ODM_AP)
  96. void *p_dm_void
  97. #else
  98. struct _ADAPTER *adapter
  99. #endif
  100. );
  101. #elif (RTL8197F_SUPPORT == 1 || RTL8822B_SUPPORT == 1)
  102. void
  103. odm_txpowertracking_callback_thermal_meter_jaguar_series3(
  104. #if (DM_ODM_SUPPORT_TYPE & ODM_AP)
  105. void *p_dm_void
  106. #else
  107. struct _ADAPTER *adapter
  108. #endif
  109. );
  110. #endif
  111. #define IS_CCK_RATE(_rate) (ODM_MGN_1M == _rate || _rate == ODM_MGN_2M || _rate == ODM_MGN_5_5M || _rate == ODM_MGN_11M)
  112. #if (DM_ODM_SUPPORT_TYPE & ODM_WIN)
  113. #define MAX_TOLERANCE 5
  114. #define IQK_DELAY_TIME 1 /* ms */
  115. /*
  116. * BB/MAC/RF other monitor API
  117. * */
  118. void phy_set_monitor_mode8192c(struct _ADAPTER *p_adapter,
  119. boolean is_enable_monitor_mode);
  120. /*
  121. * IQ calibrate
  122. * */
  123. void
  124. phy_iq_calibrate_8192c(struct _ADAPTER *p_adapter,
  125. boolean is_recovery);
  126. /*
  127. * LC calibrate
  128. * */
  129. void
  130. phy_lc_calibrate_8192c(struct _ADAPTER *p_adapter);
  131. /*
  132. * AP calibrate
  133. * */
  134. void
  135. phy_ap_calibrate_8192c(struct _ADAPTER *p_adapter,
  136. s8 delta);
  137. #endif
  138. #define ODM_TARGET_CHNL_NUM_2G_5G 59
  139. void
  140. odm_reset_iqk_result(
  141. void *p_dm_void
  142. );
  143. u8
  144. odm_get_right_chnl_place_for_iqk(
  145. u8 chnl
  146. );
  147. void phydm_rf_init(void *p_dm_void);
  148. void phydm_rf_watchdog(void *p_dm_void);
  149. #endif /* #ifndef __HAL_PHY_RF_H__ */