Commit f3e979a52c554f45e4ca6f01ca6933acef34b872
Exists in
smarc-imx_3.14.28_1.0.0_ga
and in
1 other branch
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
Showing 17 changed files Side-by-side Diff
- drivers/net/wireless/ath/ath6kl/wmi.c
- drivers/net/wireless/ath/wil6210/wmi.c
- drivers/net/wireless/brcm80211/brcmfmac/p2p.c
- drivers/net/wireless/mac80211_hwsim.c
- drivers/net/wireless/mwifiex/util.c
- drivers/net/wireless/ti/wlcore/main.c
- include/net/cfg80211.h
- include/uapi/linux/nl80211.h
- net/mac80211/iface.c
- net/mac80211/main.c
- net/mac80211/mesh.c
- net/mac80211/rc80211_minstrel_ht.c
- net/mac80211/rx.c
- net/mac80211/tx.c
- net/wireless/mlme.c
- net/wireless/nl80211.c
- net/wireless/nl80211.h
drivers/net/wireless/ath/ath6kl/wmi.c
... | ... | @@ -568,8 +568,8 @@ |
568 | 568 | dlen, freq, vif->probe_req_report); |
569 | 569 | |
570 | 570 | if (vif->probe_req_report || vif->nw_type == AP_NETWORK) |
571 | - cfg80211_rx_mgmt(&vif->wdev, freq, 0, | |
572 | - ev->data, dlen, GFP_ATOMIC); | |
571 | + cfg80211_rx_mgmt(&vif->wdev, freq, 0, ev->data, dlen, 0, | |
572 | + GFP_ATOMIC); | |
573 | 573 | |
574 | 574 | return 0; |
575 | 575 | } |
... | ... | @@ -608,8 +608,7 @@ |
608 | 608 | return -EINVAL; |
609 | 609 | } |
610 | 610 | ath6kl_dbg(ATH6KL_DBG_WMI, "rx_action: len=%u freq=%u\n", dlen, freq); |
611 | - cfg80211_rx_mgmt(&vif->wdev, freq, 0, | |
612 | - ev->data, dlen, GFP_ATOMIC); | |
611 | + cfg80211_rx_mgmt(&vif->wdev, freq, 0, ev->data, dlen, 0, GFP_ATOMIC); | |
613 | 612 | |
614 | 613 | return 0; |
615 | 614 | } |
drivers/net/wireless/ath/wil6210/wmi.c
drivers/net/wireless/brcm80211/brcmfmac/p2p.c
... | ... | @@ -1430,7 +1430,7 @@ |
1430 | 1430 | IEEE80211_BAND_5GHZ); |
1431 | 1431 | |
1432 | 1432 | wdev = &ifp->vif->wdev; |
1433 | - cfg80211_rx_mgmt(wdev, freq, 0, (u8 *)mgmt_frame, mgmt_frame_len, | |
1433 | + cfg80211_rx_mgmt(wdev, freq, 0, (u8 *)mgmt_frame, mgmt_frame_len, 0, | |
1434 | 1434 | GFP_ATOMIC); |
1435 | 1435 | |
1436 | 1436 | kfree(mgmt_frame); |
... | ... | @@ -1895,7 +1895,7 @@ |
1895 | 1895 | IEEE80211_BAND_2GHZ : |
1896 | 1896 | IEEE80211_BAND_5GHZ); |
1897 | 1897 | |
1898 | - cfg80211_rx_mgmt(&vif->wdev, freq, 0, mgmt_frame, mgmt_frame_len, | |
1898 | + cfg80211_rx_mgmt(&vif->wdev, freq, 0, mgmt_frame, mgmt_frame_len, 0, | |
1899 | 1899 | GFP_ATOMIC); |
1900 | 1900 | |
1901 | 1901 | brcmf_dbg(INFO, "mgmt_frame_len (%d) , e->datalen (%d), chanspec (%04x), freq (%d)\n", |
drivers/net/wireless/mac80211_hwsim.c
drivers/net/wireless/mwifiex/util.c
... | ... | @@ -171,8 +171,8 @@ |
171 | 171 | rx_pd->rx_pkt_length = cpu_to_le16(pkt_len); |
172 | 172 | |
173 | 173 | cfg80211_rx_mgmt(priv->wdev, priv->roc_cfg.chan.center_freq, |
174 | - CAL_RSSI(rx_pd->snr, rx_pd->nf), | |
175 | - skb->data, pkt_len, GFP_ATOMIC); | |
174 | + CAL_RSSI(rx_pd->snr, rx_pd->nf), skb->data, pkt_len, | |
175 | + 0, GFP_ATOMIC); | |
176 | 176 | |
177 | 177 | return 0; |
178 | 178 | } |
drivers/net/wireless/ti/wlcore/main.c
... | ... | @@ -5623,7 +5623,8 @@ |
5623 | 5623 | wl->hw->wiphy->max_remain_on_channel_duration = 5000; |
5624 | 5624 | |
5625 | 5625 | wl->hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD | |
5626 | - WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; | |
5626 | + WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL | | |
5627 | + WIPHY_FLAG_SUPPORTS_SCHED_SCAN; | |
5627 | 5628 | |
5628 | 5629 | /* make sure all our channels fit in the scanned_ch bitmask */ |
5629 | 5630 | BUILD_BUG_ON(ARRAY_SIZE(wl1271_channels) + |
include/net/cfg80211.h
... | ... | @@ -4056,6 +4056,7 @@ |
4056 | 4056 | * @sig_dbm: signal strength in mBm, or 0 if unknown |
4057 | 4057 | * @buf: Management frame (header + body) |
4058 | 4058 | * @len: length of the frame data |
4059 | + * @flags: flags, as defined in enum nl80211_rxmgmt_flags | |
4059 | 4060 | * @gfp: context flags |
4060 | 4061 | * |
4061 | 4062 | * This function is called whenever an Action frame is received for a station |
... | ... | @@ -4067,7 +4068,7 @@ |
4067 | 4068 | * driver is responsible for rejecting the frame. |
4068 | 4069 | */ |
4069 | 4070 | bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm, |
4070 | - const u8 *buf, size_t len, gfp_t gfp); | |
4071 | + const u8 *buf, size_t len, u32 flags, gfp_t gfp); | |
4071 | 4072 | |
4072 | 4073 | /** |
4073 | 4074 | * cfg80211_mgmt_tx_status - notification of TX status for management frame |
include/uapi/linux/nl80211.h
... | ... | @@ -1493,6 +1493,9 @@ |
1493 | 1493 | * @NL80211_ATTR_CSA_C_OFF_PRESP: Offset of the channel switch counter |
1494 | 1494 | * field in the probe response (%NL80211_ATTR_PROBE_RESP). |
1495 | 1495 | * |
1496 | + * @NL80211_ATTR_RXMGMT_FLAGS: flags for nl80211_send_mgmt(), u32. | |
1497 | + * As specified in the &enum nl80211_rxmgmt_flags. | |
1498 | + * | |
1496 | 1499 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
1497 | 1500 | * @__NL80211_ATTR_AFTER_LAST: internal use |
1498 | 1501 | */ |
... | ... | @@ -1801,6 +1804,8 @@ |
1801 | 1804 | NL80211_ATTR_CSA_C_OFF_BEACON, |
1802 | 1805 | NL80211_ATTR_CSA_C_OFF_PRESP, |
1803 | 1806 | |
1807 | + NL80211_ATTR_RXMGMT_FLAGS, | |
1808 | + | |
1804 | 1809 | /* add attributes here, update the policy in nl80211.c */ |
1805 | 1810 | |
1806 | 1811 | __NL80211_ATTR_AFTER_LAST, |
... | ... | @@ -3900,6 +3905,17 @@ |
3900 | 3905 | |
3901 | 3906 | /* maximum duration for critical protocol measures */ |
3902 | 3907 | #define NL80211_CRIT_PROTO_MAX_DURATION 5000 /* msec */ |
3908 | + | |
3909 | +/** | |
3910 | + * enum nl80211_rxmgmt_flags - flags for received management frame. | |
3911 | + * | |
3912 | + * Used by cfg80211_rx_mgmt() | |
3913 | + * | |
3914 | + * @NL80211_RXMGMT_FLAG_ANSWERED: frame was answered by device/driver. | |
3915 | + */ | |
3916 | +enum nl80211_rxmgmt_flags { | |
3917 | + NL80211_RXMGMT_FLAG_ANSWERED = 1 << 0, | |
3918 | +}; | |
3903 | 3919 | |
3904 | 3920 | #endif /* __LINUX_NL80211_H */ |
net/mac80211/iface.c
... | ... | @@ -308,12 +308,13 @@ |
308 | 308 | return 0; |
309 | 309 | } |
310 | 310 | |
311 | -static int ieee80211_check_queues(struct ieee80211_sub_if_data *sdata) | |
311 | +static int ieee80211_check_queues(struct ieee80211_sub_if_data *sdata, | |
312 | + enum nl80211_iftype iftype) | |
312 | 313 | { |
313 | 314 | int n_queues = sdata->local->hw.queues; |
314 | 315 | int i; |
315 | 316 | |
316 | - if (sdata->vif.type != NL80211_IFTYPE_P2P_DEVICE) { | |
317 | + if (iftype != NL80211_IFTYPE_P2P_DEVICE) { | |
317 | 318 | for (i = 0; i < IEEE80211_NUM_ACS; i++) { |
318 | 319 | if (WARN_ON_ONCE(sdata->vif.hw_queue[i] == |
319 | 320 | IEEE80211_INVAL_HW_QUEUE)) |
... | ... | @@ -324,8 +325,9 @@ |
324 | 325 | } |
325 | 326 | } |
326 | 327 | |
327 | - if ((sdata->vif.type != NL80211_IFTYPE_AP && | |
328 | - sdata->vif.type != NL80211_IFTYPE_MESH_POINT) || | |
328 | + if ((iftype != NL80211_IFTYPE_AP && | |
329 | + iftype != NL80211_IFTYPE_P2P_GO && | |
330 | + iftype != NL80211_IFTYPE_MESH_POINT) || | |
329 | 331 | !(sdata->local->hw.flags & IEEE80211_HW_QUEUE_CONTROL)) { |
330 | 332 | sdata->vif.cab_queue = IEEE80211_INVAL_HW_QUEUE; |
331 | 333 | return 0; |
... | ... | @@ -408,7 +410,7 @@ |
408 | 410 | return ret; |
409 | 411 | } |
410 | 412 | |
411 | - ret = ieee80211_check_queues(sdata); | |
413 | + ret = ieee80211_check_queues(sdata, NL80211_IFTYPE_MONITOR); | |
412 | 414 | if (ret) { |
413 | 415 | kfree(sdata); |
414 | 416 | return ret; |
... | ... | @@ -592,7 +594,8 @@ |
592 | 594 | res = drv_add_interface(local, sdata); |
593 | 595 | if (res) |
594 | 596 | goto err_stop; |
595 | - res = ieee80211_check_queues(sdata); | |
597 | + res = ieee80211_check_queues(sdata, | |
598 | + ieee80211_vif_type_p2p(&sdata->vif)); | |
596 | 599 | if (res) |
597 | 600 | goto err_del_interface; |
598 | 601 | } |
599 | 602 | |
... | ... | @@ -1389,14 +1392,14 @@ |
1389 | 1392 | |
1390 | 1393 | ret = drv_change_interface(local, sdata, internal_type, p2p); |
1391 | 1394 | if (ret) |
1392 | - type = sdata->vif.type; | |
1395 | + type = ieee80211_vif_type_p2p(&sdata->vif); | |
1393 | 1396 | |
1394 | 1397 | /* |
1395 | 1398 | * Ignore return value here, there's not much we can do since |
1396 | 1399 | * the driver changed the interface type internally already. |
1397 | 1400 | * The warnings will hopefully make driver authors fix it :-) |
1398 | 1401 | */ |
1399 | - ieee80211_check_queues(sdata); | |
1402 | + ieee80211_check_queues(sdata, type); | |
1400 | 1403 | |
1401 | 1404 | ieee80211_setup_sdata(sdata, type); |
1402 | 1405 |
net/mac80211/main.c
... | ... | @@ -892,9 +892,6 @@ |
892 | 892 | if (!local->ops->remain_on_channel) |
893 | 893 | local->hw.wiphy->max_remain_on_channel_duration = 5000; |
894 | 894 | |
895 | - if (local->ops->sched_scan_start) | |
896 | - local->hw.wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN; | |
897 | - | |
898 | 895 | /* mac80211 based drivers don't support internal TDLS setup */ |
899 | 896 | if (local->hw.wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS) |
900 | 897 | local->hw.wiphy->flags |= WIPHY_FLAG_TDLS_EXTERNAL_SETUP; |
net/mac80211/mesh.c
... | ... | @@ -832,6 +832,9 @@ |
832 | 832 | |
833 | 833 | ieee802_11_parse_elems(pos, len - baselen, false, &elems); |
834 | 834 | |
835 | + if (!elems.mesh_id) | |
836 | + return; | |
837 | + | |
835 | 838 | /* 802.11-2012 10.1.4.3.2 */ |
836 | 839 | if ((!ether_addr_equal(mgmt->da, sdata->vif.addr) && |
837 | 840 | !is_broadcast_ether_addr(mgmt->da)) || |
net/mac80211/rc80211_minstrel_ht.c
... | ... | @@ -439,13 +439,12 @@ |
439 | 439 | { |
440 | 440 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; |
441 | 441 | struct sta_info *sta = container_of(pubsta, struct sta_info, sta); |
442 | - struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | |
443 | 442 | u16 tid; |
444 | 443 | |
445 | 444 | if (unlikely(!ieee80211_is_data_qos(hdr->frame_control))) |
446 | 445 | return; |
447 | 446 | |
448 | - if (unlikely(info->control.flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO)) | |
447 | + if (unlikely(skb->protocol == cpu_to_be16(ETH_P_PAE))) | |
449 | 448 | return; |
450 | 449 | |
451 | 450 | tid = *ieee80211_get_qos_ctl(hdr) & IEEE80211_QOS_CTL_TID_MASK; |
net/mac80211/rx.c
... | ... | @@ -2684,8 +2684,7 @@ |
2684 | 2684 | sig = status->signal; |
2685 | 2685 | |
2686 | 2686 | if (cfg80211_rx_mgmt(&rx->sdata->wdev, status->freq, sig, |
2687 | - rx->skb->data, rx->skb->len, | |
2688 | - GFP_ATOMIC)) { | |
2687 | + rx->skb->data, rx->skb->len, 0, GFP_ATOMIC)) { | |
2689 | 2688 | if (rx->sta) |
2690 | 2689 | rx->sta->rx_packets++; |
2691 | 2690 | dev_kfree_skb(rx->skb); |
net/mac80211/tx.c
... | ... | @@ -781,9 +781,11 @@ |
781 | 781 | /* |
782 | 782 | * Anything but QoS data that has a sequence number field |
783 | 783 | * (is long enough) gets a sequence number from the global |
784 | - * counter. | |
784 | + * counter. QoS data frames with a multicast destination | |
785 | + * also use the global counter (802.11-2012 9.3.2.10). | |
785 | 786 | */ |
786 | - if (!ieee80211_is_data_qos(hdr->frame_control)) { | |
787 | + if (!ieee80211_is_data_qos(hdr->frame_control) || | |
788 | + is_multicast_ether_addr(hdr->addr1)) { | |
787 | 789 | /* driver should assign sequence number */ |
788 | 790 | info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ; |
789 | 791 | /* for pure STA mode without beacons, we can do it */ |
net/wireless/mlme.c
... | ... | @@ -621,7 +621,7 @@ |
621 | 621 | } |
622 | 622 | |
623 | 623 | bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_mbm, |
624 | - const u8 *buf, size_t len, gfp_t gfp) | |
624 | + const u8 *buf, size_t len, u32 flags, gfp_t gfp) | |
625 | 625 | { |
626 | 626 | struct wiphy *wiphy = wdev->wiphy; |
627 | 627 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); |
... | ... | @@ -664,7 +664,7 @@ |
664 | 664 | /* Indicate the received Action frame to user space */ |
665 | 665 | if (nl80211_send_mgmt(rdev, wdev, reg->nlportid, |
666 | 666 | freq, sig_mbm, |
667 | - buf, len, gfp)) | |
667 | + buf, len, flags, gfp)) | |
668 | 668 | continue; |
669 | 669 | |
670 | 670 | result = true; |
net/wireless/nl80211.c
... | ... | @@ -10450,7 +10450,7 @@ |
10450 | 10450 | int nl80211_send_mgmt(struct cfg80211_registered_device *rdev, |
10451 | 10451 | struct wireless_dev *wdev, u32 nlportid, |
10452 | 10452 | int freq, int sig_dbm, |
10453 | - const u8 *buf, size_t len, gfp_t gfp) | |
10453 | + const u8 *buf, size_t len, u32 flags, gfp_t gfp) | |
10454 | 10454 | { |
10455 | 10455 | struct net_device *netdev = wdev->netdev; |
10456 | 10456 | struct sk_buff *msg; |
... | ... | @@ -10473,7 +10473,9 @@ |
10473 | 10473 | nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, freq) || |
10474 | 10474 | (sig_dbm && |
10475 | 10475 | nla_put_u32(msg, NL80211_ATTR_RX_SIGNAL_DBM, sig_dbm)) || |
10476 | - nla_put(msg, NL80211_ATTR_FRAME, len, buf)) | |
10476 | + nla_put(msg, NL80211_ATTR_FRAME, len, buf) || | |
10477 | + (flags && | |
10478 | + nla_put_u32(msg, NL80211_ATTR_RXMGMT_FLAGS, flags))) | |
10477 | 10479 | goto nla_put_failure; |
10478 | 10480 | |
10479 | 10481 | genlmsg_end(msg, hdr); |
net/wireless/nl80211.h
... | ... | @@ -66,7 +66,7 @@ |
66 | 66 | int nl80211_send_mgmt(struct cfg80211_registered_device *rdev, |
67 | 67 | struct wireless_dev *wdev, u32 nlpid, |
68 | 68 | int freq, int sig_dbm, |
69 | - const u8 *buf, size_t len, gfp_t gfp); | |
69 | + const u8 *buf, size_t len, u32 flags, gfp_t gfp); | |
70 | 70 | |
71 | 71 | void |
72 | 72 | nl80211_radar_notify(struct cfg80211_registered_device *rdev, |