0072-ath9k-revert-temperature-compensation-support-patch-FS-111.patch 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Tue, 11 Oct 2016 02:54:27 +0200
  3. Subject: ath9k: revert temperature compensation support patch (FS#111)
  4. Signed-off-by: Felix Fietkau <nbd@nbd.name>
  5. Backport of LEDE 3e4d0e3e77dcf9b2116e5ed53f30e2bf53b1c6b7
  6. diff --git a/package/kernel/mac80211/patches/328-ath9k_hw-implement-temperature-compensation-support-.patch b/package/kernel/mac80211/patches/328-ath9k_hw-implement-temperature-compensation-support-.patch
  7. deleted file mode 100644
  8. index cff32ad47cb0b905d9cfa4eb021258b644b2a47a..0000000000000000000000000000000000000000
  9. --- a/package/kernel/mac80211/patches/328-ath9k_hw-implement-temperature-compensation-support-.patch
  10. +++ /dev/null
  11. @@ -1,97 +0,0 @@
  12. -From: Felix Fietkau <nbd@nbd.name>
  13. -Date: Mon, 11 Jul 2016 11:35:55 +0200
  14. -Subject: [PATCH] ath9k_hw: implement temperature compensation support for
  15. - AR9003+
  16. -
  17. -Signed-off-by: Felix Fietkau <nbd@nbd.name>
  18. ----
  19. -
  20. ---- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
  21. -+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
  22. -@@ -33,6 +33,7 @@ struct coeff {
  23. -
  24. - enum ar9003_cal_types {
  25. - IQ_MISMATCH_CAL = BIT(0),
  26. -+ TEMP_COMP_CAL = BIT(1),
  27. - };
  28. -
  29. - static void ar9003_hw_setup_calibration(struct ath_hw *ah,
  30. -@@ -58,6 +59,12 @@ static void ar9003_hw_setup_calibration(
  31. - /* Kick-off cal */
  32. - REG_SET_BIT(ah, AR_PHY_TIMING4, AR_PHY_TIMING4_DO_CAL);
  33. - break;
  34. -+ case TEMP_COMP_CAL:
  35. -+ ath_dbg(common, CALIBRATE,
  36. -+ "starting Temperature Compensation Calibration\n");
  37. -+ REG_SET_BIT(ah, AR_CH0_THERM, AR_CH0_THERM_LOCAL);
  38. -+ REG_SET_BIT(ah, AR_CH0_THERM, AR_CH0_THERM_START);
  39. -+ break;
  40. - default:
  41. - ath_err(common, "Invalid calibration type\n");
  42. - break;
  43. -@@ -86,7 +93,8 @@ static bool ar9003_hw_per_calibration(st
  44. - /*
  45. - * Accumulate cal measures for active chains
  46. - */
  47. -- cur_caldata->calCollect(ah);
  48. -+ if (cur_caldata->calCollect)
  49. -+ cur_caldata->calCollect(ah);
  50. - ah->cal_samples++;
  51. -
  52. - if (ah->cal_samples >= cur_caldata->calNumSamples) {
  53. -@@ -99,7 +107,8 @@ static bool ar9003_hw_per_calibration(st
  54. - /*
  55. - * Process accumulated data
  56. - */
  57. -- cur_caldata->calPostProc(ah, numChains);
  58. -+ if (cur_caldata->calPostProc)
  59. -+ cur_caldata->calPostProc(ah, numChains);
  60. -
  61. - /* Calibration has finished. */
  62. - caldata->CalValid |= cur_caldata->calType;
  63. -@@ -314,9 +323,16 @@ static const struct ath9k_percal_data iq
  64. - ar9003_hw_iqcalibrate
  65. - };
  66. -
  67. -+static const struct ath9k_percal_data temp_cal_single_sample = {
  68. -+ TEMP_COMP_CAL,
  69. -+ MIN_CAL_SAMPLES,
  70. -+ PER_MAX_LOG_COUNT,
  71. -+};
  72. -+
  73. - static void ar9003_hw_init_cal_settings(struct ath_hw *ah)
  74. - {
  75. - ah->iq_caldata.calData = &iq_cal_single_sample;
  76. -+ ah->temp_caldata.calData = &temp_cal_single_sample;
  77. -
  78. - if (AR_SREV_9300_20_OR_LATER(ah)) {
  79. - ah->enabled_cals |= TX_IQ_CAL;
  80. -@@ -324,7 +340,7 @@ static void ar9003_hw_init_cal_settings(
  81. - ah->enabled_cals |= TX_IQ_ON_AGC_CAL;
  82. - }
  83. -
  84. -- ah->supp_cals = IQ_MISMATCH_CAL;
  85. -+ ah->supp_cals = IQ_MISMATCH_CAL | TEMP_COMP_CAL;
  86. - }
  87. -
  88. - #define OFF_UPPER_LT 24
  89. -@@ -1383,6 +1399,9 @@ static void ar9003_hw_init_cal_common(st
  90. - INIT_CAL(&ah->iq_caldata);
  91. - INSERT_CAL(ah, &ah->iq_caldata);
  92. -
  93. -+ INIT_CAL(&ah->temp_caldata);
  94. -+ INSERT_CAL(ah, &ah->temp_caldata);
  95. -+
  96. - /* Initialize current pointer to first element in list */
  97. - ah->cal_list_curr = ah->cal_list;
  98. -
  99. ---- a/drivers/net/wireless/ath/ath9k/hw.h
  100. -+++ b/drivers/net/wireless/ath/ath9k/hw.h
  101. -@@ -830,6 +830,7 @@ struct ath_hw {
  102. - /* Calibration */
  103. - u32 supp_cals;
  104. - struct ath9k_cal_list iq_caldata;
  105. -+ struct ath9k_cal_list temp_caldata;
  106. - struct ath9k_cal_list adcgain_caldata;
  107. - struct ath9k_cal_list adcdc_caldata;
  108. - struct ath9k_cal_list *cal_list;
  109. diff --git a/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch b/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch
  110. index 461564350feb43410e5c702a8a67514cdfaa3961..6edef0975431165285a7b937442b5d89b362c807 100644
  111. --- a/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch
  112. +++ b/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch
  113. @@ -84,7 +84,7 @@
  114. bool reset_power_on;
  115. bool htc_reset_init;
  116. -@@ -1068,6 +1076,7 @@ void ath9k_hw_check_nav(struct ath_hw *a
  117. +@@ -1067,6 +1075,7 @@ void ath9k_hw_check_nav(struct ath_hw *a
  118. bool ath9k_hw_check_alive(struct ath_hw *ah);
  119. bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode);