diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2021-11-16 17:03:36 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2021-11-26 13:50:27 +0300 |
commit | 8415816493b7589e74ff4e1e7eaf3aadc7b73621 (patch) | |
tree | 1e942d46d143e0e5685a1fdf770a0af3d5f94002 /net/wireless/chan.c | |
parent | c47240cb46a10c40686ce4e25c64aaed676f71c9 (diff) | |
download | linux-8415816493b7589e74ff4e1e7eaf3aadc7b73621.tar.xz |
cfg80211: allow continuous radar monitoring on offchannel chain
Allow continuous radar detection on the offchannel chain in order
to switch to the monitored channel whenever the underlying driver
reports a radar pattern on the main channel.
Tested-by: Owen Peng <owen.peng@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/d46217310a49b14ff0e9c002f0a6e0547d70fd2c.1637071350.git.lorenzo@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/chan.c')
-rw-r--r-- | net/wireless/chan.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/net/wireless/chan.c b/net/wireless/chan.c index 869c43d4414c..00fc7b78063c 100644 --- a/net/wireless/chan.c +++ b/net/wireless/chan.c @@ -712,6 +712,19 @@ static bool cfg80211_is_wiphy_oper_chan(struct wiphy *wiphy, return false; } +static bool +cfg80211_offchan_chain_is_active(struct cfg80211_registered_device *rdev, + struct ieee80211_channel *channel) +{ + if (!rdev->offchan_radar_wdev) + return false; + + if (!cfg80211_chandef_valid(&rdev->offchan_radar_chandef)) + return false; + + return cfg80211_is_sub_chan(&rdev->offchan_radar_chandef, channel); +} + bool cfg80211_any_wiphy_oper_chan(struct wiphy *wiphy, struct ieee80211_channel *chan) { @@ -728,6 +741,9 @@ bool cfg80211_any_wiphy_oper_chan(struct wiphy *wiphy, if (cfg80211_is_wiphy_oper_chan(&rdev->wiphy, chan)) return true; + + if (cfg80211_offchan_chain_is_active(rdev, chan)) + return true; } return false; |