diff options
| author | Janusz Dziedzic <janusz.dziedzic@gmail.com> | 2026-02-06 18:15:49 +0100 |
|---|---|---|
| committer | Johannes Berg <johannes.berg@intel.com> | 2026-03-02 09:10:28 +0100 |
| commit | d69cb039ab1930706428566caf5a714d0cb3ed3d (patch) | |
| tree | 5c3cdff5150dd2bb8d80878c98f8f940064eb150 /net/wireless/chan.c | |
| parent | 92fecd2744552702285fe4e31ab9cb31a59e7391 (diff) | |
| download | linux-next-d69cb039ab1930706428566caf5a714d0cb3ed3d.tar.gz linux-next-d69cb039ab1930706428566caf5a714d0cb3ed3d.zip | |
wifi: cfg80211: set and report chandef CAC ongoing
Allow to track and check CAC state from user mode by
simple check phy channels eg. using iw phy1 channels
command.
This is done for regular CAC and background CAC.
It is important for background CAC while we can start
it from any app (eg. iw or hostapd).
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
Link: https://patch.msgid.link/20260206171830.553879-3-janusz.dziedzic@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/chan.c')
| -rw-r--r-- | net/wireless/chan.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/net/wireless/chan.c b/net/wireless/chan.c index 68221b1ab45e..dfe319565280 100644 --- a/net/wireless/chan.c +++ b/net/wireless/chan.c @@ -642,6 +642,33 @@ void cfg80211_set_dfs_state(struct wiphy *wiphy, } } +void cfg80211_set_cac_state(struct wiphy *wiphy, + const struct cfg80211_chan_def *chandef, + bool cac_ongoing) +{ + struct ieee80211_channel *c; + int width; + u64 cac_time; + + if (WARN_ON(!cfg80211_chandef_valid(chandef))) + return; + + width = cfg80211_chandef_get_width(chandef); + if (width < 0) + return; + + /* Get the same timestamp for all subchannels */ + cac_time = cac_ongoing ? ktime_get_boottime_ns() : 0; + + for_each_subchan(chandef, freq, cf) { + c = ieee80211_get_channel_khz(wiphy, freq); + if (!c) + continue; + + c->cac_start_time = cac_time; + } +} + static bool cfg80211_dfs_permissive_check_wdev(struct cfg80211_registered_device *rdev, enum nl80211_iftype iftype, |
