From dea8a2e42510fddbdeda5fbd6ee1909534a9c5f9 Mon Sep 17 00:00:00 2001 From: nbd Date: Tue, 13 Mar 2012 07:56:01 +0000 Subject: ath9k: remove stuck beacon detection optimization, it may be unreliable on some hardware git-svn-id: svn://svn.openwrt.org/openwrt/trunk@30915 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../patches/560-ath9k_optimize_beacon_tx.patch | 129 --------------------- .../patches/560-ath9k_optimize_hw_check.patch | 32 +++++ .../patches/561-ath9k_optimize_hw_check.patch | 32 ----- 3 files changed, 32 insertions(+), 161 deletions(-) delete mode 100644 package/mac80211/patches/560-ath9k_optimize_beacon_tx.patch create mode 100644 package/mac80211/patches/560-ath9k_optimize_hw_check.patch delete mode 100644 package/mac80211/patches/561-ath9k_optimize_hw_check.patch (limited to 'package') diff --git a/package/mac80211/patches/560-ath9k_optimize_beacon_tx.patch b/package/mac80211/patches/560-ath9k_optimize_beacon_tx.patch deleted file mode 100644 index cfa1eb7c37..0000000000 --- a/package/mac80211/patches/560-ath9k_optimize_beacon_tx.patch +++ /dev/null @@ -1,129 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/beacon.c -+++ b/drivers/net/wireless/ath/ath9k/beacon.c -@@ -357,41 +357,12 @@ void ath_beacon_tasklet(unsigned long da - struct ieee80211_vif *vif; - bool edma = !!(ah->caps.hw_caps & ATH9K_HW_CAP_EDMA); - int slot; -- u32 bfaddr, bc = 0; -- -- /* -- * Check if the previous beacon has gone out. If -- * not don't try to post another, skip this period -- * and wait for the next. Missed beacons indicate -- * a problem and should not occur. If we miss too -- * many consecutive beacons reset the device. -- */ -- if (ath9k_hw_numtxpending(ah, sc->beacon.beaconq) != 0) { -- sc->beacon.bmisscnt++; -- -- if (sc->beacon.bmisscnt < BSTUCK_THRESH * sc->nbcnvifs) { -- ath_dbg(common, BSTUCK, -- "missed %u consecutive beacons\n", -- sc->beacon.bmisscnt); -- ath9k_hw_stop_dma_queue(ah, sc->beacon.beaconq); -- if (sc->beacon.bmisscnt > 3) -- ath9k_hw_bstuck_nfcal(ah); -- } else if (sc->beacon.bmisscnt >= BSTUCK_THRESH) { -- ath_dbg(common, BSTUCK, "beacon is officially stuck\n"); -- sc->sc_flags |= SC_OP_TSF_RESET; -- ieee80211_queue_work(sc->hw, &sc->hw_reset_work); -- } -- -- return; -- } - - /* - * Generate beacon frames. we are sending frames - * staggered so calculate the slot for this frame based - * on the tsf to safeguard against missing an swba. - */ -- -- - if (ah->opmode == NL80211_IFTYPE_AP) { - u16 intval; - u32 tsftu; -@@ -412,23 +383,6 @@ void ath_beacon_tasklet(unsigned long da - vif = sc->beacon.bslot[slot]; - } - -- -- bfaddr = 0; -- if (vif) { -- bf = ath_beacon_generate(sc->hw, vif); -- if (bf != NULL) { -- bfaddr = bf->bf_daddr; -- bc = 1; -- } -- -- if (sc->beacon.bmisscnt != 0) { -- ath_dbg(common, BSTUCK, -- "resume beacon xmit after %u misses\n", -- sc->beacon.bmisscnt); -- sc->beacon.bmisscnt = 0; -- } -- } -- - /* - * Handle slot time change when a non-ERP station joins/leaves - * an 11g network. The 802.11 layer notifies us via callback, -@@ -453,15 +407,54 @@ void ath_beacon_tasklet(unsigned long da - ath9k_hw_init_global_settings(ah); - sc->beacon.updateslot = OK; - } -- if (bfaddr != 0) { -- /* NB: cabq traffic should already be queued and primed */ -- ath9k_hw_puttxbuf(ah, sc->beacon.beaconq, bfaddr); - -- if (!edma) -- ath9k_hw_txstart(ah, sc->beacon.beaconq); -+ if (!vif) -+ return; -+ -+ /* -+ * Check if the previous beacon has gone out. If -+ * not don't try to post another, skip this period -+ * and wait for the next. Missed beacons indicate -+ * a problem and should not occur. If we miss too -+ * many consecutive beacons reset the device. -+ */ -+ if (ath9k_hw_numtxpending(ah, sc->beacon.beaconq) != 0) { -+ sc->beacon.bmisscnt++; -+ -+ if (sc->beacon.bmisscnt < BSTUCK_THRESH * sc->nbcnvifs) { -+ ath_dbg(common, BSTUCK, -+ "missed %u consecutive beacons\n", -+ sc->beacon.bmisscnt); -+ ath9k_hw_stop_dma_queue(ah, sc->beacon.beaconq); -+ if (sc->beacon.bmisscnt > 3) -+ ath9k_hw_bstuck_nfcal(ah); -+ } else if (sc->beacon.bmisscnt >= BSTUCK_THRESH) { -+ ath_dbg(common, BSTUCK, "beacon is officially stuck\n"); -+ sc->sc_flags |= SC_OP_TSF_RESET; -+ ieee80211_queue_work(sc->hw, &sc->hw_reset_work); -+ } -+ -+ return; -+ } -+ -+ bf = ath_beacon_generate(sc->hw, vif); -+ if (!bf) -+ return; - -- sc->beacon.ast_be_xmit += bc; /* XXX per-vif? */ -+ if (sc->beacon.bmisscnt != 0) { -+ ath_dbg(common, BSTUCK, -+ "resume beacon xmit after %u misses\n", -+ sc->beacon.bmisscnt); -+ sc->beacon.bmisscnt = 0; - } -+ -+ /* NB: cabq traffic should already be queued and primed */ -+ ath9k_hw_puttxbuf(ah, sc->beacon.beaconq, bf->bf_daddr); -+ -+ if (!edma) -+ ath9k_hw_txstart(ah, sc->beacon.beaconq); -+ -+ sc->beacon.ast_be_xmit++; - } - - static void ath9k_beacon_init(struct ath_softc *sc, diff --git a/package/mac80211/patches/560-ath9k_optimize_hw_check.patch b/package/mac80211/patches/560-ath9k_optimize_hw_check.patch new file mode 100644 index 0000000000..61430305b7 --- /dev/null +++ b/package/mac80211/patches/560-ath9k_optimize_hw_check.patch @@ -0,0 +1,32 @@ +--- a/drivers/net/wireless/ath/ath9k/beacon.c ++++ b/drivers/net/wireless/ath/ath9k/beacon.c +@@ -369,6 +369,9 @@ void ath_beacon_tasklet(unsigned long da + if (ath9k_hw_numtxpending(ah, sc->beacon.beaconq) != 0) { + sc->beacon.bmisscnt++; + ++ if (!ath9k_hw_check_alive(ah)) ++ ieee80211_queue_work(sc->hw, &sc->hw_check_work); ++ + if (sc->beacon.bmisscnt < BSTUCK_THRESH * sc->nbcnvifs) { + ath_dbg(common, BSTUCK, + "missed %u consecutive beacons\n", +--- a/drivers/net/wireless/ath/ath9k/main.c ++++ b/drivers/net/wireless/ath/ath9k/main.c +@@ -695,17 +695,6 @@ void ath9k_tasklet(unsigned long data) + goto out; + } + +- /* +- * Only run the baseband hang check if beacons stop working in AP or +- * IBSS mode, because it has a high false positive rate. For station +- * mode it should not be necessary, since the upper layers will detect +- * this through a beacon miss automatically and the following channel +- * change will trigger a hardware reset anyway +- */ +- if (ath9k_hw_numtxpending(ah, sc->beacon.beaconq) != 0 && +- !ath9k_hw_check_alive(ah)) +- ieee80211_queue_work(sc->hw, &sc->hw_check_work); +- + if ((status & ATH9K_INT_TSFOOR) && sc->ps_enabled) { + /* + * TSF sync does not look correct; remain awake to sync with diff --git a/package/mac80211/patches/561-ath9k_optimize_hw_check.patch b/package/mac80211/patches/561-ath9k_optimize_hw_check.patch deleted file mode 100644 index d10fbede50..0000000000 --- a/package/mac80211/patches/561-ath9k_optimize_hw_check.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/beacon.c -+++ b/drivers/net/wireless/ath/ath9k/beacon.c -@@ -421,6 +421,9 @@ void ath_beacon_tasklet(unsigned long da - if (ath9k_hw_numtxpending(ah, sc->beacon.beaconq) != 0) { - sc->beacon.bmisscnt++; - -+ if (!ath9k_hw_check_alive(ah)) -+ ieee80211_queue_work(sc->hw, &sc->hw_check_work); -+ - if (sc->beacon.bmisscnt < BSTUCK_THRESH * sc->nbcnvifs) { - ath_dbg(common, BSTUCK, - "missed %u consecutive beacons\n", ---- a/drivers/net/wireless/ath/ath9k/main.c -+++ b/drivers/net/wireless/ath/ath9k/main.c -@@ -695,17 +695,6 @@ void ath9k_tasklet(unsigned long data) - goto out; - } - -- /* -- * Only run the baseband hang check if beacons stop working in AP or -- * IBSS mode, because it has a high false positive rate. For station -- * mode it should not be necessary, since the upper layers will detect -- * this through a beacon miss automatically and the following channel -- * change will trigger a hardware reset anyway -- */ -- if (ath9k_hw_numtxpending(ah, sc->beacon.beaconq) != 0 && -- !ath9k_hw_check_alive(ah)) -- ieee80211_queue_work(sc->hw, &sc->hw_check_work); -- - if ((status & ATH9K_INT_TSFOOR) && sc->ps_enabled) { - /* - * TSF sync does not look correct; remain awake to sync with -- cgit v1.2.3