Hal8192EPhyCfg.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2012 - 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. *****************************************************************************/
  15. #ifndef __INC_HAL8192EPHYCFG_H__
  16. #define __INC_HAL8192EPHYCFG_H__
  17. /*--------------------------Define Parameters-------------------------------*/
  18. #define LOOP_LIMIT 5
  19. #define MAX_STALL_TIME 50 /* us */
  20. #define AntennaDiversityValue 0x80 /* (Adapter->bSoftwareAntennaDiversity ? 0x00 : 0x80) */
  21. #define MAX_TXPWR_IDX_NMODE_92S 63
  22. #define Reset_Cnt_Limit 3
  23. #ifdef CONFIG_PCI_HCI
  24. #define MAX_AGGR_NUM 0x0B
  25. #else
  26. #define MAX_AGGR_NUM 0x07
  27. #endif /* CONFIG_PCI_HCI */
  28. /*--------------------------Define Parameters-------------------------------*/
  29. /*------------------------------Define structure----------------------------*/
  30. /* BB/RF related */
  31. /*------------------------------Define structure----------------------------*/
  32. /*------------------------Export global variable----------------------------*/
  33. /*------------------------Export global variable----------------------------*/
  34. /*------------------------Export Marco Definition---------------------------*/
  35. /*------------------------Export Marco Definition---------------------------*/
  36. /*--------------------------Exported Function prototype---------------------*/
  37. /*
  38. * BB and RF register read/write
  39. * */
  40. u32 PHY_QueryBBReg8192E(IN PADAPTER Adapter,
  41. IN u32 RegAddr,
  42. IN u32 BitMask);
  43. void PHY_SetBBReg8192E(IN PADAPTER Adapter,
  44. IN u32 RegAddr,
  45. IN u32 BitMask,
  46. IN u32 Data);
  47. u32 PHY_QueryRFReg8192E(IN PADAPTER Adapter,
  48. IN enum rf_path eRFPath,
  49. IN u32 RegAddr,
  50. IN u32 BitMask);
  51. void PHY_SetRFReg8192E(IN PADAPTER Adapter,
  52. IN enum rf_path eRFPath,
  53. IN u32 RegAddr,
  54. IN u32 BitMask,
  55. IN u32 Data);
  56. /*
  57. * Initialization related function
  58. *
  59. * MAC/BB/RF HAL config */
  60. int PHY_MACConfig8192E(IN PADAPTER Adapter);
  61. int PHY_BBConfig8192E(IN PADAPTER Adapter);
  62. int PHY_RFConfig8192E(IN PADAPTER Adapter);
  63. /* RF config */
  64. /*
  65. * BB TX Power R/W
  66. * */
  67. void PHY_GetTxPowerLevel8192E(IN PADAPTER Adapter, OUT s32 *powerlevel);
  68. void PHY_SetTxPowerLevel8192E(IN PADAPTER Adapter, IN u8 channel);
  69. BOOLEAN PHY_UpdateTxPowerDbm8192E(IN PADAPTER Adapter, IN int powerInDbm);
  70. VOID
  71. PHY_SetTxPowerIndex_8192E(
  72. IN PADAPTER Adapter,
  73. IN u32 PowerIndex,
  74. IN enum rf_path RFPath,
  75. IN u8 Rate
  76. );
  77. u8
  78. PHY_GetTxPowerIndex_8192E(
  79. IN PADAPTER pAdapter,
  80. IN enum rf_path RFPath,
  81. IN u8 Rate,
  82. IN u8 BandWidth,
  83. IN u8 Channel,
  84. struct txpwr_idx_comp *tic
  85. );
  86. /*
  87. * channel switch related funciton
  88. * */
  89. VOID
  90. PHY_SetSwChnlBWMode8192E(
  91. IN PADAPTER Adapter,
  92. IN u8 channel,
  93. IN enum channel_width Bandwidth,
  94. IN u8 Offset40,
  95. IN u8 Offset80
  96. );
  97. VOID
  98. PHY_SetRFEReg_8192E(
  99. IN PADAPTER Adapter
  100. );
  101. void
  102. phy_SpurCalibration_8192E(
  103. IN PADAPTER Adapter,
  104. IN enum spur_cal_method method
  105. );
  106. void PHY_SpurCalibration_8192E(IN PADAPTER Adapter);
  107. #ifdef CONFIG_SPUR_CAL_NBI
  108. void
  109. phy_SpurCalibration_8192E_NBI(
  110. IN PADAPTER Adapter
  111. );
  112. #endif
  113. /*
  114. * BB/MAC/RF other monitor API
  115. * */
  116. VOID
  117. phy_set_rf_path_switch_8192e(
  118. IN struct dm_struct *phydm,
  119. IN bool bMain
  120. );
  121. /*--------------------------Exported Function prototype---------------------*/
  122. #endif /* __INC_HAL8192CPHYCFG_H */