diff options
author | Miri Korenblit <miriam.rachel.korenblit@intel.com> | 2023-09-28 17:35:26 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2023-10-23 12:43:26 +0300 |
commit | c942398f95efb06d5434f86ea00fabe267f57af8 (patch) | |
tree | f03f16c2056fd469c65a59628f5fe552cb36415a /net/mac80211/link.c | |
parent | a1f5dcb1c0c1e26a7e158ce9fc28355041f26909 (diff) | |
download | linux-c942398f95efb06d5434f86ea00fabe267f57af8.tar.xz |
wifi: mac80211: handle debugfs when switching to/from MLO
In MLO, we have a per-link debugfs directory which contains the
per-link files. In case of non-MLO we would like to put the per-link
files in the netdev directory to keep it how it was before MLO.
- Upon interface creation the netdev will be created with the per-link
files in it.
- Upon switching to MLO: delete the entire netdev directory and then
recreate it without the per-link files. Then the per-link directories
with the per-link files in it will be created in ieee80211_link_init()
- Upon switching to non-MLO: delete the entire netdev directory
(including the per-link directories) and recreate it with the per-link
files in it.
Note that this also aligns to always call the vif link debugfs
method for the deflink as promised in the documentation, which
wasn't done before.
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230928172905.082e698caca9.I5bef7b2026e0f58b4a958b3d1f459ac5baeccfc9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/link.c')
-rw-r--r-- | net/mac80211/link.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/mac80211/link.c b/net/mac80211/link.c index 2a78374f6f04..76c61a132569 100644 --- a/net/mac80211/link.c +++ b/net/mac80211/link.c @@ -235,6 +235,9 @@ static int ieee80211_vif_update_links(struct ieee80211_sub_if_data *sdata, RCU_INIT_POINTER(sdata->vif.link_conf[link_id], NULL); } + if (!old_links) + ieee80211_debugfs_recreate_netdev(sdata, true); + /* link them into data structures */ for_each_set_bit(link_id, &add, IEEE80211_MLD_MAX_NUM_LINKS) { WARN_ON(!use_deflink && @@ -261,6 +264,8 @@ static int ieee80211_vif_update_links(struct ieee80211_sub_if_data *sdata, old_links & old_active, new_links & sdata->vif.active_links, old); + if (!new_links) + ieee80211_debugfs_recreate_netdev(sdata, false); } if (ret) { |