phydm_cck_pd.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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 __PHYDM_CCK_PD_H__
  26. #define __PHYDM_CCK_PD_H__
  27. #define CCK_PD_VERSION "3.0"
  28. /*@
  29. * 1 ============================================================
  30. * 1 Definition
  31. * 1 ============================================================
  32. */
  33. #define CCK_FA_MA_RESET 0xffffffff
  34. /*@Run time flag of CCK_PD HW type*/
  35. #define CCK_PD_IC_TYPE1 (ODM_RTL8188E | ODM_RTL8812 | ODM_RTL8821 |\
  36. ODM_RTL8192E | ODM_RTL8723B | ODM_RTL8814A |\
  37. ODM_RTL8881A | ODM_RTL8822B | ODM_RTL8703B |\
  38. ODM_RTL8195A | ODM_RTL8188F)
  39. #define CCK_PD_IC_TYPE2 (ODM_RTL8197F | ODM_RTL8821C | ODM_RTL8723D |\
  40. ODM_RTL8710B | ODM_RTL8195B) /*extend 0xaaa*/
  41. #define CCK_PD_IC_TYPE3 ODM_RTL8192F /*@extend for different bw & path*/
  42. #define CCK_PD_IC_TYPE4 ODM_IC_JGR3_SERIES /*@extend for different bw & path*/
  43. /*@Compile time flag of CCK_PD HW type*/
  44. #if (RTL8188E_SUPPORT || RTL8812A_SUPPORT || RTL8821A_SUPPORT ||\
  45. RTL8192E_SUPPORT || RTL8723B_SUPPORT || RTL8814A_SUPPORT ||\
  46. RTL8881A_SUPPORT || RTL8822B_SUPPORT || RTL8703B_SUPPORT ||\
  47. RTL8195A_SUPPORT || RTL8188F_SUPPORT)
  48. #define PHYDM_COMPILE_CCKPD_TYPE1 /*@only 0xa0a*/
  49. #endif
  50. #if (RTL8197F_SUPPORT || RTL8821C_SUPPORT || RTL8723D_SUPPORT ||\
  51. RTL8710B_SUPPORT || RTL8195B_SUPPORT)
  52. #define PHYDM_COMPILE_CCKPD_TYPE2 /*@extend 0xaaa*/
  53. #endif
  54. #if (RTL8192F_SUPPORT)
  55. #define PHYDM_COMPILE_CCKPD_TYPE3 /*@extend for different & path*/
  56. #endif
  57. #ifdef PHYDM_IC_JGR3_SERIES_SUPPORT
  58. #define PHYDM_COMPILE_CCKPD_TYPE4 /*@extend for different bw & path*/
  59. #endif
  60. /*@
  61. * 1 ============================================================
  62. * 1 enumeration
  63. * 1 ============================================================
  64. */
  65. enum cckpd_lv {
  66. CCK_PD_LV_INIT = 0xff,
  67. CCK_PD_LV_0 = 0,
  68. CCK_PD_LV_1 = 1,
  69. CCK_PD_LV_2 = 2,
  70. CCK_PD_LV_3 = 3,
  71. CCK_PD_LV_4 = 4,
  72. CCK_PD_LV_MAX = 5
  73. };
  74. enum cckpd_mode {
  75. CCK_BW20_1R = 0,
  76. CCK_BW20_2R = 1,
  77. CCK_BW20_3R = 2,
  78. CCK_BW20_4R = 3,
  79. CCK_BW40_1R = 4,
  80. CCK_BW40_2R = 5,
  81. CCK_BW40_3R = 6,
  82. CCK_BW40_4R = 7
  83. };
  84. /*@
  85. * 1 ============================================================
  86. * 1 structure
  87. * 1 ============================================================
  88. */
  89. #ifdef PHYDM_SUPPORT_CCKPD
  90. struct phydm_cckpd_struct {
  91. u8 cckpd_hw_type;
  92. u8 cur_cck_cca_thres; /*@current cck_pd value 0xa0a*/
  93. u32 cck_fa_ma;
  94. u8 rvrt_val;
  95. u8 pause_lv;
  96. u8 cck_n_rx;
  97. enum channel_width cck_bw;
  98. enum cckpd_lv cck_pd_lv;
  99. #ifdef PHYDM_COMPILE_CCKPD_TYPE2
  100. u8 cck_cca_th_aaa; /*@current cs_ratio value 0xaaa*/
  101. u8 aaa_default; /*@Init cs_ratio value - 0xaaa*/
  102. #endif
  103. #ifdef PHYDM_COMPILE_CCKPD_TYPE3
  104. /*Default value*/
  105. u8 cck_pd_20m_1r;
  106. u8 cck_pd_20m_2r;
  107. u8 cck_pd_40m_1r;
  108. u8 cck_pd_40m_2r;
  109. u8 cck_cs_ratio_20m_1r;
  110. u8 cck_cs_ratio_20m_2r;
  111. u8 cck_cs_ratio_40m_1r;
  112. u8 cck_cs_ratio_40m_2r;
  113. /*Current value*/
  114. u8 cur_cck_pd_20m_1r;
  115. u8 cur_cck_pd_20m_2r;
  116. u8 cur_cck_pd_40m_1r;
  117. u8 cur_cck_pd_40m_2r;
  118. u8 cur_cck_cs_ratio_20m_1r;
  119. u8 cur_cck_cs_ratio_20m_2r;
  120. u8 cur_cck_cs_ratio_40m_1r;
  121. u8 cur_cck_cs_ratio_40m_2r;
  122. #endif
  123. #ifdef PHYDM_COMPILE_CCKPD_TYPE4
  124. /*@[bw][nrx][0:PD/1:CS][lv]*/
  125. u8 cck_pd_table_jgr3[2][4][2][CCK_PD_LV_MAX];
  126. #endif
  127. };
  128. #endif
  129. /*@
  130. * 1 ============================================================
  131. * 1 function prototype
  132. * 1 ============================================================
  133. */
  134. void phydm_set_cckpd_val(void *dm_void, u32 *val_buf, u8 val_len);
  135. void phydm_cck_pd_th(void *dm_void);
  136. void phydm_cck_pd_init(void *dm_void);
  137. #endif