Hal8812PhyCfg.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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_HAL8812PHYCFG_H__
  21. #define __INC_HAL8812PHYCFG_H__
  22. /*--------------------------Define Parameters-------------------------------*/
  23. #define LOOP_LIMIT 5
  24. #define MAX_STALL_TIME 50 //us
  25. #define AntennaDiversityValue 0x80 //(Adapter->bSoftwareAntennaDiversity ? 0x00:0x80)
  26. #define MAX_TXPWR_IDX_NMODE_92S 63
  27. #define Reset_Cnt_Limit 3
  28. #ifdef CONFIG_PCI_HCI
  29. #define MAX_AGGR_NUM 0x0B
  30. #else
  31. #define MAX_AGGR_NUM 0x07
  32. #endif // CONFIG_PCI_HCI
  33. /*--------------------------Define Parameters-------------------------------*/
  34. /*------------------------------Define structure----------------------------*/
  35. /* BB/RF related */
  36. /*------------------------------Define structure----------------------------*/
  37. /*------------------------Export global variable----------------------------*/
  38. /*------------------------Export global variable----------------------------*/
  39. /*------------------------Export Marco Definition---------------------------*/
  40. /*------------------------Export Marco Definition---------------------------*/
  41. /*--------------------------Exported Function prototype---------------------*/
  42. //
  43. // BB and RF register read/write
  44. //
  45. u32 PHY_QueryBBReg8812( IN PADAPTER Adapter,
  46. IN u32 RegAddr,
  47. IN u32 BitMask );
  48. void PHY_SetBBReg8812( IN PADAPTER Adapter,
  49. IN u32 RegAddr,
  50. IN u32 BitMask,
  51. IN u32 Data );
  52. u32 PHY_QueryRFReg8812( IN PADAPTER Adapter,
  53. IN u8 eRFPath,
  54. IN u32 RegAddr,
  55. IN u32 BitMask );
  56. void PHY_SetRFReg8812( IN PADAPTER Adapter,
  57. IN u8 eRFPath,
  58. IN u32 RegAddr,
  59. IN u32 BitMask,
  60. IN u32 Data );
  61. //
  62. // Initialization related function
  63. //
  64. /* MAC/BB/RF HAL config */
  65. int PHY_MACConfig8812(IN PADAPTER Adapter );
  66. int PHY_BBConfig8812(IN PADAPTER Adapter );
  67. void PHY_BB8812_Config_1T(IN PADAPTER Adapter );
  68. int PHY_RFConfig8812(IN PADAPTER Adapter );
  69. VOID
  70. PHY_InitPowerLimitTable(
  71. IN PDM_ODM_T pDM_Odm
  72. );
  73. VOID
  74. PHY_ConvertPowerLimitToPowerIndex(
  75. IN PADAPTER Adapter
  76. );
  77. VOID
  78. PHY_SetPowerLimitTableValue(
  79. IN PDM_ODM_T pDM_Odm,
  80. IN s8* Regulation,
  81. IN s8* Band,
  82. IN s8* Bandwidth,
  83. IN s8* RateSection,
  84. IN s8* RfPath,
  85. IN s8* Channel,
  86. IN s8* PowerLimit
  87. );
  88. u8
  89. PHY_GetPowerLimitValue(
  90. IN PADAPTER Adapter,
  91. IN u32 RegPwrTblSel,
  92. IN BAND_TYPE Band,
  93. IN CHANNEL_WIDTH Bandwidth,
  94. IN RF_PATH RfPath,
  95. IN u8 DataRate,
  96. IN u8 Channel
  97. );
  98. /* RF config */
  99. s32
  100. PHY_SwitchWirelessBand8812(
  101. IN PADAPTER Adapter,
  102. IN u8 Band
  103. );
  104. //
  105. // BB TX Power R/W
  106. //
  107. void PHY_GetTxPowerLevel8812( IN PADAPTER Adapter, OUT u32* powerlevel );
  108. void PHY_SetTxPowerLevel8812( IN PADAPTER Adapter, IN u8 Channel );
  109. BOOLEAN PHY_UpdateTxPowerDbm8812( IN PADAPTER Adapter, IN int powerInDbm );
  110. u32 PHY_GetTxPowerIndex_8812A(
  111. IN PADAPTER pAdapter,
  112. IN u8 RFPath,
  113. IN u8 Rate,
  114. IN CHANNEL_WIDTH BandWidth,
  115. IN u8 Channel
  116. );
  117. u32 PHY_GetTxBBSwing_8812A(
  118. IN PADAPTER Adapter,
  119. IN BAND_TYPE Band,
  120. IN u8 RFPath
  121. );
  122. VOID
  123. PHY_SetTxPowerIndex_8812A(
  124. IN PADAPTER Adapter,
  125. IN u4Byte PowerIndex,
  126. IN u1Byte RFPath,
  127. IN u1Byte Rate
  128. );
  129. //
  130. // Switch bandwidth for 8192S
  131. //
  132. VOID
  133. PHY_SetBWMode8812(
  134. IN PADAPTER pAdapter,
  135. IN CHANNEL_WIDTH Bandwidth,
  136. IN u8 Offset
  137. );
  138. //
  139. // channel switch related funciton
  140. //
  141. VOID
  142. PHY_SwChnl8812(
  143. IN PADAPTER Adapter,
  144. IN u8 channel
  145. );
  146. VOID
  147. PHY_SetSwChnlBWMode8812(
  148. IN PADAPTER Adapter,
  149. IN u8 channel,
  150. IN CHANNEL_WIDTH Bandwidth,
  151. IN u8 Offset40,
  152. IN u8 Offset80
  153. );
  154. //
  155. // BB/MAC/RF other monitor API
  156. //
  157. VOID
  158. PHY_SetRFPathSwitch_8812A(
  159. IN PADAPTER pAdapter,
  160. IN BOOLEAN bMain
  161. );
  162. VOID
  163. storePwrIndexDiffRateOffset(
  164. IN PADAPTER Adapter,
  165. IN u32 RegAddr,
  166. IN u32 BitMask,
  167. IN u32 Data
  168. );
  169. /*--------------------------Exported Function prototype---------------------*/
  170. #endif // __INC_HAL8192CPHYCFG_H