halphyrf_iot.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. * The full GNU General Public License is included in this distribution in the
  15. * file called LICENSE.
  16. *
  17. * Contact Information:
  18. * wlanfae <wlanfae@realtek.com>
  19. * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
  20. * Hsinchu 300, Taiwan.
  21. *
  22. * Larry Finger <Larry.Finger@lwfinger.net>
  23. *
  24. *****************************************************************************/
  25. #ifndef __HALPHYRF_H__
  26. #define __HALPHYRF_H__
  27. #include "halrf/halrf_kfree.h"
  28. #if (RTL8821C_SUPPORT == 1)
  29. #include "halrf/rtl8821c/halrf_iqk_8821c.h"
  30. #endif
  31. #if (RTL8195B_SUPPORT == 1)
  32. // #include "halrf/rtl8195b/halrf.h"
  33. #include "halrf/rtl8195b/halrf_iqk_8195b.h"
  34. #include "halrf/rtl8195b/halrf_txgapk_8195b.h"
  35. #include "halrf/rtl8195b/halrf_dpk_8195b.h"
  36. #endif
  37. #include "halrf/halrf_powertracking_iot.h"
  38. enum spur_cal_method {
  39. PLL_RESET,
  40. AFE_PHASE_SEL
  41. };
  42. enum pwrtrack_method {
  43. BBSWING,
  44. TXAGC,
  45. MIX_MODE,
  46. TSSI_MODE,
  47. MIX_2G_TSSI_5G_MODE,
  48. MIX_5G_TSSI_2G_MODE
  49. };
  50. typedef void (*func_set_pwr)(void *, enum pwrtrack_method, u8, u8);
  51. typedef void(*func_iqk)(void *, u8, u8, u8);
  52. typedef void (*func_lck)(void *);
  53. typedef void (*func_swing)(void *, u8 **, u8 **, u8 **, u8 **);
  54. typedef void (*func_swing8814only)(void *, u8 **, u8 **, u8 **, u8 **);
  55. typedef void(*func_swing_xtal)(void *, s8 **, s8 **);
  56. typedef void(*func_set_xtal)(void *);
  57. struct txpwrtrack_cfg {
  58. u8 swing_table_size_cck;
  59. u8 swing_table_size_ofdm;
  60. u8 threshold_iqk;
  61. u8 threshold_dpk;
  62. u8 average_thermal_num;
  63. u8 rf_path_count;
  64. u32 thermal_reg_addr;
  65. func_set_pwr odm_tx_pwr_track_set_pwr;
  66. func_iqk do_iqk;
  67. func_lck phy_lc_calibrate;
  68. func_swing get_delta_swing_table;
  69. func_swing8814only get_delta_swing_table8814only;
  70. func_swing_xtal get_delta_swing_xtal_table;
  71. func_set_xtal odm_txxtaltrack_set_xtal;
  72. };
  73. void
  74. configure_txpower_track(
  75. void *dm_void,
  76. struct txpwrtrack_cfg *config
  77. );
  78. void
  79. odm_clear_txpowertracking_state(
  80. void *dm_void
  81. );
  82. void
  83. odm_txpowertracking_callback_thermal_meter(
  84. #if (DM_ODM_SUPPORT_TYPE & ODM_AP)
  85. void *dm_void
  86. #elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
  87. void *dm
  88. #else
  89. void *adapter
  90. #endif
  91. );
  92. #define ODM_TARGET_CHNL_NUM_2G_5G 59
  93. void
  94. odm_reset_iqk_result(
  95. void *dm_void
  96. );
  97. u8
  98. odm_get_right_chnl_place_for_iqk(
  99. u8 chnl
  100. );
  101. void phydm_rf_init(void *dm_void);
  102. void phydm_rf_watchdog(void *dm_void);
  103. #endif /*#ifndef __HALPHYRF_H__*/