aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
authorLuciano Coelho <luciano.coelho@intel.com>2014-02-13 04:31:59 -0500
committerJohannes Berg <johannes.berg@intel.com>2014-04-09 04:55:43 -0400
commit73de86a38962b18edad3205c2358599dd9c83e9f (patch)
treecaf27b6e5000427c940a07d325d1210417ba87ad /net/wireless/nl80211.c
parent2beb6dab2d799ee8934cb0801845e551ad8c70f2 (diff)
cfg80211/mac80211: move interface counting for combination check to mac80211
Move the counting part of the interface combination check from cfg80211 to mac80211. This is needed to simplify locking when the driver has to perform a combination check by itself (eg. with channel-switch). Signed-off-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r--net/wireless/nl80211.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 4f82b9b71db1..2b99aad33ae0 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -3155,7 +3155,6 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
3155 struct wireless_dev *wdev = dev->ieee80211_ptr; 3155 struct wireless_dev *wdev = dev->ieee80211_ptr;
3156 struct cfg80211_ap_settings params; 3156 struct cfg80211_ap_settings params;
3157 int err; 3157 int err;
3158 u8 radar_detect_width = 0;
3159 3158
3160 if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP && 3159 if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP &&
3161 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_GO) 3160 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_GO)
@@ -3275,24 +3274,6 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
3275 wdev->iftype)) 3274 wdev->iftype))
3276 return -EINVAL; 3275 return -EINVAL;
3277 3276
3278 err = cfg80211_chandef_dfs_required(wdev->wiphy,
3279 &params.chandef,
3280 NL80211_IFTYPE_AP);
3281 if (err < 0)
3282 return err;
3283
3284 if (err > 0) {
3285 params.radar_required = true;
3286 radar_detect_width = BIT(params.chandef.width);
3287 }
3288
3289 err = cfg80211_can_use_iftype_chan(rdev, wdev, wdev->iftype,
3290 params.chandef.chan,
3291 CHAN_MODE_SHARED,
3292 radar_detect_width);
3293 if (err)
3294 return err;
3295
3296 if (info->attrs[NL80211_ATTR_ACL_POLICY]) { 3277 if (info->attrs[NL80211_ATTR_ACL_POLICY]) {
3297 params.acl = parse_acl_data(&rdev->wiphy, info); 3278 params.acl = parse_acl_data(&rdev->wiphy, info);
3298 if (IS_ERR(params.acl)) 3279 if (IS_ERR(params.acl))
@@ -5823,12 +5804,6 @@ static int nl80211_start_radar_detection(struct sk_buff *skb,
5823 if (!rdev->ops->start_radar_detection) 5804 if (!rdev->ops->start_radar_detection)
5824 return -EOPNOTSUPP; 5805 return -EOPNOTSUPP;
5825 5806
5826 err = cfg80211_can_use_iftype_chan(rdev, wdev, wdev->iftype,
5827 chandef.chan, CHAN_MODE_SHARED,
5828 BIT(chandef.width));
5829 if (err)
5830 return err;
5831
5832 cac_time_ms = cfg80211_chandef_dfs_cac_time(&rdev->wiphy, &chandef); 5807 cac_time_ms = cfg80211_chandef_dfs_cac_time(&rdev->wiphy, &chandef);
5833 if (WARN_ON(!cac_time_ms)) 5808 if (WARN_ON(!cac_time_ms))
5834 cac_time_ms = IEEE80211_DFS_MIN_CAC_TIME_MS; 5809 cac_time_ms = IEEE80211_DFS_MIN_CAC_TIME_MS;
@@ -5957,6 +5932,10 @@ skip_beacons:
5957 params.radar_required = true; 5932 params.radar_required = true;
5958 } 5933 }
5959 5934
5935 /* TODO: I left this here for now. With channel switch, the
5936 * verification is a bit more complicated, because we only do
5937 * it later when the channel switch really happens.
5938 */
5960 err = cfg80211_can_use_iftype_chan(rdev, wdev, wdev->iftype, 5939 err = cfg80211_can_use_iftype_chan(rdev, wdev, wdev->iftype,
5961 params.chandef.chan, 5940 params.chandef.chan,
5962 CHAN_MODE_SHARED, 5941 CHAN_MODE_SHARED,