aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-11-08 13:15:39 -0500
committerDavid S. Miller <davem@davemloft.net>2013-11-08 13:15:39 -0500
commit74ecd3d1dd26f54ff36a0392f10e50fa8e256bd3 (patch)
tree878833c714ddcb35f1574f2b11e1f69d1130d206 /net/wireless/nl80211.c
parentdcd607718385d02ce3741de225927a57f528f93b (diff)
parentc1f3bb6bd317994beb3af7bbec4bf54ed0035509 (diff)
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next
John W. Linville says: ==================== Here is one more pull request for the 3.13 window. This is primarily composed of downstream pull requests that were posted while I was traveling during the last part of the 3.12 release. For the mac80211 bits, Johannes says: "I have two DFS fixes (ath9k already supports DFS) and a fix for a pointer race." And... "In this round for mac80211-next I have: * mesh channel switch support * a CCM rewrite, using potential hardware offloads * SMPS for AP mode * RF-kill GPIO driver updates to make it usable as an ACPI driver * regulatory improvements * documentation fixes * DFS for IBSS mode * and a few small other fixes/improvements" For the TI driver bits, Luca says: "Some patches intended for 3.13. Eliad continues upstreaming pending patches from the internal tree." For the iwlwifi bits, Emmanuel says: "There are a few fixes from Johannes mostly clean up patches. We have also a few other fixes that are relevant for the new firmware that has not been released yet." For the Bluetooth bits, Gustavo says: "A last fix to the 3.12. I ended forgetting to send it before, I hope we can still make the way to 3.12. It is a revert and it fixes an issue with bluetooth suspend/hibernate that had many bug reports. Please pull or let me know of any problems. Thanks!" (Obviously, that one didn't make 3.12...) Also... "One more big pull request for 3.13. These are the patches we queued during last week. Here you will find a lot of improvements to the HCI and L2CAP and MGMT layers with the main ones being a better debugfs support and end of work of splitting L2CAP into Core and Socket parts." Additionally, there is one ath9k patch to enable DFS in IBSS mode for that driver. I appreciate your consideration for taking this extra pull request this cycle. Please let me know if there are problems! ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r--net/wireless/nl80211.c62
1 files changed, 56 insertions, 6 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index cbbef88a8ebd..a7f4e7902104 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -354,6 +354,9 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
354 [NL80211_ATTR_CSA_IES] = { .type = NLA_NESTED }, 354 [NL80211_ATTR_CSA_IES] = { .type = NLA_NESTED },
355 [NL80211_ATTR_CSA_C_OFF_BEACON] = { .type = NLA_U16 }, 355 [NL80211_ATTR_CSA_C_OFF_BEACON] = { .type = NLA_U16 },
356 [NL80211_ATTR_CSA_C_OFF_PRESP] = { .type = NLA_U16 }, 356 [NL80211_ATTR_CSA_C_OFF_PRESP] = { .type = NLA_U16 },
357 [NL80211_ATTR_STA_SUPPORTED_CHANNELS] = { .type = NLA_BINARY },
358 [NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES] = { .type = NLA_BINARY },
359 [NL80211_ATTR_HANDLE_DFS] = { .type = NLA_FLAG },
357}; 360};
358 361
359/* policy for the key attributes */ 362/* policy for the key attributes */
@@ -3896,9 +3899,45 @@ static int nl80211_parse_sta_wme(struct genl_info *info,
3896 return 0; 3899 return 0;
3897} 3900}
3898 3901
3902static int nl80211_parse_sta_channel_info(struct genl_info *info,
3903 struct station_parameters *params)
3904{
3905 if (info->attrs[NL80211_ATTR_STA_SUPPORTED_CHANNELS]) {
3906 params->supported_channels =
3907 nla_data(info->attrs[NL80211_ATTR_STA_SUPPORTED_CHANNELS]);
3908 params->supported_channels_len =
3909 nla_len(info->attrs[NL80211_ATTR_STA_SUPPORTED_CHANNELS]);
3910 /*
3911 * Need to include at least one (first channel, number of
3912 * channels) tuple for each subband, and must have proper
3913 * tuples for the rest of the data as well.
3914 */
3915 if (params->supported_channels_len < 2)
3916 return -EINVAL;
3917 if (params->supported_channels_len % 2)
3918 return -EINVAL;
3919 }
3920
3921 if (info->attrs[NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES]) {
3922 params->supported_oper_classes =
3923 nla_data(info->attrs[NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES]);
3924 params->supported_oper_classes_len =
3925 nla_len(info->attrs[NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES]);
3926 /*
3927 * The value of the Length field of the Supported Operating
3928 * Classes element is between 2 and 253.
3929 */
3930 if (params->supported_oper_classes_len < 2 ||
3931 params->supported_oper_classes_len > 253)
3932 return -EINVAL;
3933 }
3934 return 0;
3935}
3936
3899static int nl80211_set_station_tdls(struct genl_info *info, 3937static int nl80211_set_station_tdls(struct genl_info *info,
3900 struct station_parameters *params) 3938 struct station_parameters *params)
3901{ 3939{
3940 int err;
3902 /* Dummy STA entry gets updated once the peer capabilities are known */ 3941 /* Dummy STA entry gets updated once the peer capabilities are known */
3903 if (info->attrs[NL80211_ATTR_PEER_AID]) 3942 if (info->attrs[NL80211_ATTR_PEER_AID])
3904 params->aid = nla_get_u16(info->attrs[NL80211_ATTR_PEER_AID]); 3943 params->aid = nla_get_u16(info->attrs[NL80211_ATTR_PEER_AID]);
@@ -3909,6 +3948,10 @@ static int nl80211_set_station_tdls(struct genl_info *info,
3909 params->vht_capa = 3948 params->vht_capa =
3910 nla_data(info->attrs[NL80211_ATTR_VHT_CAPABILITY]); 3949 nla_data(info->attrs[NL80211_ATTR_VHT_CAPABILITY]);
3911 3950
3951 err = nl80211_parse_sta_channel_info(info, params);
3952 if (err)
3953 return err;
3954
3912 return nl80211_parse_sta_wme(info, params); 3955 return nl80211_parse_sta_wme(info, params);
3913} 3956}
3914 3957
@@ -4089,6 +4132,10 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
4089 return -EINVAL; 4132 return -EINVAL;
4090 } 4133 }
4091 4134
4135 err = nl80211_parse_sta_channel_info(info, &params);
4136 if (err)
4137 return err;
4138
4092 err = nl80211_parse_sta_wme(info, &params); 4139 err = nl80211_parse_sta_wme(info, &params);
4093 if (err) 4140 if (err)
4094 return err; 4141 return err;
@@ -5653,6 +5700,7 @@ static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info)
5653 return -EINVAL; 5700 return -EINVAL;
5654 break; 5701 break;
5655 case NL80211_IFTYPE_ADHOC: 5702 case NL80211_IFTYPE_ADHOC:
5703 case NL80211_IFTYPE_MESH_POINT:
5656 break; 5704 break;
5657 default: 5705 default:
5658 return -EOPNOTSUPP; 5706 return -EOPNOTSUPP;
@@ -5665,9 +5713,7 @@ static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info)
5665 return -EINVAL; 5713 return -EINVAL;
5666 5714
5667 /* only important for AP, IBSS and mesh create IEs internally */ 5715 /* only important for AP, IBSS and mesh create IEs internally */
5668 if (need_new_beacon && 5716 if (need_new_beacon && !info->attrs[NL80211_ATTR_CSA_IES])
5669 (!info->attrs[NL80211_ATTR_CSA_IES] ||
5670 !info->attrs[NL80211_ATTR_CSA_C_OFF_BEACON]))
5671 return -EINVAL; 5717 return -EINVAL;
5672 5718
5673 params.count = nla_get_u32(info->attrs[NL80211_ATTR_CH_SWITCH_COUNT]); 5719 params.count = nla_get_u32(info->attrs[NL80211_ATTR_CH_SWITCH_COUNT]);
@@ -5722,9 +5768,9 @@ skip_beacons:
5722 if (!cfg80211_reg_can_beacon(&rdev->wiphy, &params.chandef)) 5768 if (!cfg80211_reg_can_beacon(&rdev->wiphy, &params.chandef))
5723 return -EINVAL; 5769 return -EINVAL;
5724 5770
5725 /* DFS channels are only supported for AP/P2P GO ... for now. */
5726 if (dev->ieee80211_ptr->iftype == NL80211_IFTYPE_AP || 5771 if (dev->ieee80211_ptr->iftype == NL80211_IFTYPE_AP ||
5727 dev->ieee80211_ptr->iftype == NL80211_IFTYPE_P2P_GO) { 5772 dev->ieee80211_ptr->iftype == NL80211_IFTYPE_P2P_GO ||
5773 dev->ieee80211_ptr->iftype == NL80211_IFTYPE_ADHOC) {
5728 err = cfg80211_chandef_dfs_required(wdev->wiphy, 5774 err = cfg80211_chandef_dfs_required(wdev->wiphy,
5729 &params.chandef); 5775 &params.chandef);
5730 if (err < 0) { 5776 if (err < 0) {
@@ -6556,6 +6602,9 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
6556 ibss.control_port = 6602 ibss.control_port =
6557 nla_get_flag(info->attrs[NL80211_ATTR_CONTROL_PORT]); 6603 nla_get_flag(info->attrs[NL80211_ATTR_CONTROL_PORT]);
6558 6604
6605 ibss.userspace_handles_dfs =
6606 nla_get_flag(info->attrs[NL80211_ATTR_HANDLE_DFS]);
6607
6559 err = cfg80211_join_ibss(rdev, dev, &ibss, connkeys); 6608 err = cfg80211_join_ibss(rdev, dev, &ibss, connkeys);
6560 if (err) 6609 if (err)
6561 kfree(connkeys); 6610 kfree(connkeys);
@@ -10762,7 +10811,8 @@ void cfg80211_ch_switch_notify(struct net_device *dev,
10762 10811
10763 if (WARN_ON(wdev->iftype != NL80211_IFTYPE_AP && 10812 if (WARN_ON(wdev->iftype != NL80211_IFTYPE_AP &&
10764 wdev->iftype != NL80211_IFTYPE_P2P_GO && 10813 wdev->iftype != NL80211_IFTYPE_P2P_GO &&
10765 wdev->iftype != NL80211_IFTYPE_ADHOC)) 10814 wdev->iftype != NL80211_IFTYPE_ADHOC &&
10815 wdev->iftype != NL80211_IFTYPE_MESH_POINT))
10766 goto out; 10816 goto out;
10767 10817
10768 wdev->channel = chandef->chan; 10818 wdev->channel = chandef->chan;