Search Linux Wireless

[PATCH 09/10] ath9k: add ath9k_enable_dynack() method

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add ath9k_enable_dynack() method to enable ack timeout estimation algorithm.
Moreover disable dynack if the coverage class has been configured

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@xxxxxxxxx>
---
 drivers/net/wireless/ath/ath9k/main.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index e6ac8d2..52ca884 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1970,6 +1970,14 @@ static void ath9k_set_coverage_class(struct ieee80211_hw *hw, u8 coverage_class)
 	mutex_lock(&sc->mutex);
 	ah->coverage_class = coverage_class;
 
+	if (ah->dynack.enabled) {
+		u32 rfilt;
+
+		ah->dynack.enabled = false;
+		rfilt = ath_calcrxfilter(sc);
+		ath9k_hw_setrxfilter(ah, rfilt);
+	}
+
 	ath9k_ps_wakeup(sc);
 	ath9k_hw_init_global_settings(ah);
 	ath9k_ps_restore(sc);
@@ -1977,6 +1985,28 @@ static void ath9k_set_coverage_class(struct ieee80211_hw *hw, u8 coverage_class)
 	mutex_unlock(&sc->mutex);
 }
 
+#ifdef CONFIG_ATH9K_DYNACK
+static int ath9k_enable_dynack(struct ieee80211_hw *hw)
+{
+	u32 rfilt;
+	struct ath_softc *sc = hw->priv;
+	struct ath_hw *ah = sc->sc_ah;
+
+	if (config_enabled(CONFIG_ATH9K_TX99))
+		return -EOPNOTSUPP;
+
+	if (!ah->dynack.enabled) {
+		ath_dynack_reset(ah);
+
+		ah->dynack.enabled = true;
+		rfilt = ath_calcrxfilter(sc);
+		ath9k_hw_setrxfilter(ah, rfilt);
+	}
+
+	return 0;
+}
+#endif
+
 static bool ath9k_has_tx_pending(struct ath_softc *sc)
 {
 	int i, npend = 0;
@@ -2651,4 +2681,8 @@ struct ieee80211_ops ath9k_ops = {
 #endif
 	.sw_scan_start	    = ath9k_sw_scan_start,
 	.sw_scan_complete   = ath9k_sw_scan_complete,
+
+#ifdef CONFIG_ATH9K_DYNACK
+	.enable_dynack      = ath9k_enable_dynack,
+#endif
 };
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux