cfg80211: Use new wiphy flag WIPHY_FLAG_DFS_OFFLOAD

When flag WIPHY_FLAG_DFS_OFFLOAD is defined, the driver would handle
all the DFS related operations. Therefore the kernel needs to ignore
the DFS state that it uses to block the userspace calls to the driver
through cfg80211 APIs. Also it should treat the userspace calls to
start radar detection as a no-op.

Change-Id: I9dd2076945581ca67e54dfc96dd3dbc526c6f0a2
CRs-Fixed: 630797
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>
[neelanshm@codeaurora.org: Do not include the unrequired
 change in util.c]
Signed-off-by: Neelansh Mittal <neelanshm@codeaurora.org>
This commit is contained in:
Amar Singhal 2014-03-19 18:36:58 -07:00 committed by David Keitel
parent 32d2b6aaf7
commit f3124f8f23
2 changed files with 8 additions and 2 deletions

View file

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

View file

@ -6483,6 +6483,9 @@ static int nl80211_start_radar_detection(struct sk_buff *skb,
if (err)
return err;
if (rdev->wiphy.flags & WIPHY_FLAG_DFS_OFFLOAD)
return -EOPNOTSUPP;
if (netif_carrier_ok(dev))
return -EBUSY;