Hal8812PhyCfg.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. *****************************************************************************/
  15. #ifndef __INC_HAL8812PHYCFG_H__
  16. #define __INC_HAL8812PHYCFG_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_QueryBBReg8812(IN PADAPTER Adapter,
  41. IN u32 RegAddr,
  42. IN u32 BitMask);
  43. void PHY_SetBBReg8812(IN PADAPTER Adapter,
  44. IN u32 RegAddr,
  45. IN u32 BitMask,
  46. IN u32 Data);
  47. u32 PHY_QueryRFReg8812(IN PADAPTER Adapter,
  48. IN enum rf_path eRFPath,
  49. IN u32 RegAddr,
  50. IN u32 BitMask);
  51. void PHY_SetRFReg8812(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_MACConfig8812(IN PADAPTER Adapter);
  61. int PHY_BBConfig8812(IN PADAPTER Adapter);
  62. void PHY_BB8812_Config_1T(IN PADAPTER Adapter);
  63. int PHY_RFConfig8812(IN PADAPTER Adapter);
  64. /* RF config */
  65. s32
  66. PHY_SwitchWirelessBand8812(
  67. IN PADAPTER Adapter,
  68. IN u8 Band
  69. );
  70. /*
  71. * BB TX Power R/W
  72. * */
  73. void PHY_GetTxPowerLevel8812(IN PADAPTER Adapter, OUT s32 *powerlevel);
  74. void PHY_SetTxPowerLevel8812(IN PADAPTER Adapter, IN u8 Channel);
  75. BOOLEAN PHY_UpdateTxPowerDbm8812(IN PADAPTER Adapter, IN int powerInDbm);
  76. u8 PHY_GetTxPowerIndex_8812A(
  77. IN PADAPTER pAdapter,
  78. IN enum rf_path RFPath,
  79. IN u8 Rate,
  80. IN u8 BandWidth,
  81. IN u8 Channel,
  82. struct txpwr_idx_comp *tic
  83. );
  84. u32 phy_get_tx_bb_swing_8812a(
  85. IN PADAPTER Adapter,
  86. IN BAND_TYPE Band,
  87. IN enum rf_path RFPath
  88. );
  89. VOID
  90. PHY_SetTxPowerIndex_8812A(
  91. IN PADAPTER Adapter,
  92. IN u32 PowerIndex,
  93. IN enum rf_path RFPath,
  94. IN u8 Rate
  95. );
  96. /*
  97. * channel switch related funciton
  98. * */
  99. VOID
  100. PHY_SetSwChnlBWMode8812(
  101. IN PADAPTER Adapter,
  102. IN u8 channel,
  103. IN enum channel_width Bandwidth,
  104. IN u8 Offset40,
  105. IN u8 Offset80
  106. );
  107. /*
  108. * BB/MAC/RF other monitor API
  109. * */
  110. VOID
  111. phy_set_rf_path_switch_8812a(
  112. IN struct dm_struct *phydm,
  113. IN bool bMain
  114. );
  115. /*--------------------------Exported Function prototype---------------------*/
  116. #endif /* __INC_HAL8192CPHYCFG_H */