305-ath9k-clean-up-ANI-per-channel-pointer-checking.patch 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. From: Miaoqing Pan <miaoqing@codeaurora.org>
  2. Date: Fri, 15 Jan 2016 18:17:18 +0800
  3. Subject: [PATCH] ath9k: clean up ANI per-channel pointer checking
  4. commit c24bd3620c50 ("ath9k: Do not maintain ANI state per-channel")
  5. removed per-channel handling, the code to check 'curchan' also
  6. should be removed as never used.
  7. Signed-off-by: Miaoqing Pan <miaoqing@codeaurora.org>
  8. ---
  9. --- a/drivers/net/wireless/ath/ath9k/ani.c
  10. +++ b/drivers/net/wireless/ath/ath9k/ani.c
  11. @@ -126,12 +126,8 @@ static void ath9k_hw_update_mibstats(str
  12. static void ath9k_ani_restart(struct ath_hw *ah)
  13. {
  14. - struct ar5416AniState *aniState;
  15. -
  16. - if (!ah->curchan)
  17. - return;
  18. + struct ar5416AniState *aniState = &ah->ani;
  19. - aniState = &ah->ani;
  20. aniState->listenTime = 0;
  21. ENABLE_REGWRITE_BUFFER(ah);
  22. @@ -221,12 +217,7 @@ static void ath9k_hw_set_ofdm_nil(struct
  23. static void ath9k_hw_ani_ofdm_err_trigger(struct ath_hw *ah)
  24. {
  25. - struct ar5416AniState *aniState;
  26. -
  27. - if (!ah->curchan)
  28. - return;
  29. -
  30. - aniState = &ah->ani;
  31. + struct ar5416AniState *aniState = &ah->ani;
  32. if (aniState->ofdmNoiseImmunityLevel < ATH9K_ANI_OFDM_MAX_LEVEL)
  33. ath9k_hw_set_ofdm_nil(ah, aniState->ofdmNoiseImmunityLevel + 1, false);
  34. @@ -281,12 +272,7 @@ static void ath9k_hw_set_cck_nil(struct
  35. static void ath9k_hw_ani_cck_err_trigger(struct ath_hw *ah)
  36. {
  37. - struct ar5416AniState *aniState;
  38. -
  39. - if (!ah->curchan)
  40. - return;
  41. -
  42. - aniState = &ah->ani;
  43. + struct ar5416AniState *aniState = &ah->ani;
  44. if (aniState->cckNoiseImmunityLevel < ATH9K_ANI_CCK_MAX_LEVEL)
  45. ath9k_hw_set_cck_nil(ah, aniState->cckNoiseImmunityLevel + 1,
  46. @@ -299,9 +285,7 @@ static void ath9k_hw_ani_cck_err_trigger
  47. */
  48. static void ath9k_hw_ani_lower_immunity(struct ath_hw *ah)
  49. {
  50. - struct ar5416AniState *aniState;
  51. -
  52. - aniState = &ah->ani;
  53. + struct ar5416AniState *aniState = &ah->ani;
  54. /* lower OFDM noise immunity */
  55. if (aniState->ofdmNoiseImmunityLevel > 0 &&
  56. @@ -329,7 +313,7 @@ void ath9k_ani_reset(struct ath_hw *ah,
  57. struct ath_common *common = ath9k_hw_common(ah);
  58. int ofdm_nil, cck_nil;
  59. - if (!ah->curchan)
  60. + if (!chan)
  61. return;
  62. BUG_ON(aniState == NULL);
  63. @@ -416,14 +400,10 @@ static bool ath9k_hw_ani_read_counters(s
  64. void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan)
  65. {
  66. - struct ar5416AniState *aniState;
  67. + struct ar5416AniState *aniState = &ah->ani;
  68. struct ath_common *common = ath9k_hw_common(ah);
  69. u32 ofdmPhyErrRate, cckPhyErrRate;
  70. - if (!ah->curchan)
  71. - return;
  72. -
  73. - aniState = &ah->ani;
  74. if (!ath9k_hw_ani_read_counters(ah))
  75. return;