aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/mac80211/ieee80211_i.h2
-rw-r--r--net/mac80211/main.c8
-rw-r--r--net/mac80211/util.c25
3 files changed, 34 insertions, 1 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index b88bdfd248ff..e0423f8c0ce1 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1480,6 +1480,8 @@ u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
1480 struct ieee80211_channel *channel, 1480 struct ieee80211_channel *channel,
1481 enum nl80211_channel_type channel_type, 1481 enum nl80211_channel_type channel_type,
1482 u16 prot_mode); 1482 u16 prot_mode);
1483u8 *ieee80211_ie_build_vht_cap(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap,
1484 u32 cap);
1483int ieee80211_add_srates_ie(struct ieee80211_sub_if_data *sdata, 1485int ieee80211_add_srates_ie(struct ieee80211_sub_if_data *sdata,
1484 struct sk_buff *skb, bool need_basic); 1486 struct sk_buff *skb, bool need_basic);
1485int ieee80211_add_ext_srates_ie(struct ieee80211_sub_if_data *sdata, 1487int ieee80211_add_ext_srates_ie(struct ieee80211_sub_if_data *sdata,
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index aded0018f6f3..ab32c59be894 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -688,7 +688,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
688 int result, i; 688 int result, i;
689 enum ieee80211_band band; 689 enum ieee80211_band band;
690 int channels, max_bitrates; 690 int channels, max_bitrates;
691 bool supp_ht; 691 bool supp_ht, supp_vht;
692 netdev_features_t feature_whitelist; 692 netdev_features_t feature_whitelist;
693 static const u32 cipher_suites[] = { 693 static const u32 cipher_suites[] = {
694 /* keep WEP first, it may be removed below */ 694 /* keep WEP first, it may be removed below */
@@ -732,6 +732,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
732 channels = 0; 732 channels = 0;
733 max_bitrates = 0; 733 max_bitrates = 0;
734 supp_ht = false; 734 supp_ht = false;
735 supp_vht = false;
735 for (band = 0; band < IEEE80211_NUM_BANDS; band++) { 736 for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
736 struct ieee80211_supported_band *sband; 737 struct ieee80211_supported_band *sband;
737 738
@@ -749,6 +750,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
749 if (max_bitrates < sband->n_bitrates) 750 if (max_bitrates < sband->n_bitrates)
750 max_bitrates = sband->n_bitrates; 751 max_bitrates = sband->n_bitrates;
751 supp_ht = supp_ht || sband->ht_cap.ht_supported; 752 supp_ht = supp_ht || sband->ht_cap.ht_supported;
753 supp_vht = supp_vht || sband->vht_cap.vht_supported;
752 } 754 }
753 755
754 local->int_scan_req = kzalloc(sizeof(*local->int_scan_req) + 756 local->int_scan_req = kzalloc(sizeof(*local->int_scan_req) +
@@ -824,6 +826,10 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
824 if (supp_ht) 826 if (supp_ht)
825 local->scan_ies_len += 2 + sizeof(struct ieee80211_ht_cap); 827 local->scan_ies_len += 2 + sizeof(struct ieee80211_ht_cap);
826 828
829 if (supp_vht)
830 local->scan_ies_len +=
831 2 + sizeof(struct ieee80211_vht_capabilities);
832
827 if (!local->ops->hw_scan) { 833 if (!local->ops->hw_scan) {
828 /* For hw_scan, driver needs to set these up. */ 834 /* For hw_scan, driver needs to set these up. */
829 local->hw.wiphy->max_scan_ssids = 4; 835 local->hw.wiphy->max_scan_ssids = 4;
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index c4245695afc3..cb73a0341af4 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1072,6 +1072,10 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
1072 pos += noffset - offset; 1072 pos += noffset - offset;
1073 } 1073 }
1074 1074
1075 if (sband->vht_cap.vht_supported)
1076 pos = ieee80211_ie_build_vht_cap(pos, &sband->vht_cap,
1077 sband->vht_cap.cap);
1078
1075 return pos - buffer; 1079 return pos - buffer;
1076} 1080}
1077 1081
@@ -1699,6 +1703,27 @@ u8 *ieee80211_ie_build_ht_cap(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
1699 return pos; 1703 return pos;
1700} 1704}
1701 1705
1706u8 *ieee80211_ie_build_vht_cap(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap,
1707 u32 cap)
1708{
1709 __le32 tmp;
1710
1711 *pos++ = WLAN_EID_VHT_CAPABILITY;
1712 *pos++ = sizeof(struct ieee80211_vht_capabilities);
1713 memset(pos, 0, sizeof(struct ieee80211_vht_capabilities));
1714
1715 /* capability flags */
1716 tmp = cpu_to_le32(cap);
1717 memcpy(pos, &tmp, sizeof(u32));
1718 pos += sizeof(u32);
1719
1720 /* VHT MCS set */
1721 memcpy(pos, &vht_cap->vht_mcs, sizeof(vht_cap->vht_mcs));
1722 pos += sizeof(vht_cap->vht_mcs);
1723
1724 return pos;
1725}
1726
1702u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap, 1727u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
1703 struct ieee80211_channel *channel, 1728 struct ieee80211_channel *channel,
1704 enum nl80211_channel_type channel_type, 1729 enum nl80211_channel_type channel_type,