[PATCH AUTOSEL 6.18-6.12] wifi: mac80211: explicitly disable FTM responder on AP stop

From: Sasha Levin

Date: Mon Aug 31 2026 - 11:20:42 EST


From: Johannes Berg <johannes.berg@xxxxxxxxx>

[ Upstream commit 89e367a90c1a877ca9c5d75d3848582d80fd0e60 ]

When stopping the AP, explicitly disable FTM responder while
disabling beaconing.

Link: https://patch.msgid.link/20260505151241.f213196d7d6a.I95d65c030e986c5f7d63ecbd79596da890b9fc84@changeid
Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---

LLM Generated explanations, may be completely bogus:

Connection lost, reconnecting to https://agentn.us.api5.cursor.sh
(attempt 1)...
Retry attempt 1...
The background `git log -S'BSS_CHANGED_FTM_RESPONDER'` search finished
after ~7 minutes. It didn’t pinpoint a clean “introducing” commit in
this tree — the pickaxe scan surfaced a long list of unrelated merge
commits, which is typical for a stable checkout with compressed history.

That doesn’t change the earlier conclusion: `BSS_CHANGED_FTM_RESPONDER`
and the FTM responder AP path are present in this 6.18.43 tree, and the
missing `ftm_responder` teardown in `ieee80211_stop_ap()` is a real bug
there — especially for ath10k/ath11k drivers that rely on that notify
bit and don’t implement `.stop_ap`.

**YES**

net/mac80211/cfg.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index f6232948bc0f4..72c9d5aceae58 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1811,6 +1811,7 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev,
struct ieee80211_link_data *link =
sdata_dereference(sdata->link[link_id], sdata);
struct ieee80211_bss_conf *link_conf = link->conf;
+ u64 changes = BSS_CHANGED_BEACON_ENABLED;
LIST_HEAD(keys);

lockdep_assert_wiphy(local->hw.wiphy);
@@ -1860,6 +1861,11 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev,
if (old_s1g_short_beacon)
kfree_rcu(old_s1g_short_beacon, rcu_head);

+ if (link_conf->ftm_responder) {
+ link_conf->ftm_responder = false;
+ changes |= BSS_CHANGED_FTM_RESPONDER;
+ }
+
kfree(link_conf->ftmr_params);
link_conf->ftmr_params = NULL;

@@ -1881,8 +1887,7 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev,
sdata->vif.cfg.ssid_len = 0;
sdata->vif.cfg.s1g = false;
clear_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED, &sdata->state);
- ieee80211_link_info_change_notify(sdata, link,
- BSS_CHANGED_BEACON_ENABLED);
+ ieee80211_link_info_change_notify(sdata, link, changes);

ieee80211_remove_link_keys(link, &keys);
if (!list_empty(&keys)) {
--
2.53.0