aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/main.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-06-30 08:08:12 -0400
committerDavid S. Miller <davem@davemloft.net>2018-06-30 08:08:12 -0400
commit8365da2c0570f02615e7f1d2d729d854029202b0 (patch)
tree223ab9641411c401269e5da80f260cafaf40eedc /net/mac80211/main.c
parenta1be5a20f137bdf436bab86c18998229908ce951 (diff)
parenta4217750586975dee7d6dd8829a1be24a7678b3d (diff)
Merge tag 'mac80211-next-for-davem-2018-06-29' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
Small merge conflict in net/mac80211/scan.c, I preserved the kcalloc() conversion. -DaveM Johannes Berg says: ==================== This round's updates: * finally some of the promised HE code, but it turns out to be small - but everything kept changing, so one part I did in the driver was >30 patches for what was ultimately <200 lines of code ... similar here for this code. * improved scan privacy support - can now specify scan flags for randomizing the sequence number as well as reducing the probe request element content * rfkill cleanups * a timekeeping cleanup from Arnd * various other cleanups ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r--net/mac80211/main.c36
1 files changed, 31 insertions, 5 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index fb73451ed85e..4fb2709cb527 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -3,6 +3,7 @@
3 * Copyright 2005-2006, Devicescape Software, Inc. 3 * Copyright 2005-2006, Devicescape Software, Inc.
4 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> 4 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
5 * Copyright 2013-2014 Intel Mobile Communications GmbH 5 * Copyright 2013-2014 Intel Mobile Communications GmbH
6 * Copyright (C) 2017 Intel Deutschland GmbH
6 * 7 *
7 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -557,10 +558,19 @@ struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len,
557 wiphy_ext_feature_set(wiphy, 558 wiphy_ext_feature_set(wiphy,
558 NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211); 559 NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211);
559 560
560 if (!ops->hw_scan) 561 if (!ops->hw_scan) {
561 wiphy->features |= NL80211_FEATURE_LOW_PRIORITY_SCAN | 562 wiphy->features |= NL80211_FEATURE_LOW_PRIORITY_SCAN |
562 NL80211_FEATURE_AP_SCAN; 563 NL80211_FEATURE_AP_SCAN;
563 564 /*
565 * if the driver behaves correctly using the probe request
566 * (template) from mac80211, then both of these should be
567 * supported even with hw scan - but let drivers opt in.
568 */
569 wiphy_ext_feature_set(wiphy,
570 NL80211_EXT_FEATURE_SCAN_RANDOM_SN);
571 wiphy_ext_feature_set(wiphy,
572 NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT);
573 }
564 574
565 if (!ops->set_key) 575 if (!ops->set_key)
566 wiphy->flags |= WIPHY_FLAG_IBSS_RSN; 576 wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
@@ -588,8 +598,8 @@ struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len,
588 local->hw.queues = 1; 598 local->hw.queues = 1;
589 local->hw.max_rates = 1; 599 local->hw.max_rates = 1;
590 local->hw.max_report_rates = 0; 600 local->hw.max_report_rates = 0;
591 local->hw.max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF; 601 local->hw.max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HT;
592 local->hw.max_tx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF; 602 local->hw.max_tx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HT;
593 local->hw.offchannel_tx_hw_queue = IEEE80211_INVAL_HW_QUEUE; 603 local->hw.offchannel_tx_hw_queue = IEEE80211_INVAL_HW_QUEUE;
594 local->hw.conf.long_frame_max_tx_count = wiphy->retry_long; 604 local->hw.conf.long_frame_max_tx_count = wiphy->retry_long;
595 local->hw.conf.short_frame_max_tx_count = wiphy->retry_short; 605 local->hw.conf.short_frame_max_tx_count = wiphy->retry_short;
@@ -816,7 +826,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
816 int result, i; 826 int result, i;
817 enum nl80211_band band; 827 enum nl80211_band band;
818 int channels, max_bitrates; 828 int channels, max_bitrates;
819 bool supp_ht, supp_vht; 829 bool supp_ht, supp_vht, supp_he;
820 netdev_features_t feature_whitelist; 830 netdev_features_t feature_whitelist;
821 struct cfg80211_chan_def dflt_chandef = {}; 831 struct cfg80211_chan_def dflt_chandef = {};
822 832
@@ -896,6 +906,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
896 max_bitrates = 0; 906 max_bitrates = 0;
897 supp_ht = false; 907 supp_ht = false;
898 supp_vht = false; 908 supp_vht = false;
909 supp_he = false;
899 for (band = 0; band < NUM_NL80211_BANDS; band++) { 910 for (band = 0; band < NUM_NL80211_BANDS; band++) {
900 struct ieee80211_supported_band *sband; 911 struct ieee80211_supported_band *sband;
901 912
@@ -922,6 +933,9 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
922 supp_ht = supp_ht || sband->ht_cap.ht_supported; 933 supp_ht = supp_ht || sband->ht_cap.ht_supported;
923 supp_vht = supp_vht || sband->vht_cap.vht_supported; 934 supp_vht = supp_vht || sband->vht_cap.vht_supported;
924 935
936 if (!supp_he)
937 supp_he = !!ieee80211_get_he_sta_cap(sband);
938
925 if (!sband->ht_cap.ht_supported) 939 if (!sband->ht_cap.ht_supported)
926 continue; 940 continue;
927 941
@@ -1011,6 +1025,18 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
1011 local->scan_ies_len += 1025 local->scan_ies_len +=
1012 2 + sizeof(struct ieee80211_vht_cap); 1026 2 + sizeof(struct ieee80211_vht_cap);
1013 1027
1028 /* HE cap element is variable in size - set len to allow max size */
1029 /*
1030 * TODO: 1 is added at the end of the calculation to accommodate for
1031 * the temporary placing of the HE capabilities IE under EXT.
1032 * Remove it once it is placed in the final place.
1033 */
1034 if (supp_he)
1035 local->scan_ies_len +=
1036 2 + sizeof(struct ieee80211_he_cap_elem) +
1037 sizeof(struct ieee80211_he_mcs_nss_supp) +
1038 IEEE80211_HE_PPE_THRES_MAX_LEN + 1;
1039
1014 if (!local->ops->hw_scan) { 1040 if (!local->ops->hw_scan) {
1015 /* For hw_scan, driver needs to set these up. */ 1041 /* For hw_scan, driver needs to set these up. */
1016 local->hw.wiphy->max_scan_ssids = 4; 1042 local->hw.wiphy->max_scan_ssids = 4;