From: Miri Korenblit Date: Thu, 26 Mar 2026 10:14:37 +0000 (+0200) Subject: wifi: mac80211: handle reconfig for NAN DATA interfaces X-Git-Tag: v7.1-rc1~173^2~37^2~33 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=e43ec602201c5477508855f9c159956df18d108f;p=thirdparty%2Flinux.git wifi: mac80211: handle reconfig for NAN DATA interfaces Make sure these interfaces are added to the driver only after the NAN one was, and after NAN operation was started. Signed-off-by: Miri Korenblit Link: https://patch.msgid.link/20260326121156.b14392ce99d6.I2ba3bfcd93e47e48d7f7c74007c70cca52d46896@changeid Signed-off-by: Johannes Berg --- diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 19ac778b704da..925a09246ad91 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -1780,10 +1780,11 @@ ieee80211_reconfig_nan_offload_de(struct ieee80211_sub_if_data *sdata) static int ieee80211_reconfig_nan(struct ieee80211_sub_if_data *sdata) { + struct ieee80211_local *local = sdata->local; + struct ieee80211_sub_if_data *ndi_sdata; int res; - res = drv_start_nan(sdata->local, sdata, - &sdata->u.nan.conf); + res = drv_start_nan(local, sdata, &sdata->u.nan.conf); if (WARN_ON(res)) return res; @@ -1792,6 +1793,15 @@ static int ieee80211_reconfig_nan(struct ieee80211_sub_if_data *sdata) drv_vif_cfg_changed(sdata->local, sdata, BSS_CHANGED_NAN_LOCAL_SCHED); + /* Now we can add all the NDIs to the driver */ + list_for_each_entry(ndi_sdata, &local->interfaces, list) { + if (ndi_sdata->vif.type == NL80211_IFTYPE_NAN_DATA) { + res = drv_add_interface(local, ndi_sdata); + if (WARN_ON(res)) + return res; + } + } + return 0; } @@ -1945,6 +1955,9 @@ int ieee80211_reconfig(struct ieee80211_local *local) if (sdata->vif.type == NL80211_IFTYPE_MONITOR && !ieee80211_hw_check(&local->hw, NO_VIRTUAL_MONITOR)) continue; + /* These vifs can't be added before NAN was started */ + if (sdata->vif.type == NL80211_IFTYPE_NAN_DATA) + continue; if (sdata->vif.type != NL80211_IFTYPE_AP_VLAN && ieee80211_sdata_running(sdata)) { res = drv_add_interface(local, sdata); @@ -1962,6 +1975,8 @@ int ieee80211_reconfig(struct ieee80211_local *local) if (sdata->vif.type == NL80211_IFTYPE_MONITOR && !ieee80211_hw_check(&local->hw, NO_VIRTUAL_MONITOR)) continue; + if (sdata->vif.type == NL80211_IFTYPE_NAN_DATA) + continue; if (sdata->vif.type != NL80211_IFTYPE_AP_VLAN && ieee80211_sdata_running(sdata)) drv_remove_interface(local, sdata);