mac80211/ath9k: improve pending patches based on review feedback
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 572-ath9k_fix_tx_flush.patch
index ddeeb145bdbd4394eada9155df23958271423a41..630abc6fdcd6b38d51ec70540100687267043f60 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/main.c
 +++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -2149,56 +2149,40 @@ static void ath9k_set_coverage_class(str
+@@ -2149,56 +2149,42 @@ static void ath9k_set_coverage_class(str
  
  static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
  {
 -              }
 +      if (drop)
 +              timeout = 1;
++
++      for (j = 0; j < timeout; j++) {
++              int npend = 0;
++
++              if (j)
++                      usleep_range(1000, 2000);
  
 -              if (drop || ath9k_has_pending_frames(sc, txq)) {
 -                      ath_dbg(common, ATH_DBG_QUEUE, "Drop frames from hw queue:%d\n",
@@ -46,8 +52,6 @@
 -                      ath9k_ps_restore(sc);
 -                      if (npend)
 -                              break;
-+      for (j = 0; j < timeout; j++) {
-+              int npend = 0;
 +              for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
 +                      if (!ATH_TXQ_SETUP(sc, i))
 +                              continue;
@@ -59,8 +63,6 @@
 +
 +              if (!npend)
 +                  goto out;
-+
-+              usleep_range(1000, 2000);
        }
  
 -      if (npend) {