545-ath9k_ani_ws_detect.patch 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
  2. +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
  3. @@ -954,55 +954,6 @@ static bool ar5008_hw_ani_control_new(st
  4. * on == 0 means more noise imm
  5. */
  6. u32 on = param ? 1 : 0;
  7. - /*
  8. - * make register setting for default
  9. - * (weak sig detect ON) come from INI file
  10. - */
  11. - int m1ThreshLow = on ?
  12. - aniState->iniDef.m1ThreshLow : m1ThreshLow_off;
  13. - int m2ThreshLow = on ?
  14. - aniState->iniDef.m2ThreshLow : m2ThreshLow_off;
  15. - int m1Thresh = on ?
  16. - aniState->iniDef.m1Thresh : m1Thresh_off;
  17. - int m2Thresh = on ?
  18. - aniState->iniDef.m2Thresh : m2Thresh_off;
  19. - int m2CountThr = on ?
  20. - aniState->iniDef.m2CountThr : m2CountThr_off;
  21. - int m2CountThrLow = on ?
  22. - aniState->iniDef.m2CountThrLow : m2CountThrLow_off;
  23. - int m1ThreshLowExt = on ?
  24. - aniState->iniDef.m1ThreshLowExt : m1ThreshLowExt_off;
  25. - int m2ThreshLowExt = on ?
  26. - aniState->iniDef.m2ThreshLowExt : m2ThreshLowExt_off;
  27. - int m1ThreshExt = on ?
  28. - aniState->iniDef.m1ThreshExt : m1ThreshExt_off;
  29. - int m2ThreshExt = on ?
  30. - aniState->iniDef.m2ThreshExt : m2ThreshExt_off;
  31. -
  32. - REG_RMW_FIELD(ah, AR_PHY_SFCORR_LOW,
  33. - AR_PHY_SFCORR_LOW_M1_THRESH_LOW,
  34. - m1ThreshLow);
  35. - REG_RMW_FIELD(ah, AR_PHY_SFCORR_LOW,
  36. - AR_PHY_SFCORR_LOW_M2_THRESH_LOW,
  37. - m2ThreshLow);
  38. - REG_RMW_FIELD(ah, AR_PHY_SFCORR,
  39. - AR_PHY_SFCORR_M1_THRESH, m1Thresh);
  40. - REG_RMW_FIELD(ah, AR_PHY_SFCORR,
  41. - AR_PHY_SFCORR_M2_THRESH, m2Thresh);
  42. - REG_RMW_FIELD(ah, AR_PHY_SFCORR,
  43. - AR_PHY_SFCORR_M2COUNT_THR, m2CountThr);
  44. - REG_RMW_FIELD(ah, AR_PHY_SFCORR_LOW,
  45. - AR_PHY_SFCORR_LOW_M2COUNT_THR_LOW,
  46. - m2CountThrLow);
  47. -
  48. - REG_RMW_FIELD(ah, AR_PHY_SFCORR_EXT,
  49. - AR_PHY_SFCORR_EXT_M1_THRESH_LOW, m1ThreshLowExt);
  50. - REG_RMW_FIELD(ah, AR_PHY_SFCORR_EXT,
  51. - AR_PHY_SFCORR_EXT_M2_THRESH_LOW, m2ThreshLowExt);
  52. - REG_RMW_FIELD(ah, AR_PHY_SFCORR_EXT,
  53. - AR_PHY_SFCORR_EXT_M1_THRESH, m1ThreshExt);
  54. - REG_RMW_FIELD(ah, AR_PHY_SFCORR_EXT,
  55. - AR_PHY_SFCORR_EXT_M2_THRESH, m2ThreshExt);
  56. if (on)
  57. REG_SET_BIT(ah, AR_PHY_SFCORR_LOW,
  58. --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
  59. +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
  60. @@ -42,20 +42,6 @@ static const int cycpwrThr1_table[] =
  61. /* level: 0 1 2 3 4 5 6 7 8 */
  62. { -6, -4, -2, 0, 2, 4, 6, 8 }; /* lvl 0-7, default 3 */
  63. -/*
  64. - * register values to turn OFDM weak signal detection OFF
  65. - */
  66. -static const int m1ThreshLow_off = 127;
  67. -static const int m2ThreshLow_off = 127;
  68. -static const int m1Thresh_off = 127;
  69. -static const int m2Thresh_off = 127;
  70. -static const int m2CountThr_off = 31;
  71. -static const int m2CountThrLow_off = 63;
  72. -static const int m1ThreshLowExt_off = 127;
  73. -static const int m2ThreshLowExt_off = 127;
  74. -static const int m1ThreshExt_off = 127;
  75. -static const int m2ThreshExt_off = 127;
  76. -
  77. static const u8 ofdm2pwr[] = {
  78. ALL_TARGET_LEGACY_6_24,
  79. ALL_TARGET_LEGACY_6_24,
  80. @@ -1095,11 +1081,6 @@ static bool ar9003_hw_ani_control(struct
  81. struct ath_common *common = ath9k_hw_common(ah);
  82. struct ath9k_channel *chan = ah->curchan;
  83. struct ar5416AniState *aniState = &ah->ani;
  84. - int m1ThreshLow, m2ThreshLow;
  85. - int m1Thresh, m2Thresh;
  86. - int m2CountThr, m2CountThrLow;
  87. - int m1ThreshLowExt, m2ThreshLowExt;
  88. - int m1ThreshExt, m2ThreshExt;
  89. s32 value, value2;
  90. switch (cmd & ah->ani_function) {
  91. @@ -1113,61 +1094,6 @@ static bool ar9003_hw_ani_control(struct
  92. */
  93. u32 on = param ? 1 : 0;
  94. - if (AR_SREV_9462(ah) || AR_SREV_9565(ah))
  95. - goto skip_ws_det;
  96. -
  97. - m1ThreshLow = on ?
  98. - aniState->iniDef.m1ThreshLow : m1ThreshLow_off;
  99. - m2ThreshLow = on ?
  100. - aniState->iniDef.m2ThreshLow : m2ThreshLow_off;
  101. - m1Thresh = on ?
  102. - aniState->iniDef.m1Thresh : m1Thresh_off;
  103. - m2Thresh = on ?
  104. - aniState->iniDef.m2Thresh : m2Thresh_off;
  105. - m2CountThr = on ?
  106. - aniState->iniDef.m2CountThr : m2CountThr_off;
  107. - m2CountThrLow = on ?
  108. - aniState->iniDef.m2CountThrLow : m2CountThrLow_off;
  109. - m1ThreshLowExt = on ?
  110. - aniState->iniDef.m1ThreshLowExt : m1ThreshLowExt_off;
  111. - m2ThreshLowExt = on ?
  112. - aniState->iniDef.m2ThreshLowExt : m2ThreshLowExt_off;
  113. - m1ThreshExt = on ?
  114. - aniState->iniDef.m1ThreshExt : m1ThreshExt_off;
  115. - m2ThreshExt = on ?
  116. - aniState->iniDef.m2ThreshExt : m2ThreshExt_off;
  117. -
  118. - REG_RMW_FIELD(ah, AR_PHY_SFCORR_LOW,
  119. - AR_PHY_SFCORR_LOW_M1_THRESH_LOW,
  120. - m1ThreshLow);
  121. - REG_RMW_FIELD(ah, AR_PHY_SFCORR_LOW,
  122. - AR_PHY_SFCORR_LOW_M2_THRESH_LOW,
  123. - m2ThreshLow);
  124. - REG_RMW_FIELD(ah, AR_PHY_SFCORR,
  125. - AR_PHY_SFCORR_M1_THRESH,
  126. - m1Thresh);
  127. - REG_RMW_FIELD(ah, AR_PHY_SFCORR,
  128. - AR_PHY_SFCORR_M2_THRESH,
  129. - m2Thresh);
  130. - REG_RMW_FIELD(ah, AR_PHY_SFCORR,
  131. - AR_PHY_SFCORR_M2COUNT_THR,
  132. - m2CountThr);
  133. - REG_RMW_FIELD(ah, AR_PHY_SFCORR_LOW,
  134. - AR_PHY_SFCORR_LOW_M2COUNT_THR_LOW,
  135. - m2CountThrLow);
  136. - REG_RMW_FIELD(ah, AR_PHY_SFCORR_EXT,
  137. - AR_PHY_SFCORR_EXT_M1_THRESH_LOW,
  138. - m1ThreshLowExt);
  139. - REG_RMW_FIELD(ah, AR_PHY_SFCORR_EXT,
  140. - AR_PHY_SFCORR_EXT_M2_THRESH_LOW,
  141. - m2ThreshLowExt);
  142. - REG_RMW_FIELD(ah, AR_PHY_SFCORR_EXT,
  143. - AR_PHY_SFCORR_EXT_M1_THRESH,
  144. - m1ThreshExt);
  145. - REG_RMW_FIELD(ah, AR_PHY_SFCORR_EXT,
  146. - AR_PHY_SFCORR_EXT_M2_THRESH,
  147. - m2ThreshExt);
  148. -skip_ws_det:
  149. if (on)
  150. REG_SET_BIT(ah, AR_PHY_SFCORR_LOW,
  151. AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW);