Commit ba0afa2f authored by Mahesh Palivela's avatar Mahesh Palivela Committed by Johannes Berg

mac80211: include VHT capability IE in probe requests

Insert the VHT capability IE into probe requests.
Signed-off-by: default avatarMahesh Palivela <maheshp@posedge.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent b188148c
...@@ -1480,6 +1480,8 @@ u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap, ...@@ -1480,6 +1480,8 @@ u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
struct ieee80211_channel *channel, struct ieee80211_channel *channel,
enum nl80211_channel_type channel_type, enum nl80211_channel_type channel_type,
u16 prot_mode); u16 prot_mode);
u8 *ieee80211_ie_build_vht_cap(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap,
u32 cap);
int ieee80211_add_srates_ie(struct ieee80211_sub_if_data *sdata, int ieee80211_add_srates_ie(struct ieee80211_sub_if_data *sdata,
struct sk_buff *skb, bool need_basic); struct sk_buff *skb, bool need_basic);
int ieee80211_add_ext_srates_ie(struct ieee80211_sub_if_data *sdata, int ieee80211_add_ext_srates_ie(struct ieee80211_sub_if_data *sdata,
......
...@@ -688,7 +688,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) ...@@ -688,7 +688,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
int result, i; int result, i;
enum ieee80211_band band; enum ieee80211_band band;
int channels, max_bitrates; int channels, max_bitrates;
bool supp_ht; bool supp_ht, supp_vht;
netdev_features_t feature_whitelist; netdev_features_t feature_whitelist;
static const u32 cipher_suites[] = { static const u32 cipher_suites[] = {
/* keep WEP first, it may be removed below */ /* keep WEP first, it may be removed below */
...@@ -732,6 +732,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) ...@@ -732,6 +732,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
channels = 0; channels = 0;
max_bitrates = 0; max_bitrates = 0;
supp_ht = false; supp_ht = false;
supp_vht = false;
for (band = 0; band < IEEE80211_NUM_BANDS; band++) { for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
struct ieee80211_supported_band *sband; struct ieee80211_supported_band *sband;
...@@ -749,6 +750,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) ...@@ -749,6 +750,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
if (max_bitrates < sband->n_bitrates) if (max_bitrates < sband->n_bitrates)
max_bitrates = sband->n_bitrates; max_bitrates = sband->n_bitrates;
supp_ht = supp_ht || sband->ht_cap.ht_supported; supp_ht = supp_ht || sband->ht_cap.ht_supported;
supp_vht = supp_vht || sband->vht_cap.vht_supported;
} }
local->int_scan_req = kzalloc(sizeof(*local->int_scan_req) + local->int_scan_req = kzalloc(sizeof(*local->int_scan_req) +
...@@ -824,6 +826,10 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) ...@@ -824,6 +826,10 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
if (supp_ht) if (supp_ht)
local->scan_ies_len += 2 + sizeof(struct ieee80211_ht_cap); local->scan_ies_len += 2 + sizeof(struct ieee80211_ht_cap);
if (supp_vht)
local->scan_ies_len +=
2 + sizeof(struct ieee80211_vht_capabilities);
if (!local->ops->hw_scan) { if (!local->ops->hw_scan) {
/* For hw_scan, driver needs to set these up. */ /* For hw_scan, driver needs to set these up. */
local->hw.wiphy->max_scan_ssids = 4; local->hw.wiphy->max_scan_ssids = 4;
......
...@@ -1072,6 +1072,10 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer, ...@@ -1072,6 +1072,10 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
pos += noffset - offset; pos += noffset - offset;
} }
if (sband->vht_cap.vht_supported)
pos = ieee80211_ie_build_vht_cap(pos, &sband->vht_cap,
sband->vht_cap.cap);
return pos - buffer; return pos - buffer;
} }
...@@ -1699,6 +1703,27 @@ u8 *ieee80211_ie_build_ht_cap(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap, ...@@ -1699,6 +1703,27 @@ u8 *ieee80211_ie_build_ht_cap(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
return pos; return pos;
} }
u8 *ieee80211_ie_build_vht_cap(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap,
u32 cap)
{
__le32 tmp;
*pos++ = WLAN_EID_VHT_CAPABILITY;
*pos++ = sizeof(struct ieee80211_vht_capabilities);
memset(pos, 0, sizeof(struct ieee80211_vht_capabilities));
/* capability flags */
tmp = cpu_to_le32(cap);
memcpy(pos, &tmp, sizeof(u32));
pos += sizeof(u32);
/* VHT MCS set */
memcpy(pos, &vht_cap->vht_mcs, sizeof(vht_cap->vht_mcs));
pos += sizeof(vht_cap->vht_mcs);
return pos;
}
u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap, u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
struct ieee80211_channel *channel, struct ieee80211_channel *channel,
enum nl80211_channel_type channel_type, enum nl80211_channel_type channel_type,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment