]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: mac80211: explicitly disable FTM responder on AP stop
authorJohannes Berg <johannes.berg@intel.com>
Tue, 5 May 2026 13:12:16 +0000 (15:12 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 6 May 2026 09:52:14 +0000 (11:52 +0200)
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@intel.com>
net/mac80211/cfg.c

index 0ebc58a768a40e836f897279323b472625576cd5..0b1291ff7a2cfb936f614c9047ed93dabceab86d 100644 (file)
@@ -1990,6 +1990,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);
@@ -2039,6 +2040,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;
 
@@ -2060,8 +2066,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)) {