phydm_hal_api8821c.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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 __INC_PHYDM_API_H_8821C__
  21. #define __INC_PHYDM_API_H_8821C__
  22. #if (RTL8821C_SUPPORT == 1)
  23. #define PHY_CONFIG_VERSION_8821C "3.1.20" /*2016.11.21 (HW user guide version: R03, SW user guide version: R01, Modification: R20)*/
  24. #define INVALID_RF_DATA 0xffffffff
  25. #define INVALID_TXAGC_DATA 0xff
  26. #define config_phydm_read_rf_check_8821c(data) (data != INVALID_RF_DATA)
  27. #define config_phydm_read_txagc_check_8821c(data) (data != INVALID_TXAGC_DATA)
  28. enum rf_set_8821c {
  29. SWITCH_TO_BTG = 0x0,
  30. SWITCH_TO_WLG = 0x1,
  31. SWITCH_TO_WLA = 0x2,
  32. SWITCH_TO_BT = 0x3
  33. };
  34. enum ant_num_8821c {
  35. SWITCH_TO_ANT1 = 0x0,
  36. SWITCH_TO_ANT2 = 0x1
  37. };
  38. enum ant_num_map_8821c {
  39. BOTH_AVAILABLE = 0x1,
  40. ONLY_ANT1 = 0x2,
  41. ONLY_ANT2 = 0x3,
  42. DONT_CARE = 0x4
  43. };
  44. u32
  45. config_phydm_read_rf_reg_8821c(
  46. struct PHY_DM_STRUCT *p_dm_odm,
  47. enum odm_rf_radio_path_e rf_path,
  48. u32 reg_addr,
  49. u32 bit_mask
  50. );
  51. boolean
  52. config_phydm_write_rf_reg_8821c(
  53. struct PHY_DM_STRUCT *p_dm_odm,
  54. enum odm_rf_radio_path_e rf_path,
  55. u32 reg_addr,
  56. u32 bit_mask,
  57. u32 data
  58. );
  59. boolean
  60. config_phydm_write_txagc_8821c(
  61. struct PHY_DM_STRUCT *p_dm_odm,
  62. u32 power_index,
  63. enum odm_rf_radio_path_e path,
  64. u8 hw_rate
  65. );
  66. u8
  67. config_phydm_read_txagc_8821c(
  68. struct PHY_DM_STRUCT *p_dm_odm,
  69. enum odm_rf_radio_path_e path,
  70. u8 hw_rate
  71. );
  72. boolean
  73. config_phydm_switch_band_8821c(
  74. struct PHY_DM_STRUCT *p_dm_odm,
  75. u8 central_ch
  76. );
  77. boolean
  78. config_phydm_switch_channel_8821c(
  79. struct PHY_DM_STRUCT *p_dm_odm,
  80. u8 central_ch
  81. );
  82. boolean
  83. config_phydm_switch_bandwidth_8821c(
  84. struct PHY_DM_STRUCT *p_dm_odm,
  85. u8 primary_ch_idx,
  86. enum odm_bw_e bandwidth
  87. );
  88. boolean
  89. config_phydm_switch_channel_bw_8821c(
  90. struct PHY_DM_STRUCT *p_dm_odm,
  91. u8 central_ch,
  92. u8 primary_ch_idx,
  93. enum odm_bw_e bandwidth
  94. );
  95. boolean
  96. config_phydm_trx_mode_8821c(
  97. struct PHY_DM_STRUCT *p_dm_odm,
  98. enum odm_rf_path_e tx_path,
  99. enum odm_rf_path_e rx_path,
  100. boolean is_tx2_path
  101. );
  102. boolean
  103. config_phydm_parameter_init_8821c(
  104. struct PHY_DM_STRUCT *p_dm_odm,
  105. enum odm_parameter_init_e type
  106. );
  107. void
  108. config_phydm_switch_rf_set_8821c(
  109. struct PHY_DM_STRUCT *p_dm_odm,
  110. u8 rf_set
  111. );
  112. void
  113. config_phydm_set_ant_path(
  114. struct PHY_DM_STRUCT *p_dm_odm,
  115. u8 rf_set,
  116. u8 ant_num
  117. );
  118. /* ======================================================================== */
  119. /* These following functions can be used for PHY DM only*/
  120. boolean
  121. phydm_write_txagc_1byte_8821c(
  122. struct PHY_DM_STRUCT *p_dm_odm,
  123. u32 power_index,
  124. enum odm_rf_radio_path_e path,
  125. u8 hw_rate
  126. );
  127. void
  128. phydm_init_hw_info_by_rfe_type_8821c(
  129. struct PHY_DM_STRUCT *p_dm_odm
  130. );
  131. void
  132. phydm_set_gnt_state_8821c(
  133. struct PHY_DM_STRUCT *p_dm_odm,
  134. boolean gnt_wl_state,
  135. boolean gnt_bt_state
  136. );
  137. /* ======================================================================== */
  138. u32
  139. query_phydm_trx_capability_8821c(
  140. struct PHY_DM_STRUCT *p_dm_odm
  141. );
  142. u32
  143. query_phydm_stbc_capability_8821c(
  144. struct PHY_DM_STRUCT *p_dm_odm
  145. );
  146. u32
  147. query_phydm_ldpc_capability_8821c(
  148. struct PHY_DM_STRUCT *p_dm_odm
  149. );
  150. u32
  151. query_phydm_txbf_parameters_8821c(
  152. struct PHY_DM_STRUCT *p_dm_odm
  153. );
  154. u32
  155. query_phydm_txbf_capability_8821c(
  156. struct PHY_DM_STRUCT *p_dm_odm
  157. );
  158. u8
  159. query_phydm_default_rf_set_8821c(
  160. struct PHY_DM_STRUCT *p_dm_odm
  161. );
  162. u8
  163. query_phydm_current_rf_set_8821c(
  164. struct PHY_DM_STRUCT *p_dm_odm
  165. );
  166. u8
  167. query_phydm_rfetype_8821c(
  168. struct PHY_DM_STRUCT *p_dm_odm
  169. );
  170. u8
  171. query_phydm_current_ant_num_8821c(
  172. struct PHY_DM_STRUCT *p_dm_odm
  173. );
  174. u8
  175. query_phydm_ant_num_map_8821c(
  176. struct PHY_DM_STRUCT *p_dm_odm
  177. );
  178. #endif /* RTL8821C_SUPPORT == 1 */
  179. #endif /* __INC_PHYDM_API_H_8821C__ */