diff options
Diffstat (limited to 'drivers/net/wireless/mwifiex/join.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/join.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c index 88664ae667ba..893d809ba83c 100644 --- a/drivers/net/wireless/mwifiex/join.c +++ b/drivers/net/wireless/mwifiex/join.c | |||
@@ -615,23 +615,33 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv, | |||
615 | struct ieee_types_assoc_rsp *assoc_rsp; | 615 | struct ieee_types_assoc_rsp *assoc_rsp; |
616 | struct mwifiex_bssdescriptor *bss_desc; | 616 | struct mwifiex_bssdescriptor *bss_desc; |
617 | u8 enable_data = true; | 617 | u8 enable_data = true; |
618 | u16 cap_info, status_code; | ||
618 | 619 | ||
619 | assoc_rsp = (struct ieee_types_assoc_rsp *) &resp->params; | 620 | assoc_rsp = (struct ieee_types_assoc_rsp *) &resp->params; |
620 | 621 | ||
622 | cap_info = le16_to_cpu(assoc_rsp->cap_info_bitmap); | ||
623 | status_code = le16_to_cpu(assoc_rsp->status_code); | ||
624 | |||
621 | priv->assoc_rsp_size = min(le16_to_cpu(resp->size) - S_DS_GEN, | 625 | priv->assoc_rsp_size = min(le16_to_cpu(resp->size) - S_DS_GEN, |
622 | sizeof(priv->assoc_rsp_buf)); | 626 | sizeof(priv->assoc_rsp_buf)); |
623 | 627 | ||
624 | memcpy(priv->assoc_rsp_buf, &resp->params, priv->assoc_rsp_size); | 628 | memcpy(priv->assoc_rsp_buf, &resp->params, priv->assoc_rsp_size); |
625 | 629 | ||
626 | if (le16_to_cpu(assoc_rsp->status_code)) { | 630 | if (status_code) { |
627 | priv->adapter->dbg.num_cmd_assoc_failure++; | 631 | priv->adapter->dbg.num_cmd_assoc_failure++; |
628 | dev_err(priv->adapter->dev, | 632 | dev_err(priv->adapter->dev, |
629 | "ASSOC_RESP: failed, status code=%d err=%#x a_id=%#x\n", | 633 | "ASSOC_RESP: failed, status code=%d err=%#x a_id=%#x\n", |
630 | le16_to_cpu(assoc_rsp->status_code), | 634 | status_code, cap_info, le16_to_cpu(assoc_rsp->a_id)); |
631 | le16_to_cpu(assoc_rsp->cap_info_bitmap), | 635 | |
632 | le16_to_cpu(assoc_rsp->a_id)); | 636 | if (cap_info == MWIFIEX_TIMEOUT_FOR_AP_RESP) { |
637 | if (status_code == MWIFIEX_STATUS_CODE_AUTH_TIMEOUT) | ||
638 | ret = WLAN_STATUS_AUTH_TIMEOUT; | ||
639 | else | ||
640 | ret = WLAN_STATUS_UNSPECIFIED_FAILURE; | ||
641 | } else { | ||
642 | ret = status_code; | ||
643 | } | ||
633 | 644 | ||
634 | ret = le16_to_cpu(assoc_rsp->status_code); | ||
635 | goto done; | 645 | goto done; |
636 | } | 646 | } |
637 | 647 | ||
@@ -969,6 +979,16 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv, | |||
969 | priv->adapter->config_bands); | 979 | priv->adapter->config_bands); |
970 | mwifiex_fill_cap_info(priv, radio_type, ht_cap); | 980 | mwifiex_fill_cap_info(priv, radio_type, ht_cap); |
971 | 981 | ||
982 | if (adapter->sec_chan_offset == | ||
983 | IEEE80211_HT_PARAM_CHA_SEC_NONE) { | ||
984 | u16 tmp_ht_cap; | ||
985 | |||
986 | tmp_ht_cap = le16_to_cpu(ht_cap->ht_cap.cap_info); | ||
987 | tmp_ht_cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; | ||
988 | tmp_ht_cap &= ~IEEE80211_HT_CAP_SGI_40; | ||
989 | ht_cap->ht_cap.cap_info = cpu_to_le16(tmp_ht_cap); | ||
990 | } | ||
991 | |||
972 | pos += sizeof(struct mwifiex_ie_types_htcap); | 992 | pos += sizeof(struct mwifiex_ie_types_htcap); |
973 | cmd_append_size += sizeof(struct mwifiex_ie_types_htcap); | 993 | cmd_append_size += sizeof(struct mwifiex_ie_types_htcap); |
974 | 994 | ||