ath9k: merge a pending fix for 5 ghz rx latency
authorFelix Fietkau <nbd@openwrt.org>
Wed, 31 Aug 2011 06:34:53 +0000 (06:34 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 31 Aug 2011 06:34:53 +0000 (06:34 +0000)
SVN-Revision: 28137

package/mac80211/patches/300-pending_work.patch
package/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch
package/mac80211/patches/513-ath9k_channelbw_debugfs.patch
package/mac80211/patches/570-ath9k_fix_ack_cts_timeout.patch
package/mac80211/patches/580-ath9k_remove_common_chainmask.patch
package/mac80211/patches/581-ath9k_use_reset_work.patch
package/mac80211/patches/582-ath9k_merge_reset_functions.patch
package/mac80211/patches/593-ath9k_ar9280_cold_reset.patch

index 01df8f745628c7c50df73bdba99bb16b3455e78d..ce766af82e6d6a834097a2b5b861ea570cb0769f 100644 (file)
        if (AR_SREV_9340(ah) && !ah->is_clk_25mhz)
 --- a/drivers/net/wireless/ath/ath9k/hw.c
 +++ b/drivers/net/wireless/ath/ath9k/hw.c
-@@ -997,8 +997,14 @@ void ath9k_hw_init_global_settings(struc
+@@ -975,7 +975,10 @@ void ath9k_hw_init_global_settings(struc
+       if (ah->misc_mode != 0)
+               REG_SET_BIT(ah, AR_PCU_MISC, ah->misc_mode);
+-      rx_lat = 37;
++      if (IS_CHAN_A_FAST_CLOCK(ah, chan))
++              rx_lat = 41;
++      else
++              rx_lat = 37;
+       tx_lat = 54;
+       if (IS_CHAN_HALF_RATE(chan)) {
+@@ -989,7 +992,7 @@ void ath9k_hw_init_global_settings(struc
+               sifstime = 32;
+       } else if (IS_CHAN_QUARTER_RATE(chan)) {
+               eifs = 340;
+-              rx_lat *= 4;
++              rx_lat = (rx_lat * 4) - 1;
+               tx_lat *= 4;
+               if (IS_CHAN_A_FAST_CLOCK(ah, chan))
+                   tx_lat += 22;
+@@ -997,8 +1000,14 @@ void ath9k_hw_init_global_settings(struc
                slottime = 21;
                sifstime = 64;
        } else {
index e2bfde443aa2984c5885b61466e16e909b182720..6c29e9cbc3d801e34918c782231edbe9b2f6a816 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/hw.c
 +++ b/drivers/net/wireless/ath/ath9k/hw.c
-@@ -1671,8 +1671,8 @@ int ath9k_hw_reset(struct ath_hw *ah, st
+@@ -1674,8 +1674,8 @@ int ath9k_hw_reset(struct ath_hw *ah, st
        REG_WRITE(ah, AR_OBS, 8);
  
        if (ah->config.rx_intr_mitigation) {
index fedd17f51dfae526ebf62ad25e3b2978034d150f..b144af454c0b3c25fb9a778bbca6a78be8124929 100644 (file)
@@ -61,7 +61,7 @@
                        return -EINVAL;
 --- a/drivers/net/wireless/ath/ath9k/hw.c
 +++ b/drivers/net/wireless/ath/ath9k/hw.c
-@@ -1504,6 +1504,10 @@ int ath9k_hw_reset(struct ath_hw *ah, st
+@@ -1507,6 +1507,10 @@ int ath9k_hw_reset(struct ath_hw *ah, st
        }
        ah->noise = ath9k_hw_getchan_noise(ah, chan);
  
index 27055582cbaa1e62ed67c4df25c179ee75ab5118..ed955b4ae198ca33620848b0bcf725657fe4f837 100644 (file)
@@ -9,7 +9,7 @@
        int slottime;
        int sifstime;
        int rx_lat = 0, tx_lat = 0, eifs = 0;
-@@ -1026,6 +1026,7 @@ void ath9k_hw_init_global_settings(struc
+@@ -1029,6 +1029,7 @@ void ath9k_hw_init_global_settings(struc
  
        /* As defined by IEEE 802.11-2007 17.3.8.6 */
        acktimeout = slottime + sifstime + 3 * ah->coverage_class;
@@ -17,7 +17,7 @@
  
        /*
         * Workaround for early ACK timeouts, add an offset to match the
-@@ -1040,7 +1041,7 @@ void ath9k_hw_init_global_settings(struc
+@@ -1043,7 +1044,7 @@ void ath9k_hw_init_global_settings(struc
        ath9k_hw_set_sifs_time(ah, sifstime);
        ath9k_hw_setslottime(ah, slottime);
        ath9k_hw_set_ack_timeout(ah, acktimeout);
index 9ef623b91836694efb9b08fa881297a38b2e6414..58d972cb031b734e5754084c50736005da51ad59 100644 (file)
@@ -69,7 +69,7 @@
        ath9k_ps_restore(sc);
 --- a/drivers/net/wireless/ath/ath9k/hw.c
 +++ b/drivers/net/wireless/ath/ath9k/hw.c
-@@ -1485,9 +1485,6 @@ int ath9k_hw_reset(struct ath_hw *ah, st
+@@ -1488,9 +1488,6 @@ int ath9k_hw_reset(struct ath_hw *ah, st
        u64 tsf = 0;
        int i, r;
  
@@ -79,7 +79,7 @@
        if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE))
                return -EIO;
  
-@@ -2105,6 +2102,8 @@ int ath9k_hw_fill_cap_info(struct ath_hw
+@@ -2108,6 +2105,8 @@ int ath9k_hw_fill_cap_info(struct ath_hw
  
        pCap->tx_chainmask = fixup_chainmask(chip_chainmask, pCap->tx_chainmask);
        pCap->rx_chainmask = fixup_chainmask(chip_chainmask, pCap->rx_chainmask);
index b9dce8a1a1cd14404200f19d21aa1f29f90e94e9..7836718bbd7bcc523c402d7473f38d9f4df86eb8 100644 (file)
        INIT_DELAYED_WORK(&sc->hw_pll_work, ath_hw_pll_work);
 --- a/drivers/net/wireless/ath/ath9k/main.c
 +++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -595,74 +595,6 @@ static void ath_node_detach(struct ath_s
+@@ -236,6 +236,7 @@ static int ath_set_channel(struct ath_so
+       del_timer_sync(&common->ani.timer);
+       cancel_work_sync(&sc->paprd_work);
+       cancel_work_sync(&sc->hw_check_work);
++      cancel_work_sync(&sc->hw_reset_work);
+       cancel_delayed_work_sync(&sc->tx_complete_work);
+       cancel_delayed_work_sync(&sc->hw_pll_work);
+@@ -595,74 +596,6 @@ static void ath_node_detach(struct ath_s
                ath_tx_node_cleanup(sc, an);
  }
  
  
  void ath9k_tasklet(unsigned long data)
  {
-@@ -675,9 +607,7 @@ void ath9k_tasklet(unsigned long data)
+@@ -675,9 +608,7 @@ void ath9k_tasklet(unsigned long data)
  
        if ((status & ATH9K_INT_FATAL) ||
            (status & ATH9K_INT_BB_WATCHDOG)) {
                return;
        }
  
-@@ -968,13 +898,14 @@ void ath_radio_disable(struct ath_softc 
+@@ -968,13 +899,14 @@ void ath_radio_disable(struct ath_softc 
        ath9k_ps_restore(sc);
  }
  
        sc->hw_busy_count = 0;
  
        /* Stop ANI */
-@@ -1035,6 +966,84 @@ int ath_reset(struct ath_softc *sc, bool
+@@ -1035,6 +967,84 @@ int ath_reset(struct ath_softc *sc, bool
        return r;
  }
  
  /**********************/
  /* mac80211 callbacks */
  /**********************/
+@@ -1227,6 +1237,7 @@ static void ath9k_stop(struct ieee80211_
+       cancel_delayed_work_sync(&sc->hw_pll_work);
+       cancel_work_sync(&sc->paprd_work);
+       cancel_work_sync(&sc->hw_check_work);
++      cancel_work_sync(&sc->hw_reset_work);
+       if (sc->sc_flags & SC_OP_INVALID) {
+               ath_dbg(common, ATH_DBG_ANY, "Device not present\n");
 --- a/drivers/net/wireless/ath/ath9k/xmit.c
 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
 @@ -603,8 +603,10 @@ static void ath_tx_complete_aggr(struct 
  }
  
  static bool ath_lookup_legacy(struct ath_buf *bf)
+@@ -1357,7 +1359,7 @@ void ath_txq_schedule(struct ath_softc *
+       struct ath_atx_ac *ac, *ac_tmp, *last_ac;
+       struct ath_atx_tid *tid, *last_tid;
+-      if (list_empty(&txq->axq_acq) ||
++      if ((sc->sc_flags & SC_OP_HW_RESET) || list_empty(&txq->axq_acq) ||
+           txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH)
+               return;
 @@ -2184,6 +2186,9 @@ static void ath_tx_processq(struct ath_s
  
        spin_lock_bh(&txq->axq_lock);
index 8d22d8f79cd19777bf04fbb8f3e7ed30f9a788a1..ff491a4a9c0c8749a7a8d089850db4d6ece95c47 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/main.c
 +++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -212,83 +212,57 @@ static int ath_update_survey_stats(struc
+@@ -212,84 +212,57 @@ static int ath_update_survey_stats(struc
        return ret;
  }
  
@@ -29,6 +29,7 @@
 -      del_timer_sync(&common->ani.timer);
        cancel_work_sync(&sc->paprd_work);
        cancel_work_sync(&sc->hw_check_work);
+-      cancel_work_sync(&sc->hw_reset_work);
        cancel_delayed_work_sync(&sc->tx_complete_work);
        cancel_delayed_work_sync(&sc->hw_pll_work);
 +}
        }
  
        ath9k_cmn_update_txpow(ah, sc->curtxpow,
-@@ -296,21 +270,95 @@ static int ath_set_channel(struct ath_so
+@@ -297,21 +270,95 @@ static int ath_set_channel(struct ath_so
        ath9k_hw_set_interrupts(ah, ah->imask);
        ath9k_hw_enable_interrupts(ah);
  
        return r;
  }
  
-@@ -823,28 +871,13 @@ static void ath_radio_enable(struct ath_
+@@ -824,28 +871,13 @@ static void ath_radio_enable(struct ath_
                        channel->center_freq, r);
        }
  
        spin_unlock_bh(&sc->sc_pcu_lock);
  
        ath9k_ps_restore(sc);
-@@ -857,11 +890,10 @@ void ath_radio_disable(struct ath_softc 
+@@ -858,11 +890,10 @@ void ath_radio_disable(struct ath_softc 
        int r;
  
        ath9k_ps_wakeup(sc);
  
        /*
         * Keep the LED on when the radio is disabled
-@@ -872,13 +904,7 @@ void ath_radio_disable(struct ath_softc 
+@@ -873,13 +904,7 @@ void ath_radio_disable(struct ath_softc 
                ath9k_hw_cfg_gpio_input(ah, ah->led_pin);
        }
  
  
        if (!ah->curchan)
                ah->curchan = ath9k_cmn_get_curchannel(hw, ah);
-@@ -900,49 +926,11 @@ void ath_radio_disable(struct ath_softc 
+@@ -901,49 +926,11 @@ void ath_radio_disable(struct ath_softc 
  
  static int ath_reset(struct ath_softc *sc, bool retry_tx)
  {
  
        if (retry_tx) {
                int i;
-@@ -955,12 +943,6 @@ static int ath_reset(struct ath_softc *s
+@@ -956,12 +943,6 @@ static int ath_reset(struct ath_softc *s
                }
        }
  
        ath9k_ps_restore(sc);
  
        return r;
-@@ -970,9 +952,7 @@ void ath_reset_work(struct work_struct *
+@@ -971,9 +952,7 @@ void ath_reset_work(struct work_struct *
  {
        struct ath_softc *sc = container_of(work, struct ath_softc, hw_check_work);
  
  }
  
  void ath_hw_check(struct work_struct *work)
-@@ -993,11 +973,8 @@ void ath_hw_check(struct work_struct *wo
+@@ -994,11 +973,8 @@ void ath_hw_check(struct work_struct *wo
        ath_dbg(common, ATH_DBG_RESET, "Possible baseband hang, "
                "busy=%d (try %d)\n", busy, sc->hw_busy_count + 1);
        if (busy >= 99) {
  
        } else if (busy >= 0)
                sc->hw_busy_count = 0;
-@@ -1017,9 +994,7 @@ static void ath_hw_pll_rx_hang_check(str
+@@ -1018,9 +994,7 @@ static void ath_hw_pll_rx_hang_check(str
                        /* Rx is hung for more than 500ms. Reset it */
                        ath_dbg(common, ATH_DBG_RESET,
                                "Possible RX hang, resetting");
                        count = 0;
                }
        } else
-@@ -1090,28 +1065,6 @@ static int ath9k_start(struct ieee80211_
+@@ -1091,28 +1065,6 @@ static int ath9k_start(struct ieee80211_
                goto mutex_unlock;
        }
  
        /* Setup our intr mask. */
        ah->imask = ATH9K_INT_TX | ATH9K_INT_RXEOL |
                    ATH9K_INT_RXORN | ATH9K_INT_FATAL |
-@@ -1134,12 +1087,14 @@ static int ath9k_start(struct ieee80211_
+@@ -1135,12 +1087,14 @@ static int ath9k_start(struct ieee80211_
  
        /* Disable BMISS interrupt when we're not associated */
        ah->imask &= ~(ATH9K_INT_SWBA | ATH9K_INT_BMISS);
  
        if ((ah->btcoex_hw.scheme != ATH_BTCOEX_CFG_NONE) &&
            !ah->btcoex_hw.enabled) {
-@@ -1232,10 +1187,7 @@ static void ath9k_stop(struct ieee80211_
+@@ -1233,11 +1187,7 @@ static void ath9k_stop(struct ieee80211_
  
        mutex_lock(&sc->mutex);
  
 -      cancel_delayed_work_sync(&sc->hw_pll_work);
 -      cancel_work_sync(&sc->paprd_work);
 -      cancel_work_sync(&sc->hw_check_work);
+-      cancel_work_sync(&sc->hw_reset_work);
 +      ath_cancel_work(sc);
  
        if (sc->sc_flags & SC_OP_INVALID) {
                ath_dbg(common, ATH_DBG_ANY, "Device not present\n");
-@@ -2352,9 +2304,11 @@ static void ath9k_flush(struct ieee80211
+@@ -2354,9 +2304,11 @@ static void ath9k_flush(struct ieee80211
        ath9k_ps_wakeup(sc);
        spin_lock_bh(&sc->sc_pcu_lock);
        drain_txq = ath_drain_all_txq(sc, false);
index 0f770fc04bfa00be90c69a852173a325159ea914..bbc462077cd5eded1616f073b8ed171ad6147503 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/hw.c
 +++ b/drivers/net/wireless/ath/ath9k/hw.c
-@@ -1368,10 +1368,16 @@ static bool ath9k_hw_set_reset_reg(struc
+@@ -1371,10 +1371,16 @@ static bool ath9k_hw_set_reset_reg(struc
  static bool ath9k_hw_chip_reset(struct ath_hw *ah,
                                struct ath9k_channel *chan)
  {