mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-22 07:27:12 +08:00
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>
This commit is contained in:
@@ -320,6 +320,9 @@ static int ieee80211_start_nan(struct wiphy *wiphy,
|
||||
|
||||
lockdep_assert_wiphy(sdata->local->hw.wiphy);
|
||||
|
||||
if (sdata->u.nan.started)
|
||||
return -EALREADY;
|
||||
|
||||
ret = ieee80211_check_combinations(sdata, NULL, 0, 0, -1);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
@@ -329,12 +332,18 @@ static int ieee80211_start_nan(struct wiphy *wiphy,
|
||||
return ret;
|
||||
|
||||
ret = drv_start_nan(sdata->local, sdata, conf);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
ieee80211_sdata_stop(sdata);
|
||||
return ret;
|
||||
}
|
||||
|
||||
sdata->u.nan.conf = *conf;
|
||||
sdata->u.nan.started = true;
|
||||
ieee80211_recalc_idle(sdata->local);
|
||||
|
||||
return ret;
|
||||
sdata->u.nan.conf.master_pref = conf->master_pref;
|
||||
sdata->u.nan.conf.bands = conf->bands;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ieee80211_stop_nan(struct wiphy *wiphy,
|
||||
@@ -342,8 +351,13 @@ static void ieee80211_stop_nan(struct wiphy *wiphy,
|
||||
{
|
||||
struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
|
||||
|
||||
if (!sdata->u.nan.started)
|
||||
return;
|
||||
|
||||
drv_stop_nan(sdata->local, sdata);
|
||||
sdata->u.nan.started = false;
|
||||
ieee80211_sdata_stop(sdata);
|
||||
ieee80211_recalc_idle(sdata->local);
|
||||
}
|
||||
|
||||
static int ieee80211_nan_change_conf(struct wiphy *wiphy,
|
||||
|
||||
Reference in New Issue
Block a user