aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/11n.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/mwifiex/11n.c')
-rw-r--r--drivers/net/wireless/mwifiex/11n.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/net/wireless/mwifiex/11n.c b/drivers/net/wireless/mwifiex/11n.c
index 41e9d25a2d8e..0b803c05cab3 100644
--- a/drivers/net/wireless/mwifiex/11n.c
+++ b/drivers/net/wireless/mwifiex/11n.c
@@ -292,6 +292,7 @@ mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv,
292 struct mwifiex_ie_types_extcap *ext_cap; 292 struct mwifiex_ie_types_extcap *ext_cap;
293 int ret_len = 0; 293 int ret_len = 0;
294 struct ieee80211_supported_band *sband; 294 struct ieee80211_supported_band *sband;
295 struct ieee_types_header *hdr;
295 u8 radio_type; 296 u8 radio_type;
296 297
297 if (!buffer || !*buffer) 298 if (!buffer || !*buffer)
@@ -388,17 +389,24 @@ mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv,
388 } 389 }
389 390
390 if (bss_desc->bcn_ext_cap) { 391 if (bss_desc->bcn_ext_cap) {
392 hdr = (void *)bss_desc->bcn_ext_cap;
391 ext_cap = (struct mwifiex_ie_types_extcap *) *buffer; 393 ext_cap = (struct mwifiex_ie_types_extcap *) *buffer;
392 memset(ext_cap, 0, sizeof(struct mwifiex_ie_types_extcap)); 394 memset(ext_cap, 0, sizeof(struct mwifiex_ie_types_extcap));
393 ext_cap->header.type = cpu_to_le16(WLAN_EID_EXT_CAPABILITY); 395 ext_cap->header.type = cpu_to_le16(WLAN_EID_EXT_CAPABILITY);
394 ext_cap->header.len = cpu_to_le16(sizeof(ext_cap->ext_cap)); 396 ext_cap->header.len = cpu_to_le16(hdr->len);
395 397
396 memcpy((u8 *)ext_cap + sizeof(struct mwifiex_ie_types_header), 398 memcpy((u8 *)ext_cap->ext_capab,
397 bss_desc->bcn_ext_cap + sizeof(struct ieee_types_header), 399 bss_desc->bcn_ext_cap + sizeof(struct ieee_types_header),
398 le16_to_cpu(ext_cap->header.len)); 400 le16_to_cpu(ext_cap->header.len));
399 401
400 *buffer += sizeof(struct mwifiex_ie_types_extcap); 402 if (hdr->len > 3 &&
401 ret_len += sizeof(struct mwifiex_ie_types_extcap); 403 ext_cap->ext_capab[3] & WLAN_EXT_CAPA4_INTERWORKING_ENABLED)
404 priv->hs2_enabled = true;
405 else
406 priv->hs2_enabled = false;
407
408 *buffer += sizeof(struct mwifiex_ie_types_extcap) + hdr->len;
409 ret_len += sizeof(struct mwifiex_ie_types_extcap) + hdr->len;
402 } 410 }
403 411
404 return ret_len; 412 return ret_len;