Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

wifi: mac80211: Track NAN interface start/stop

In case that NAN is started, mark the device as non idle,
and set LED triggering similar to scan and ROC. Set the
device to idle once NAN is stopped.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250908140015.2711d62fce22.I9b9f826490e50967a66788d713b0eba985879873@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Ilan Peer and committed by
Johannes Berg
8f79d2f1 488d2e0b

+28 -3
+17 -3
net/mac80211/cfg.c
··· 320 320 321 321 lockdep_assert_wiphy(sdata->local->hw.wiphy); 322 322 323 + if (sdata->u.nan.started) 324 + return -EALREADY; 325 + 323 326 ret = ieee80211_check_combinations(sdata, NULL, 0, 0, -1); 324 327 if (ret < 0) 325 328 return ret; ··· 332 329 return ret; 333 330 334 331 ret = drv_start_nan(sdata->local, sdata, conf); 335 - if (ret) 332 + if (ret) { 336 333 ieee80211_sdata_stop(sdata); 334 + return ret; 335 + } 337 336 338 - sdata->u.nan.conf = *conf; 337 + sdata->u.nan.started = true; 338 + ieee80211_recalc_idle(sdata->local); 339 339 340 - return ret; 340 + sdata->u.nan.conf.master_pref = conf->master_pref; 341 + sdata->u.nan.conf.bands = conf->bands; 342 + 343 + return 0; 341 344 } 342 345 343 346 static void ieee80211_stop_nan(struct wiphy *wiphy, ··· 351 342 { 352 343 struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); 353 344 345 + if (!sdata->u.nan.started) 346 + return; 347 + 354 348 drv_stop_nan(sdata->local, sdata); 349 + sdata->u.nan.started = false; 355 350 ieee80211_sdata_stop(sdata); 351 + ieee80211_recalc_idle(sdata->local); 356 352 } 357 353 358 354 static int ieee80211_nan_change_conf(struct wiphy *wiphy,
+2
net/mac80211/ieee80211_i.h
··· 985 985 * struct ieee80211_if_nan - NAN state 986 986 * 987 987 * @conf: current NAN configuration 988 + * @started: true iff NAN is started 988 989 * @func_lock: lock for @func_inst_ids 989 990 * @function_inst_ids: a bitmap of available instance_id's 990 991 */ 991 992 struct ieee80211_if_nan { 992 993 struct cfg80211_nan_conf conf; 994 + bool started; 993 995 994 996 /* protects function_inst_ids */ 995 997 spinlock_t func_lock;
+9
net/mac80211/iface.c
··· 107 107 { 108 108 bool working, scanning, active; 109 109 unsigned int led_trig_start = 0, led_trig_stop = 0; 110 + struct ieee80211_sub_if_data *iter; 110 111 111 112 lockdep_assert_wiphy(local->hw.wiphy); 112 113 ··· 117 116 118 117 working = !local->ops->remain_on_channel && 119 118 !list_empty(&local->roc_list); 119 + 120 + list_for_each_entry(iter, &local->interfaces, list) { 121 + if (iter->vif.type == NL80211_IFTYPE_NAN && 122 + iter->u.nan.started) { 123 + working = true; 124 + break; 125 + } 126 + } 120 127 121 128 scanning = test_bit(SCAN_SW_SCANNING, &local->scanning) || 122 129 test_bit(SCAN_ONCHANNEL_SCANNING, &local->scanning);