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>
This commit is contained in:
Lorenzo Bianconi
2021-11-16 15:03:36 +01:00
committed by Johannes Berg
parent c47240cb46
commit 8415816493
3 changed files with 71 additions and 27 deletions

View File

@@ -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;