]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
wifi: mac80211: handle reconfig for NAN DATA interfaces
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Thu, 26 Mar 2026 10:14:37 +0000 (12:14 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 7 Apr 2026 13:36:03 +0000 (15:36 +0200)
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 <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260326121156.b14392ce99d6.I2ba3bfcd93e47e48d7f7c74007c70cca52d46896@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/util.c

index 19ac778b704da54833cd3903e0ae34e320dfdde7..925a09246ad912961250debc002603eae88f6520 100644 (file)
@@ -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);