1 From cc783bfa67e87d2e6206f7626b7bbb74d5c5f269 Mon Sep 17 00:00:00 2001
2 From: Lorenzo Bianconi <lorenzo@kernel.org>
3 Date: Tue, 20 Aug 2019 18:20:22 +0200
4 Subject: [PATCH 4/4] ath9k: dynack: set ackto to max timeout in
7 Initialize acktimeout to the maximum configurable value in
8 ath_dynack_reset in order to not disconnect long distance static links
9 enabling dynack and even to take care of possible errors configuring
10 a static timeout. Moreover initialize station timeout value to the current
13 Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
14 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
16 drivers/net/wireless/ath/ath9k/dynack.c | 20 +++++++++++++-------
17 1 file changed, 13 insertions(+), 7 deletions(-)
19 --- a/drivers/net/wireless/ath/ath9k/dynack.c
20 +++ b/drivers/net/wireless/ath/ath9k/dynack.c
21 @@ -321,11 +321,9 @@ EXPORT_SYMBOL(ath_dynack_sample_ack_ts);
23 void ath_dynack_node_init(struct ath_hw *ah, struct ath_node *an)
25 - /* ackto = slottime + sifs + air delay */
26 - u32 ackto = 9 + 16 + 64;
27 struct ath_dynack *da = &ah->dynack;
30 + an->ackto = da->ackto;
32 spin_lock(&da->qlock);
33 list_add_tail(&an->list, &da->nodes);
34 @@ -356,20 +354,26 @@ EXPORT_SYMBOL(ath_dynack_node_deinit);
36 void ath_dynack_reset(struct ath_hw *ah)
38 - /* ackto = slottime + sifs + air delay */
39 - u32 ackto = 9 + 16 + 64;
40 struct ath_dynack *da = &ah->dynack;
41 + struct ath_node *an;
43 + spin_lock_bh(&da->qlock);
45 da->lto = jiffies + COMPUTE_TO;
53 + da->ackto = ath_dynack_get_max_to(ah);
54 + list_for_each_entry(an, &da->nodes, list)
55 + an->ackto = da->ackto;
58 - ath_dynack_set_timeout(ah, ackto);
59 + ath_dynack_set_timeout(ah, da->ackto);
61 + spin_unlock_bh(&da->qlock);
63 EXPORT_SYMBOL(ath_dynack_reset);
65 @@ -386,6 +390,8 @@ void ath_dynack_init(struct ath_hw *ah)
67 spin_lock_init(&da->qlock);
68 INIT_LIST_HEAD(&da->nodes);
69 + /* ackto = slottime + sifs + air delay */
70 + da->ackto = 9 + 16 + 64;
72 ah->hw->wiphy->features |= NL80211_FEATURE_ACKTO_ESTIMATION;