]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: mac80211: Export an API to check if NAN is started
authorIlan Peer <ilan.peer@intel.com>
Mon, 8 Sep 2025 11:13:06 +0000 (14:13 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 19 Sep 2025 09:26:23 +0000 (11:26 +0200)
So it can be used by drivers to check if NAN Device interface
is started or not.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250908140015.c69652f77eb6.Ie4f3d197e0706e742e3d97614fadc11b22adfbc6@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/mac80211.h
net/mac80211/util.c

index a5140ecf334b49e50f61c0dabb8dd042c0469185..a55085cf4ec495f3a280f3a6a832d5557a641f47 100644 (file)
@@ -7838,4 +7838,10 @@ int ieee80211_emulate_switch_vif_chanctx(struct ieee80211_hw *hw,
                                         int n_vifs,
                                         enum ieee80211_chanctx_switch_mode mode);
 
+/**
+ * ieee80211_vif_nan_started - Return whether a NAN vif is started
+ * @vif: the vif
+ * Return: %true iff the vif is a NAN interface and NAN is started
+ */
+bool ieee80211_vif_nan_started(struct ieee80211_vif *vif);
 #endif /* MAC80211_H */
index 9eb35e3b9e52fd896bab5e673c4d7dc72fdf4393..123842b841f22fbf624f9ac74f8e5e52aa0ca3ab 100644 (file)
@@ -4512,3 +4512,11 @@ void ieee80211_clear_tpe(struct ieee80211_parsed_tpe *tpe)
                       sizeof(tpe->psd_reg_client[i].power));
        }
 }
+
+bool ieee80211_vif_nan_started(struct ieee80211_vif *vif)
+{
+       struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
+
+       return vif->type == NL80211_IFTYPE_NAN && sdata->u.nan.started;
+}
+EXPORT_SYMBOL_GPL(ieee80211_vif_nan_started);