diff options
Diffstat (limited to 'net/wireless/chan.c')
-rw-r--r-- | net/wireless/chan.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/net/wireless/chan.c b/net/wireless/chan.c index 59cabc9bce69..d5ccaeaa76e0 100644 --- a/net/wireless/chan.c +++ b/net/wireless/chan.c @@ -319,7 +319,8 @@ static int cfg80211_get_chans_dfs_required(struct wiphy *wiphy, if (!c) return -EINVAL; - if (c->flags & IEEE80211_CHAN_RADAR) + if ((c->flags & IEEE80211_CHAN_RADAR) && + !(wiphy->flags & WIPHY_FLAG_DFS_OFFLOAD)) return 1; } return 0; @@ -479,7 +480,9 @@ static bool cfg80211_get_chans_dfs_available(struct wiphy *wiphy, if (c->flags & IEEE80211_CHAN_DISABLED) return false; - if ((c->flags & IEEE80211_CHAN_RADAR) && + /* check for radar flags */ + if ((!(wiphy->flags & WIPHY_FLAG_DFS_OFFLOAD)) && + (c->flags & IEEE80211_CHAN_RADAR) && (c->dfs_state != NL80211_DFS_AVAILABLE)) return false; } @@ -590,10 +593,17 @@ static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy, for (freq = start_freq; freq <= end_freq; freq += 20) { c = ieee80211_get_channel(wiphy, freq); - if (!c || c->flags & prohibited_flags) + + if (!c) return false; - } + if ((!(wiphy->flags & WIPHY_FLAG_DFS_OFFLOAD)) && + (c->flags & prohibited_flags & IEEE80211_CHAN_RADAR)) + return false; + + if (c->flags & prohibited_flags & ~IEEE80211_CHAN_RADAR) + return false; + } return true; } @@ -739,7 +749,7 @@ static bool cfg80211_ir_permissive_chan(struct wiphy *wiphy, * and thus fail the GO instantiation, consider only the interfaces of * the current registered device. */ - list_for_each_entry(wdev, &rdev->wdev_list, list) { + list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { struct ieee80211_channel *other_chan = NULL; int r1, r2; |