1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Mon, 21 Sep 2020 17:43:06 +0200
3 Subject: [PATCH] mac80211: fix regression in sta connection monitor
5 When a frame was acked and probe frames were sent, the connection monitoring
6 needs to be reset, otherwise it will keep probing until the connection is
7 considered dead, even though frames have been acked in the mean time.
9 Fixes: 9abf4e49830d ("mac80211: optimize station connection monitor")
10 Reported-by: Georgi Valkov <gvalkov@abv.bg>
11 Signed-off-by: Felix Fietkau <nbd@nbd.name>
14 --- a/net/mac80211/status.c
15 +++ b/net/mac80211/status.c
16 @@ -991,10 +991,6 @@ static void __ieee80211_tx_status(struct
17 if (!(info->flags & IEEE80211_TX_CTL_INJECTED) && acked)
18 ieee80211_frame_acked(sta, skb);
20 - if ((sta->sdata->vif.type == NL80211_IFTYPE_STATION) &&
21 - ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS))
22 - ieee80211_sta_tx_notify(sta->sdata, (void *) skb->data,
23 - acked, info->status.tx_time);
27 @@ -1129,11 +1125,18 @@ void ieee80211_tx_status_ext(struct ieee
28 noack_success = !!(info->flags & IEEE80211_TX_STAT_NOACK_TRANSMITTED);
31 + struct ieee80211_sub_if_data *sdata = sta->sdata;
33 if (!acked && !noack_success)
34 sta->status_stats.retry_failed++;
35 sta->status_stats.retry_count += retry_count;
37 if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) {
38 + if (sdata->vif.type == NL80211_IFTYPE_STATION &&
39 + skb && !(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP))
40 + ieee80211_sta_tx_notify(sdata, (void *) skb->data,
41 + acked, info->status.tx_time);
44 sta->status_stats.last_ack = jiffies;
46 @@ -1143,6 +1146,11 @@ void ieee80211_tx_status_ext(struct ieee
47 /* Track when last packet was ACKed */
48 sta->status_stats.last_pkt_time = jiffies;
50 + /* Reset connection monitor */
51 + if (sdata->vif.type == NL80211_IFTYPE_STATION &&
52 + unlikely(sdata->u.mgd.probe_send_count > 0))
53 + sdata->u.mgd.probe_send_count = 0;
55 if (info->status.is_valid_ack_signal) {
56 sta->status_stats.last_ack_signal =
57 (s8)info->status.ack_signal;
58 --- a/net/mac80211/mlme.c
59 +++ b/net/mac80211/mlme.c
60 @@ -2508,7 +2508,9 @@ void ieee80211_sta_tx_notify(struct ieee
61 !sdata->u.mgd.probe_send_count)
66 + sdata->u.mgd.probe_send_count = 0;
68 sdata->u.mgd.nullfunc_failed = true;
69 ieee80211_queue_work(&sdata->local->hw, &sdata->work);