aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/core.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/wireless/core.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/wireless/core.c')
-rw-r--r--net/wireless/core.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 48e8097339ab..a88551f3bc43 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net> 4 * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
5 * Copyright 2013-2014 Intel Mobile Communications GmbH 5 * Copyright 2013-2014 Intel Mobile Communications GmbH
6 * Copyright 2015 Intel Deutschland GmbH 6 * Copyright 2015-2017 Intel Deutschland GmbH
7 */ 7 */
8 8
9#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 9#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
@@ -744,6 +744,8 @@ int wiphy_register(struct wiphy *wiphy)
744 744
745 /* sanity check supported bands/channels */ 745 /* sanity check supported bands/channels */
746 for (band = 0; band < NUM_NL80211_BANDS; band++) { 746 for (band = 0; band < NUM_NL80211_BANDS; band++) {
747 u16 types = 0;
748
747 sband = wiphy->bands[band]; 749 sband = wiphy->bands[band];
748 if (!sband) 750 if (!sband)
749 continue; 751 continue;
@@ -788,6 +790,23 @@ int wiphy_register(struct wiphy *wiphy)
788 sband->channels[i].band = band; 790 sband->channels[i].band = band;
789 } 791 }
790 792
793 for (i = 0; i < sband->n_iftype_data; i++) {
794 const struct ieee80211_sband_iftype_data *iftd;
795
796 iftd = &sband->iftype_data[i];
797
798 if (WARN_ON(!iftd->types_mask))
799 return -EINVAL;
800 if (WARN_ON(types & iftd->types_mask))
801 return -EINVAL;
802
803 /* at least one piece of information must be present */
804 if (WARN_ON(!iftd->he_cap.has_he))
805 return -EINVAL;
806
807 types |= iftd->types_mask;
808 }
809
791 have_band = true; 810 have_band = true;
792 } 811 }
793 812