1 From 61403414e1719f929386dda8fb954bb302628ef3 Mon Sep 17 00:00:00 2001
2 From: Johannes Berg <johannes.berg@intel.com>
3 Date: Thu, 4 May 2023 16:45:11 +0300
4 Subject: [PATCH] wifi: mac80211: implement proper AP MLD HW restart
6 Previously, I didn't implement restarting here at all if the
7 interface is an MLD, so it only worked for non-MLO. Add the
8 needed code to restart an AP MLD correctly.
10 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
12 Link: https://lore.kernel.org/r/20230504134511.828474-12-gregory.greenman@intel.com
13 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
15 net/mac80211/util.c | 44 +++++++++++++++++++++++++++++++++++++++++++-
16 1 file changed, 43 insertions(+), 1 deletion(-)
18 --- a/net/mac80211/util.c
19 +++ b/net/mac80211/util.c
20 @@ -2344,6 +2344,35 @@ static int ieee80211_reconfig_nan(struct
24 +static void ieee80211_reconfig_ap_links(struct ieee80211_local *local,
25 + struct ieee80211_sub_if_data *sdata,
30 + for (link_id = 0; link_id < ARRAY_SIZE(sdata->link); link_id++) {
31 + struct ieee80211_link_data *link;
33 + if (!(sdata->vif.active_links & BIT(link_id)))
36 + link = sdata_dereference(sdata->link[link_id], sdata);
40 + if (rcu_access_pointer(link->u.ap.beacon))
41 + drv_start_ap(local, sdata, link->conf);
43 + if (!link->conf->enable_beacon)
46 + changed |= BSS_CHANGED_BEACON |
47 + BSS_CHANGED_BEACON_ENABLED;
49 + ieee80211_link_info_change_notify(sdata, link, changed);
53 int ieee80211_reconfig(struct ieee80211_local *local)
55 struct ieee80211_hw *hw = &local->hw;
56 @@ -2606,7 +2635,13 @@ int ieee80211_reconfig(struct ieee80211_
57 changed |= BSS_CHANGED_IBSS;
59 case NL80211_IFTYPE_AP:
60 - changed |= BSS_CHANGED_SSID | BSS_CHANGED_P2P_PS;
61 + changed |= BSS_CHANGED_P2P_PS;
63 + if (sdata->vif.valid_links)
64 + ieee80211_vif_cfg_change_notify(sdata,
67 + changed |= BSS_CHANGED_SSID;
69 if (sdata->vif.bss_conf.ftm_responder == 1 &&
70 wiphy_ext_feature_isset(sdata->local->hw.wiphy,
71 @@ -2616,6 +2651,13 @@ int ieee80211_reconfig(struct ieee80211_
72 if (sdata->vif.type == NL80211_IFTYPE_AP) {
73 changed |= BSS_CHANGED_AP_PROBE_RESP;
75 + if (sdata->vif.valid_links) {
76 + ieee80211_reconfig_ap_links(local,
82 if (rcu_access_pointer(sdata->deflink.u.ap.beacon))
83 drv_start_ap(local, sdata,