diff options
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r-- | net/wireless/nl80211.c | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 8e6b6a2d35cb..2c38b28a85b9 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -384,6 +384,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = { | |||
384 | .len = IEEE80211_QOS_MAP_LEN_MAX }, | 384 | .len = IEEE80211_QOS_MAP_LEN_MAX }, |
385 | [NL80211_ATTR_MAC_HINT] = { .len = ETH_ALEN }, | 385 | [NL80211_ATTR_MAC_HINT] = { .len = ETH_ALEN }, |
386 | [NL80211_ATTR_WIPHY_FREQ_HINT] = { .type = NLA_U32 }, | 386 | [NL80211_ATTR_WIPHY_FREQ_HINT] = { .type = NLA_U32 }, |
387 | [NL80211_ATTR_TDLS_PEER_CAPABILITY] = { .type = NLA_U32 }, | ||
387 | }; | 388 | }; |
388 | 389 | ||
389 | /* policy for the key attributes */ | 390 | /* policy for the key attributes */ |
@@ -4627,6 +4628,8 @@ static int parse_reg_rule(struct nlattr *tb[], | |||
4627 | return -EINVAL; | 4628 | return -EINVAL; |
4628 | if (!tb[NL80211_ATTR_FREQ_RANGE_END]) | 4629 | if (!tb[NL80211_ATTR_FREQ_RANGE_END]) |
4629 | return -EINVAL; | 4630 | return -EINVAL; |
4631 | if (!tb[NL80211_ATTR_FREQ_RANGE_MAX_BW]) | ||
4632 | return -EINVAL; | ||
4630 | if (!tb[NL80211_ATTR_POWER_RULE_MAX_EIRP]) | 4633 | if (!tb[NL80211_ATTR_POWER_RULE_MAX_EIRP]) |
4631 | return -EINVAL; | 4634 | return -EINVAL; |
4632 | 4635 | ||
@@ -4636,9 +4639,8 @@ static int parse_reg_rule(struct nlattr *tb[], | |||
4636 | nla_get_u32(tb[NL80211_ATTR_FREQ_RANGE_START]); | 4639 | nla_get_u32(tb[NL80211_ATTR_FREQ_RANGE_START]); |
4637 | freq_range->end_freq_khz = | 4640 | freq_range->end_freq_khz = |
4638 | nla_get_u32(tb[NL80211_ATTR_FREQ_RANGE_END]); | 4641 | nla_get_u32(tb[NL80211_ATTR_FREQ_RANGE_END]); |
4639 | if (tb[NL80211_ATTR_FREQ_RANGE_MAX_BW]) | 4642 | freq_range->max_bandwidth_khz = |
4640 | freq_range->max_bandwidth_khz = | 4643 | nla_get_u32(tb[NL80211_ATTR_FREQ_RANGE_MAX_BW]); |
4641 | nla_get_u32(tb[NL80211_ATTR_FREQ_RANGE_MAX_BW]); | ||
4642 | 4644 | ||
4643 | power_rule->max_eirp = | 4645 | power_rule->max_eirp = |
4644 | nla_get_u32(tb[NL80211_ATTR_POWER_RULE_MAX_EIRP]); | 4646 | nla_get_u32(tb[NL80211_ATTR_POWER_RULE_MAX_EIRP]); |
@@ -5710,8 +5712,8 @@ static int nl80211_start_sched_scan(struct sk_buff *skb, | |||
5710 | request->min_rssi_thold = NL80211_SCAN_RSSI_THOLD_OFF; | 5712 | request->min_rssi_thold = NL80211_SCAN_RSSI_THOLD_OFF; |
5711 | } | 5713 | } |
5712 | 5714 | ||
5713 | if (info->attrs[NL80211_ATTR_IE]) { | 5715 | if (ie_len) { |
5714 | request->ie_len = nla_len(info->attrs[NL80211_ATTR_IE]); | 5716 | request->ie_len = ie_len; |
5715 | memcpy((void *)request->ie, | 5717 | memcpy((void *)request->ie, |
5716 | nla_data(info->attrs[NL80211_ATTR_IE]), | 5718 | nla_data(info->attrs[NL80211_ATTR_IE]), |
5717 | request->ie_len); | 5719 | request->ie_len); |
@@ -5911,17 +5913,22 @@ skip_beacons: | |||
5911 | if (!cfg80211_reg_can_beacon(&rdev->wiphy, ¶ms.chandef)) | 5913 | if (!cfg80211_reg_can_beacon(&rdev->wiphy, ¶ms.chandef)) |
5912 | return -EINVAL; | 5914 | return -EINVAL; |
5913 | 5915 | ||
5914 | if (dev->ieee80211_ptr->iftype == NL80211_IFTYPE_AP || | 5916 | switch (dev->ieee80211_ptr->iftype) { |
5915 | dev->ieee80211_ptr->iftype == NL80211_IFTYPE_P2P_GO || | 5917 | case NL80211_IFTYPE_AP: |
5916 | dev->ieee80211_ptr->iftype == NL80211_IFTYPE_ADHOC) { | 5918 | case NL80211_IFTYPE_P2P_GO: |
5919 | case NL80211_IFTYPE_ADHOC: | ||
5920 | case NL80211_IFTYPE_MESH_POINT: | ||
5917 | err = cfg80211_chandef_dfs_required(wdev->wiphy, | 5921 | err = cfg80211_chandef_dfs_required(wdev->wiphy, |
5918 | ¶ms.chandef); | 5922 | ¶ms.chandef); |
5919 | if (err < 0) { | 5923 | if (err < 0) |
5920 | return err; | 5924 | return err; |
5921 | } else if (err) { | 5925 | if (err) { |
5922 | radar_detect_width = BIT(params.chandef.width); | 5926 | radar_detect_width = BIT(params.chandef.width); |
5923 | params.radar_required = true; | 5927 | params.radar_required = true; |
5924 | } | 5928 | } |
5929 | break; | ||
5930 | default: | ||
5931 | break; | ||
5925 | } | 5932 | } |
5926 | 5933 | ||
5927 | err = cfg80211_can_use_iftype_chan(rdev, wdev, wdev->iftype, | 5934 | err = cfg80211_can_use_iftype_chan(rdev, wdev, wdev->iftype, |
@@ -7269,6 +7276,7 @@ static int nl80211_tdls_mgmt(struct sk_buff *skb, struct genl_info *info) | |||
7269 | struct cfg80211_registered_device *rdev = info->user_ptr[0]; | 7276 | struct cfg80211_registered_device *rdev = info->user_ptr[0]; |
7270 | struct net_device *dev = info->user_ptr[1]; | 7277 | struct net_device *dev = info->user_ptr[1]; |
7271 | u8 action_code, dialog_token; | 7278 | u8 action_code, dialog_token; |
7279 | u32 peer_capability = 0; | ||
7272 | u16 status_code; | 7280 | u16 status_code; |
7273 | u8 *peer; | 7281 | u8 *peer; |
7274 | 7282 | ||
@@ -7287,9 +7295,12 @@ static int nl80211_tdls_mgmt(struct sk_buff *skb, struct genl_info *info) | |||
7287 | action_code = nla_get_u8(info->attrs[NL80211_ATTR_TDLS_ACTION]); | 7295 | action_code = nla_get_u8(info->attrs[NL80211_ATTR_TDLS_ACTION]); |
7288 | status_code = nla_get_u16(info->attrs[NL80211_ATTR_STATUS_CODE]); | 7296 | status_code = nla_get_u16(info->attrs[NL80211_ATTR_STATUS_CODE]); |
7289 | dialog_token = nla_get_u8(info->attrs[NL80211_ATTR_TDLS_DIALOG_TOKEN]); | 7297 | dialog_token = nla_get_u8(info->attrs[NL80211_ATTR_TDLS_DIALOG_TOKEN]); |
7298 | if (info->attrs[NL80211_ATTR_TDLS_PEER_CAPABILITY]) | ||
7299 | peer_capability = | ||
7300 | nla_get_u32(info->attrs[NL80211_ATTR_TDLS_PEER_CAPABILITY]); | ||
7290 | 7301 | ||
7291 | return rdev_tdls_mgmt(rdev, dev, peer, action_code, | 7302 | return rdev_tdls_mgmt(rdev, dev, peer, action_code, |
7292 | dialog_token, status_code, | 7303 | dialog_token, status_code, peer_capability, |
7293 | nla_data(info->attrs[NL80211_ATTR_IE]), | 7304 | nla_data(info->attrs[NL80211_ATTR_IE]), |
7294 | nla_len(info->attrs[NL80211_ATTR_IE])); | 7305 | nla_len(info->attrs[NL80211_ATTR_IE])); |
7295 | } | 7306 | } |