halphyrf_win.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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_kfree.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. #include "../mac/Halmac_type.h"
  29. #endif
  30. #include "phydm_powertracking_win.h"
  31. #if (RTL8821C_SUPPORT == 1)
  32. #include "rtl8821c/phydm_iqk_8821c.h"
  33. #endif
  34. enum spur_cal_method {
  35. PLL_RESET,
  36. AFE_PHASE_SEL
  37. };
  38. enum pwrtrack_method {
  39. BBSWING,
  40. TXAGC,
  41. MIX_MODE,
  42. TSSI_MODE,
  43. MIX_2G_TSSI_5G_MODE,
  44. MIX_5G_TSSI_2G_MODE
  45. };
  46. typedef void(*func_set_pwr)(void *, enum pwrtrack_method, u8, u8);
  47. typedef void(*func_iqk)(void *, u8, u8, u8);
  48. typedef void(*func_lck)(void *);
  49. typedef void(*func_swing)(void *, u8 **, u8 **, u8 **, u8 **);
  50. typedef void(*func_swing8814only)(void *, u8 **, u8 **, u8 **, u8 **);
  51. typedef void (*func_swing_xtal)(void *, s8 **, s8 **);
  52. typedef void (*func_set_xtal)(void *);
  53. typedef void(*func_all_swing)(void *, u8 **, u8 **, u8 **, u8 **, u8 **, u8 **, u8 **, u8 **);
  54. struct _TXPWRTRACK_CFG {
  55. u8 swing_table_size_cck;
  56. u8 swing_table_size_ofdm;
  57. u8 threshold_iqk;
  58. u8 threshold_dpk;
  59. u8 average_thermal_num;
  60. u8 rf_path_count;
  61. u32 thermal_reg_addr;
  62. func_set_pwr odm_tx_pwr_track_set_pwr;
  63. func_iqk do_iqk;
  64. func_lck phy_lc_calibrate;
  65. func_swing get_delta_swing_table;
  66. func_swing8814only get_delta_swing_table8814only;
  67. func_swing_xtal get_delta_swing_xtal_table;
  68. func_set_xtal odm_txxtaltrack_set_xtal;
  69. func_all_swing get_delta_all_swing_table;
  70. };
  71. void
  72. configure_txpower_track(
  73. struct PHY_DM_STRUCT *p_dm_odm,
  74. struct _TXPWRTRACK_CFG *p_config
  75. );
  76. void
  77. odm_clear_txpowertracking_state(
  78. struct PHY_DM_STRUCT *p_dm_odm
  79. );
  80. void
  81. odm_txpowertracking_callback_thermal_meter(
  82. #if (DM_ODM_SUPPORT_TYPE & ODM_AP)
  83. struct PHY_DM_STRUCT *p_dm_odm
  84. #else
  85. struct _ADAPTER *adapter
  86. #endif
  87. );
  88. #define ODM_TARGET_CHNL_NUM_2G_5G 59
  89. void
  90. odm_reset_iqk_result(
  91. struct PHY_DM_STRUCT *p_dm_odm
  92. );
  93. u8
  94. odm_get_right_chnl_place_for_iqk(
  95. u8 chnl
  96. );
  97. void odm_iq_calibrate(struct PHY_DM_STRUCT *p_dm_odm);
  98. void phydm_rf_init(struct PHY_DM_STRUCT *p_dm_odm);
  99. void phydm_rf_watchdog(struct PHY_DM_STRUCT *p_dm_odm);
  100. #endif /* #ifndef __HAL_PHY_RF_H__ */