Commit 9ab7b5b9 authored by Zhaoyang Liu's avatar Zhaoyang Liu Committed by Kalle Valo

mwifiex: fix invalid HT IE configuration in FW

This patch fixes an issue where it was discovered that driver is setting
invalid HT IEs to FW. This was happening because bug in parsing HT IE.
Driver would incorrectly point to start of HT IE while FW only needs actual
HT configuration - excluding EID and length.
Signed-off-by: default avatarZhaoyang Liu <liuzy@marvell.com>
Signed-off-by: default avatarAvinash Patil <patila@marvell.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 31a09a5d
...@@ -167,7 +167,7 @@ mwifiex_set_ht_params(struct mwifiex_private *priv, ...@@ -167,7 +167,7 @@ mwifiex_set_ht_params(struct mwifiex_private *priv,
ht_ie = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, params->beacon.tail, ht_ie = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, params->beacon.tail,
params->beacon.tail_len); params->beacon.tail_len);
if (ht_ie) { if (ht_ie) {
memcpy(&bss_cfg->ht_cap, ht_ie, memcpy(&bss_cfg->ht_cap, ht_ie + 2,
sizeof(struct ieee80211_ht_cap)); sizeof(struct ieee80211_ht_cap));
cap_info = le16_to_cpu(bss_cfg->ht_cap.cap_info); cap_info = le16_to_cpu(bss_cfg->ht_cap.cap_info);
memset(&bss_cfg->ht_cap.mcs, 0, memset(&bss_cfg->ht_cap.mcs, 0,
......
...@@ -536,13 +536,16 @@ void ...@@ -536,13 +536,16 @@ void
mwifiex_set_sta_ht_cap(struct mwifiex_private *priv, const u8 *ies, mwifiex_set_sta_ht_cap(struct mwifiex_private *priv, const u8 *ies,
int ies_len, struct mwifiex_sta_node *node) int ies_len, struct mwifiex_sta_node *node)
{ {
struct ieee_types_header *ht_cap_ie;
const struct ieee80211_ht_cap *ht_cap; const struct ieee80211_ht_cap *ht_cap;
if (!ies) if (!ies)
return; return;
ht_cap = (void *)cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, ies, ies_len); ht_cap_ie = (void *)cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, ies,
if (ht_cap) { ies_len);
if (ht_cap_ie) {
ht_cap = (void *)(ht_cap_ie + 1);
node->is_11n_enabled = 1; node->is_11n_enabled = 1;
node->max_amsdu = le16_to_cpu(ht_cap->cap_info) & node->max_amsdu = le16_to_cpu(ht_cap->cap_info) &
IEEE80211_HT_CAP_MAX_AMSDU ? IEEE80211_HT_CAP_MAX_AMSDU ?
......
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