Before we will start radar detection check if we have correct DFS region. Fail in case we don't know DFS region (don't know CAC/NOP timing and how to configure DFS pattern detector). Signed-off-by: Janusz Dziedzic <janusz.dziedzic@xxxxxxxxx> --- net/wireless/nl80211.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 076ed55..635842b 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -5628,8 +5628,21 @@ static int nl80211_start_radar_detection(struct sk_buff *skb, struct net_device *dev = info->user_ptr[1]; struct wireless_dev *wdev = dev->ieee80211_ptr; struct cfg80211_chan_def chandef; + const struct ieee80211_regdomain *regdom; + u8 dfs_region; int err; + if (!cfg80211_regdomain) + return -EINVAL; + + rcu_read_lock(); + regdom = rcu_dereference(cfg80211_regdomain); + dfs_region = regdom->dfs_region; + rcu_read_unlock(); + + if (dfs_region == NL80211_DFS_UNSET) + return -EINVAL; + err = nl80211_parse_chandef(rdev, info, &chandef); if (err) return err; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html