Commit 554503f8 authored by Zhu Yi's avatar Zhu Yi Committed by John W. Linville

iwmc3200wifi: fix set_wpa_version and set_auth_type order

iwm->umac_profile->sec.flags is set by iwm_set_wpa_version and
checked by iwm_set_auth_type. The patch changes the order to
make the flag used correctly.
Signed-off-by: default avatarZhu Yi <yi.zhu@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 738f0f43
...@@ -484,6 +484,8 @@ static int iwm_set_auth_type(struct iwm_priv *iwm, ...@@ -484,6 +484,8 @@ static int iwm_set_auth_type(struct iwm_priv *iwm,
static int iwm_set_wpa_version(struct iwm_priv *iwm, u32 wpa_version) static int iwm_set_wpa_version(struct iwm_priv *iwm, u32 wpa_version)
{ {
IWM_DBG_WEXT(iwm, DBG, "wpa_version: %d\n", wpa_version);
if (!wpa_version) { if (!wpa_version) {
iwm->umac_profile->sec.flags = UMAC_SEC_FLG_LEGACY_PROFILE; iwm->umac_profile->sec.flags = UMAC_SEC_FLG_LEGACY_PROFILE;
return 0; return 0;
...@@ -508,6 +510,9 @@ static int iwm_set_cipher(struct iwm_priv *iwm, u32 cipher, bool ucast) ...@@ -508,6 +510,9 @@ static int iwm_set_cipher(struct iwm_priv *iwm, u32 cipher, bool ucast)
return 0; return 0;
} }
IWM_DBG_WEXT(iwm, DBG, "%ccast cipher is 0x%x\n", ucast ? 'u' : 'm',
cipher);
switch (cipher) { switch (cipher) {
case IW_AUTH_CIPHER_NONE: case IW_AUTH_CIPHER_NONE:
*profile_cipher = UMAC_CIPHER_TYPE_NONE; *profile_cipher = UMAC_CIPHER_TYPE_NONE;
...@@ -584,11 +589,11 @@ static int iwm_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -584,11 +589,11 @@ static int iwm_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
iwm->umac_profile->bss_num = 0; iwm->umac_profile->bss_num = 0;
} }
ret = iwm_set_auth_type(iwm, sme->auth_type); ret = iwm_set_wpa_version(iwm, sme->crypto.wpa_versions);
if (ret < 0) if (ret < 0)
return ret; return ret;
ret = iwm_set_wpa_version(iwm, sme->crypto.wpa_versions); ret = iwm_set_auth_type(iwm, sme->auth_type);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
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