From: Jes Sorensen Date: Tue, 24 Jun 2014 13:03:39 +0000 (+0200) Subject: staging: rtl8723au: rtw_cfg80211_ap_set_encryption(): Use keyparms->cipher to set... X-Git-Tag: v3.17-rc1~123^2~1580 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=55db5d02f81bd45c3a47f4ab4a917a70c6e13916;p=karo-tx-linux.git staging: rtl8723au: rtw_cfg80211_ap_set_encryption(): Use keyparms->cipher to set WEP size We already know which type of WEP we are using when we get here, no point trying to determine it from key_len. Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index ac13df1dc786..c0b0cb19c617 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -577,13 +577,8 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled; - psecuritypriv->dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_WEP40; - psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP40; - - if (key_len == 13) { - psecuritypriv->dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_WEP104; - psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP104; - } + psecuritypriv->dot11PrivacyAlgrthm = keyparms->cipher; + psecuritypriv->dot118021XGrpPrivacy = keyparms->cipher; psecuritypriv->dot11PrivacyKeyIndex = wep_key_idx; } @@ -596,7 +591,6 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, set_wep_key(padapter, keyparms->key, key_len, wep_key_idx); goto exit; - } if (!psta) { /* group key */ @@ -610,12 +604,8 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, skey, keyparms->key, (key_len > 16 ? 16 : key_len)); - psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP40; - if (key_len == 13) { - psecuritypriv->dot118021XGrpPrivacy = - WLAN_CIPHER_SUITE_WEP104; - } - + psecuritypriv->dot118021XGrpPrivacy = + keyparms->cipher; } else if (keyparms->cipher == WLAN_CIPHER_SUITE_TKIP) { DBG_8723A("%s, set group_key, TKIP\n", __func__); @@ -698,12 +688,8 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, DBG_8723A("%s, set pairwise key, WEP\n", __func__); - psta->dot118021XPrivacy = - WLAN_CIPHER_SUITE_WEP40; - if (key_len == 13) { - psta->dot118021XPrivacy = - WLAN_CIPHER_SUITE_WEP104; - } + psecuritypriv->dot118021XGrpPrivacy = + keyparms->cipher; } else if (keyparms->cipher == WLAN_CIPHER_SUITE_TKIP) { DBG_8723A("%s, set pairwise key, TKIP\n", __func__); @@ -748,11 +734,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, (key_len > 16 ? 16 : key_len)); psecuritypriv->dot118021XGrpPrivacy = - WLAN_CIPHER_SUITE_WEP40; - if (key_len == 13) { - psecuritypriv->dot118021XGrpPrivacy = - WLAN_CIPHER_SUITE_WEP104; - } + keyparms->cipher; } else if (keyparms->cipher == WLAN_CIPHER_SUITE_TKIP) { psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_TKIP;