aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2012-02-09 21:32:22 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-02-15 13:56:15 -0500
commit6670f15b1f6858a43b292d8ab64464e9f085a6aa (patch)
treeba8cb3ade8da94277d134dc3d9c2d4081f9459ee /drivers/net
parent216c57b214bd621335ff698b475f6db2802502dc (diff)
mwifiex: clear previous security setting during association
Driver maintains different flags for WEP, WPA, WPA2 security modes. Appropriate flag is set using security information provided in connect request. mwifiex_is_network_compatible() routine uses them to check if driver's setting is compatible with AP. Association is aborted if the routine fails. For some corner cases, it is observed that association is failed even for valid security information based on association history. This patch fixes the problem by clearing previous security setting during each association. We should set WEP key provided in connect request as default tx key. This missing change is also added here. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index c3b6c4652cd6..5b2972b43b0e 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -841,7 +841,12 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
841 ret = mwifiex_set_rf_channel(priv, channel, 841 ret = mwifiex_set_rf_channel(priv, channel,
842 priv->adapter->channel_type); 842 priv->adapter->channel_type);
843 843
844 ret = mwifiex_set_encode(priv, NULL, 0, 0, 1); /* Disable keys */ 844 /* As this is new association, clear locally stored
845 * keys and security related flags */
846 priv->sec_info.wpa_enabled = false;
847 priv->sec_info.wpa2_enabled = false;
848 priv->wep_key_curr_index = 0;
849 ret = mwifiex_set_encode(priv, NULL, 0, 0, 1);
845 850
846 if (mode == NL80211_IFTYPE_ADHOC) { 851 if (mode == NL80211_IFTYPE_ADHOC) {
847 /* "privacy" is set only for ad-hoc mode */ 852 /* "privacy" is set only for ad-hoc mode */
@@ -886,6 +891,7 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
886 dev_dbg(priv->adapter->dev, 891 dev_dbg(priv->adapter->dev,
887 "info: setting wep encryption" 892 "info: setting wep encryption"
888 " with key len %d\n", sme->key_len); 893 " with key len %d\n", sme->key_len);
894 priv->wep_key_curr_index = sme->key_idx;
889 ret = mwifiex_set_encode(priv, sme->key, sme->key_len, 895 ret = mwifiex_set_encode(priv, sme->key, sme->key_len,
890 sme->key_idx, 0); 896 sme->key_idx, 0);
891 } 897 }