diff options
author | David S. Miller <davem@davemloft.net> | 2015-01-27 19:59:56 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-27 19:59:56 -0500 |
commit | 95f873f2fff96c592c5d863e2a39825bd8bf0500 (patch) | |
tree | 0d2dd664964ba2c701aefea5b4d1e85b481045e1 /net/wireless | |
parent | 8ea65f4a2dfaaf494ef42a16cbf2fea39b07450f (diff) | |
parent | 59343cd7c4809cf7598789e1cd14563780ae4239 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
arch/arm/boot/dts/imx6sx-sdb.dts
net/sched/cls_bpf.c
Two simple sets of overlapping changes.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/nl80211.c | 9 | ||||
-rw-r--r-- | net/wireless/reg.c | 56 | ||||
-rw-r--r-- | net/wireless/util.c | 6 |
3 files changed, 44 insertions, 27 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 4fc812f2b583..7d60f4bf95d2 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -2871,6 +2871,9 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info) | |||
2871 | if (!rdev->ops->get_key) | 2871 | if (!rdev->ops->get_key) |
2872 | return -EOPNOTSUPP; | 2872 | return -EOPNOTSUPP; |
2873 | 2873 | ||
2874 | if (!pairwise && mac_addr && !(rdev->wiphy.flags & WIPHY_FLAG_IBSS_RSN)) | ||
2875 | return -ENOENT; | ||
2876 | |||
2874 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); | 2877 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |
2875 | if (!msg) | 2878 | if (!msg) |
2876 | return -ENOMEM; | 2879 | return -ENOMEM; |
@@ -2890,10 +2893,6 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info) | |||
2890 | nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr)) | 2893 | nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr)) |
2891 | goto nla_put_failure; | 2894 | goto nla_put_failure; |
2892 | 2895 | ||
2893 | if (pairwise && mac_addr && | ||
2894 | !(rdev->wiphy.flags & WIPHY_FLAG_IBSS_RSN)) | ||
2895 | return -ENOENT; | ||
2896 | |||
2897 | err = rdev_get_key(rdev, dev, key_idx, pairwise, mac_addr, &cookie, | 2896 | err = rdev_get_key(rdev, dev, key_idx, pairwise, mac_addr, &cookie, |
2898 | get_key_callback); | 2897 | get_key_callback); |
2899 | 2898 | ||
@@ -3064,7 +3063,7 @@ static int nl80211_del_key(struct sk_buff *skb, struct genl_info *info) | |||
3064 | wdev_lock(dev->ieee80211_ptr); | 3063 | wdev_lock(dev->ieee80211_ptr); |
3065 | err = nl80211_key_allowed(dev->ieee80211_ptr); | 3064 | err = nl80211_key_allowed(dev->ieee80211_ptr); |
3066 | 3065 | ||
3067 | if (key.type == NL80211_KEYTYPE_PAIRWISE && mac_addr && | 3066 | if (key.type == NL80211_KEYTYPE_GROUP && mac_addr && |
3068 | !(rdev->wiphy.flags & WIPHY_FLAG_IBSS_RSN)) | 3067 | !(rdev->wiphy.flags & WIPHY_FLAG_IBSS_RSN)) |
3069 | err = -ENOENT; | 3068 | err = -ENOENT; |
3070 | 3069 | ||
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 886cc7cb5566..b586d0dcb09e 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -1533,45 +1533,40 @@ static void reg_call_notifier(struct wiphy *wiphy, | |||
1533 | 1533 | ||
1534 | static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev) | 1534 | static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev) |
1535 | { | 1535 | { |
1536 | struct ieee80211_channel *ch; | ||
1537 | struct cfg80211_chan_def chandef; | 1536 | struct cfg80211_chan_def chandef; |
1538 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); | 1537 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
1539 | bool ret = true; | 1538 | enum nl80211_iftype iftype; |
1540 | 1539 | ||
1541 | wdev_lock(wdev); | 1540 | wdev_lock(wdev); |
1541 | iftype = wdev->iftype; | ||
1542 | 1542 | ||
1543 | /* make sure the interface is active */ | ||
1543 | if (!wdev->netdev || !netif_running(wdev->netdev)) | 1544 | if (!wdev->netdev || !netif_running(wdev->netdev)) |
1544 | goto out; | 1545 | goto wdev_inactive_unlock; |
1545 | 1546 | ||
1546 | switch (wdev->iftype) { | 1547 | switch (iftype) { |
1547 | case NL80211_IFTYPE_AP: | 1548 | case NL80211_IFTYPE_AP: |
1548 | case NL80211_IFTYPE_P2P_GO: | 1549 | case NL80211_IFTYPE_P2P_GO: |
1549 | if (!wdev->beacon_interval) | 1550 | if (!wdev->beacon_interval) |
1550 | goto out; | 1551 | goto wdev_inactive_unlock; |
1551 | 1552 | chandef = wdev->chandef; | |
1552 | ret = cfg80211_reg_can_beacon(wiphy, | ||
1553 | &wdev->chandef, wdev->iftype); | ||
1554 | break; | 1553 | break; |
1555 | case NL80211_IFTYPE_ADHOC: | 1554 | case NL80211_IFTYPE_ADHOC: |
1556 | if (!wdev->ssid_len) | 1555 | if (!wdev->ssid_len) |
1557 | goto out; | 1556 | goto wdev_inactive_unlock; |
1558 | 1557 | chandef = wdev->chandef; | |
1559 | ret = cfg80211_reg_can_beacon(wiphy, | ||
1560 | &wdev->chandef, wdev->iftype); | ||
1561 | break; | 1558 | break; |
1562 | case NL80211_IFTYPE_STATION: | 1559 | case NL80211_IFTYPE_STATION: |
1563 | case NL80211_IFTYPE_P2P_CLIENT: | 1560 | case NL80211_IFTYPE_P2P_CLIENT: |
1564 | if (!wdev->current_bss || | 1561 | if (!wdev->current_bss || |
1565 | !wdev->current_bss->pub.channel) | 1562 | !wdev->current_bss->pub.channel) |
1566 | goto out; | 1563 | goto wdev_inactive_unlock; |
1567 | 1564 | ||
1568 | ch = wdev->current_bss->pub.channel; | 1565 | if (!rdev->ops->get_channel || |
1569 | if (rdev->ops->get_channel && | 1566 | rdev_get_channel(rdev, wdev, &chandef)) |
1570 | !rdev_get_channel(rdev, wdev, &chandef)) | 1567 | cfg80211_chandef_create(&chandef, |
1571 | ret = cfg80211_chandef_usable(wiphy, &chandef, | 1568 | wdev->current_bss->pub.channel, |
1572 | IEEE80211_CHAN_DISABLED); | 1569 | NL80211_CHAN_NO_HT); |
1573 | else | ||
1574 | ret = !(ch->flags & IEEE80211_CHAN_DISABLED); | ||
1575 | break; | 1570 | break; |
1576 | case NL80211_IFTYPE_MONITOR: | 1571 | case NL80211_IFTYPE_MONITOR: |
1577 | case NL80211_IFTYPE_AP_VLAN: | 1572 | case NL80211_IFTYPE_AP_VLAN: |
@@ -1584,9 +1579,26 @@ static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev) | |||
1584 | break; | 1579 | break; |
1585 | } | 1580 | } |
1586 | 1581 | ||
1587 | out: | ||
1588 | wdev_unlock(wdev); | 1582 | wdev_unlock(wdev); |
1589 | return ret; | 1583 | |
1584 | switch (iftype) { | ||
1585 | case NL80211_IFTYPE_AP: | ||
1586 | case NL80211_IFTYPE_P2P_GO: | ||
1587 | case NL80211_IFTYPE_ADHOC: | ||
1588 | return cfg80211_reg_can_beacon(wiphy, &chandef, iftype); | ||
1589 | case NL80211_IFTYPE_STATION: | ||
1590 | case NL80211_IFTYPE_P2P_CLIENT: | ||
1591 | return cfg80211_chandef_usable(wiphy, &chandef, | ||
1592 | IEEE80211_CHAN_DISABLED); | ||
1593 | default: | ||
1594 | break; | ||
1595 | } | ||
1596 | |||
1597 | return true; | ||
1598 | |||
1599 | wdev_inactive_unlock: | ||
1600 | wdev_unlock(wdev); | ||
1601 | return true; | ||
1590 | } | 1602 | } |
1591 | 1603 | ||
1592 | static void reg_leave_invalid_chans(struct wiphy *wiphy) | 1604 | static void reg_leave_invalid_chans(struct wiphy *wiphy) |
diff --git a/net/wireless/util.c b/net/wireless/util.c index 97c744eeac4f..0d1966d54aaa 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c | |||
@@ -308,6 +308,12 @@ unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc) | |||
308 | goto out; | 308 | goto out; |
309 | } | 309 | } |
310 | 310 | ||
311 | if (ieee80211_is_mgmt(fc)) { | ||
312 | if (ieee80211_has_order(fc)) | ||
313 | hdrlen += IEEE80211_HT_CTL_LEN; | ||
314 | goto out; | ||
315 | } | ||
316 | |||
311 | if (ieee80211_is_ctl(fc)) { | 317 | if (ieee80211_is_ctl(fc)) { |
312 | /* | 318 | /* |
313 | * ACK and CTS are 10 bytes, all others 16. To see how | 319 | * ACK and CTS are 10 bytes, all others 16. To see how |