ath5k: merge calibration fixes from r30623, r30624
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 27 Feb 2012 11:17:44 +0000 (11:17 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 27 Feb 2012 11:17:44 +0000 (11:17 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/branches/backfire@30740 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/mac80211/patches/440-ath5k_calibrate_no_queue_stop.patch [new file with mode: 0644]
package/mac80211/patches/441-ath5k_no_agc_recalibration.patch [new file with mode: 0644]

diff --git a/package/mac80211/patches/440-ath5k_calibrate_no_queue_stop.patch b/package/mac80211/patches/440-ath5k_calibrate_no_queue_stop.patch
new file mode 100644 (file)
index 0000000..3751c53
--- /dev/null
@@ -0,0 +1,31 @@
+--- a/drivers/net/wireless/ath/ath5k/base.c
++++ b/drivers/net/wireless/ath/ath5k/base.c
+@@ -2330,15 +2330,6 @@ ath5k_calibrate_work(struct work_struct 
+                                       "got new rfgain, resetting\n");
+                       ieee80211_queue_work(ah->hw, &ah->reset_work);
+               }
+-
+-              /* TODO: On full calibration we should stop TX here,
+-               * so that it doesn't interfere (mostly due to gain_f
+-               * calibration that messes with tx packets -see phy.c).
+-               *
+-               * NOTE: Stopping the queues from above is not enough
+-               * to stop TX but saves us from disconecting (at least
+-               * we don't lose packets). */
+-              ieee80211_stop_queues(ah->hw);
+       } else
+               ah->ah_cal_mask |= AR5K_CALIBRATION_SHORT;
+@@ -2353,10 +2344,9 @@ ath5k_calibrate_work(struct work_struct 
+                               ah->curchan->center_freq));
+       /* Clear calibration flags */
+-      if (ah->ah_cal_mask & AR5K_CALIBRATION_FULL) {
+-              ieee80211_wake_queues(ah->hw);
++      if (ah->ah_cal_mask & AR5K_CALIBRATION_FULL)
+               ah->ah_cal_mask &= ~AR5K_CALIBRATION_FULL;
+-      } else if (ah->ah_cal_mask & AR5K_CALIBRATION_SHORT)
++      else if (ah->ah_cal_mask & AR5K_CALIBRATION_SHORT)
+               ah->ah_cal_mask &= ~AR5K_CALIBRATION_SHORT;
+ }
diff --git a/package/mac80211/patches/441-ath5k_no_agc_recalibration.patch b/package/mac80211/patches/441-ath5k_no_agc_recalibration.patch
new file mode 100644 (file)
index 0000000..87d0743
--- /dev/null
@@ -0,0 +1,42 @@
+--- a/drivers/net/wireless/ath/ath5k/phy.c
++++ b/drivers/net/wireless/ath/ath5k/phy.c
+@@ -1871,31 +1871,15 @@ ath5k_hw_phy_calibrate(struct ath5k_hw *
+               ret = 0;
+       }
+-      /* On full calibration do an AGC calibration and
+-       * request a PAPD probe for gainf calibration if
+-       * needed */
+-      if (ah->ah_cal_mask & AR5K_CALIBRATION_FULL) {
++      /* On full calibration request a PAPD probe for
++       * gainf calibration if needed */
++      if ((ah->ah_cal_mask & AR5K_CALIBRATION_FULL) &&
++          (ah->ah_radio == AR5K_RF5111 ||
++           ah->ah_radio == AR5K_RF5112) &&
++          channel->hw_value != AR5K_MODE_11B)
++              ath5k_hw_request_rfgain_probe(ah);
+-              AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_AGCCTL,
+-                                      AR5K_PHY_AGCCTL_CAL);
+-
+-              ret = ath5k_hw_register_timeout(ah, AR5K_PHY_AGCCTL,
+-                      AR5K_PHY_AGCCTL_CAL | AR5K_PHY_AGCCTL_NF,
+-                      0, false);
+-              if (ret) {
+-                      ATH5K_ERR(ah,
+-                              "gain calibration timeout (%uMHz)\n",
+-                              channel->center_freq);
+-              }
+-
+-              if ((ah->ah_radio == AR5K_RF5111 ||
+-                      ah->ah_radio == AR5K_RF5112)
+-                      && (channel->hw_value != AR5K_MODE_11B))
+-                      ath5k_hw_request_rfgain_probe(ah);
+-      }
+-
+-      /* Update noise floor
+-       * XXX: Only do this after AGC calibration */
++      /* Update noise floor */
+       if (!(ah->ah_cal_mask & AR5K_CALIBRATION_NF))
+               ath5k_hw_update_noise_floor(ah);