Commit 3b148be0 authored by Sean MacLennan's avatar Sean MacLennan Committed by Greg Kroah-Hartman

staging/rtl8192e: Register against lib80211

Convert rtllib from registering the crypt drivers against rtllib_crypt
and instead register the against lib80211. The crypto functions have
R- prepended (R-CCMP, R-TKIP, R-WEP) so they will not clash with the
lib80211 versions.

We cannot use the lib80211 crypt drivers since the rtl8192e has some
hardware support that is not handled by the lib80211 crypt drivers.
Signed-off-by: default avatarSean MacLennan <seanm@seanm.ca>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 0ddcf5fd
...@@ -2,7 +2,7 @@ config RTLLIB ...@@ -2,7 +2,7 @@ config RTLLIB
tristate "Support for rtllib wireless devices" tristate "Support for rtllib wireless devices"
depends on WLAN && m depends on WLAN && m
default n default n
select RTLLIB_CRYPTO select LIB80211
---help--- ---help---
If you have a wireless card that uses rtllib, say If you have a wireless card that uses rtllib, say
Y. Currently the only card is the rtl8192e. Y. Currently the only card is the rtl8192e.
...@@ -11,14 +11,9 @@ config RTLLIB ...@@ -11,14 +11,9 @@ config RTLLIB
if RTLLIB if RTLLIB
config RTLLIB_CRYPTO
tristate "Support for rtllib crypto support"
---help---
Base crypto driver for rtllib.
config RTLLIB_CRYPTO_CCMP config RTLLIB_CRYPTO_CCMP
tristate "Support for rtllib CCMP crypto" tristate "Support for rtllib CCMP crypto"
depends on RTLLIB_CRYPTO depends on RTLLIB
default y default y
---help--- ---help---
CCMP crypto driver for rtllib. CCMP crypto driver for rtllib.
...@@ -27,7 +22,7 @@ config RTLLIB_CRYPTO_CCMP ...@@ -27,7 +22,7 @@ config RTLLIB_CRYPTO_CCMP
config RTLLIB_CRYPTO_TKIP config RTLLIB_CRYPTO_TKIP
tristate "Support for rtllib TKIP crypto" tristate "Support for rtllib TKIP crypto"
depends on RTLLIB_CRYPTO depends on RTLLIB
default y default y
---help--- ---help---
TKIP crypto driver for rtllib. TKIP crypto driver for rtllib.
...@@ -36,7 +31,7 @@ config RTLLIB_CRYPTO_TKIP ...@@ -36,7 +31,7 @@ config RTLLIB_CRYPTO_TKIP
config RTLLIB_CRYPTO_WEP config RTLLIB_CRYPTO_WEP
tristate "Support for rtllib WEP crypto" tristate "Support for rtllib WEP crypto"
depends on RTLLIB_CRYPTO depends on RTLLIB
default y default y
---help--- ---help---
TKIP crypto driver for rtllib. TKIP crypto driver for rtllib.
......
...@@ -12,7 +12,6 @@ rtllib-objs := \ ...@@ -12,7 +12,6 @@ rtllib-objs := \
obj-$(CONFIG_RTLLIB) += rtllib.o obj-$(CONFIG_RTLLIB) += rtllib.o
obj-$(CONFIG_RTLLIB_CRYPTO) += rtllib_crypt.o
obj-$(CONFIG_RTLLIB_CRYPTO_CCMP) += rtllib_crypt_ccmp.o obj-$(CONFIG_RTLLIB_CRYPTO_CCMP) += rtllib_crypt_ccmp.o
obj-$(CONFIG_RTLLIB_CRYPTO_TKIP) += rtllib_crypt_tkip.o obj-$(CONFIG_RTLLIB_CRYPTO_TKIP) += rtllib_crypt_tkip.o
obj-$(CONFIG_RTLLIB_CRYPTO_WEP) += rtllib_crypt_wep.o obj-$(CONFIG_RTLLIB_CRYPTO_WEP) += rtllib_crypt_wep.o
......
...@@ -1060,8 +1060,6 @@ struct rtllib_stats { ...@@ -1060,8 +1060,6 @@ struct rtllib_stats {
struct rtllib_device; struct rtllib_device;
#include "rtllib_crypt.h"
#define SEC_KEY_1 (1<<0) #define SEC_KEY_1 (1<<0)
#define SEC_KEY_2 (1<<1) #define SEC_KEY_2 (1<<1)
#define SEC_KEY_3 (1<<2) #define SEC_KEY_3 (1<<2)
...@@ -2985,21 +2983,6 @@ static inline const char *escape_essid(const char *essid, u8 essid_len) ...@@ -2985,21 +2983,6 @@ static inline const char *escape_essid(const char *essid, u8 essid_len)
(HTMcsToDataRate(_ieee, (u8)_MGN_RATE))) (HTMcsToDataRate(_ieee, (u8)_MGN_RATE)))
/* fun with the built-in rtllib stack... */ /* fun with the built-in rtllib stack... */
int rtllib_init(void);
void rtllib_exit(void);
int rtllib_crypto_init(void);
void rtllib_crypto_deinit(void);
int rtllib_crypto_tkip_init(void);
void rtllib_crypto_tkip_exit(void);
int rtllib_crypto_ccmp_init(void);
void rtllib_crypto_ccmp_exit(void);
int rtllib_crypto_wep_init(void);
void rtllib_crypto_wep_exit(void);
void rtllib_MgntDisconnectIBSS(struct rtllib_device *rtllib);
void rtllib_MlmeDisassociateRequest(struct rtllib_device *rtllib, u8 *asSta,
u8 asRsn);
void rtllib_MgntDisconnectAP(struct rtllib_device *rtllib, u8 asRsn);
bool rtllib_MgntDisconnect(struct rtllib_device *rtllib, u8 asRsn); bool rtllib_MgntDisconnect(struct rtllib_device *rtllib, u8 asRsn);
...@@ -3066,12 +3049,5 @@ extern void rtllib_TURBO_Info(struct rtllib_device *ieee, u8 **tag_p); ...@@ -3066,12 +3049,5 @@ extern void rtllib_TURBO_Info(struct rtllib_device *ieee, u8 **tag_p);
#define MUTEX_LOCK_PRIV(pmutex) mutex_lock(pmutex) #define MUTEX_LOCK_PRIV(pmutex) mutex_lock(pmutex)
#define MUTEX_UNLOCK_PRIV(pmutex) mutex_unlock(pmutex) #define MUTEX_UNLOCK_PRIV(pmutex) mutex_unlock(pmutex)
#endif #endif
static inline void dump_buf(u8 *buf, u32 len)
{
u32 i;
printk(KERN_INFO "-----------------Len %d----------------\n", len);
for (i = 0; i < len; i++)
printk("%2.2x-", *(buf+i));
printk("\n");
}
#endif /* RTLLIB_H */ #endif /* RTLLIB_H */
...@@ -215,7 +215,7 @@ int __init rtllib_crypto_init(void) ...@@ -215,7 +215,7 @@ int __init rtllib_crypto_init(void)
INIT_LIST_HEAD(&hcrypt->algs); INIT_LIST_HEAD(&hcrypt->algs);
spin_lock_init(&hcrypt->lock); spin_lock_init(&hcrypt->lock);
ret = rtllib_register_crypto_ops(&rtllib_crypt_null); ret = lib80211_register_crypto_ops(&rtllib_crypt_null);
if (ret < 0) { if (ret < 0) {
kfree(hcrypt); kfree(hcrypt);
hcrypt = NULL; hcrypt = NULL;
......
...@@ -428,7 +428,7 @@ static char *rtllib_ccmp_print_stats(char *p, void *priv) ...@@ -428,7 +428,7 @@ static char *rtllib_ccmp_print_stats(char *p, void *priv)
} }
static struct lib80211_crypto_ops rtllib_crypt_ccmp = { static struct lib80211_crypto_ops rtllib_crypt_ccmp = {
.name = "CCMP", .name = "R-CCMP",
.init = rtllib_ccmp_init, .init = rtllib_ccmp_init,
.deinit = rtllib_ccmp_deinit, .deinit = rtllib_ccmp_deinit,
.encrypt_mpdu = rtllib_ccmp_encrypt, .encrypt_mpdu = rtllib_ccmp_encrypt,
...@@ -446,13 +446,13 @@ static struct lib80211_crypto_ops rtllib_crypt_ccmp = { ...@@ -446,13 +446,13 @@ static struct lib80211_crypto_ops rtllib_crypt_ccmp = {
int __init rtllib_crypto_ccmp_init(void) int __init rtllib_crypto_ccmp_init(void)
{ {
return rtllib_register_crypto_ops(&rtllib_crypt_ccmp); return lib80211_register_crypto_ops(&rtllib_crypt_ccmp);
} }
void __exit rtllib_crypto_ccmp_exit(void) void __exit rtllib_crypto_ccmp_exit(void)
{ {
rtllib_unregister_crypto_ops(&rtllib_crypt_ccmp); lib80211_unregister_crypto_ops(&rtllib_crypt_ccmp);
} }
module_init(rtllib_crypto_ccmp_init); module_init(rtllib_crypto_ccmp_init);
......
...@@ -735,7 +735,7 @@ static char *rtllib_tkip_print_stats(char *p, void *priv) ...@@ -735,7 +735,7 @@ static char *rtllib_tkip_print_stats(char *p, void *priv)
} }
static struct lib80211_crypto_ops rtllib_crypt_tkip = { static struct lib80211_crypto_ops rtllib_crypt_tkip = {
.name = "TKIP", .name = "R-TKIP",
.init = rtllib_tkip_init, .init = rtllib_tkip_init,
.deinit = rtllib_tkip_deinit, .deinit = rtllib_tkip_deinit,
.encrypt_mpdu = rtllib_tkip_encrypt, .encrypt_mpdu = rtllib_tkip_encrypt,
...@@ -754,13 +754,13 @@ static struct lib80211_crypto_ops rtllib_crypt_tkip = { ...@@ -754,13 +754,13 @@ static struct lib80211_crypto_ops rtllib_crypt_tkip = {
int __init rtllib_crypto_tkip_init(void) int __init rtllib_crypto_tkip_init(void)
{ {
return rtllib_register_crypto_ops(&rtllib_crypt_tkip); return lib80211_register_crypto_ops(&rtllib_crypt_tkip);
} }
void __exit rtllib_crypto_tkip_exit(void) void __exit rtllib_crypto_tkip_exit(void)
{ {
rtllib_unregister_crypto_ops(&rtllib_crypt_tkip); lib80211_unregister_crypto_ops(&rtllib_crypt_tkip);
} }
module_init(rtllib_crypto_tkip_init); module_init(rtllib_crypto_tkip_init);
......
...@@ -256,7 +256,7 @@ static char *prism2_wep_print_stats(char *p, void *priv) ...@@ -256,7 +256,7 @@ static char *prism2_wep_print_stats(char *p, void *priv)
} }
static struct lib80211_crypto_ops rtllib_crypt_wep = { static struct lib80211_crypto_ops rtllib_crypt_wep = {
.name = "WEP", .name = "R-WEP",
.init = prism2_wep_init, .init = prism2_wep_init,
.deinit = prism2_wep_deinit, .deinit = prism2_wep_deinit,
.encrypt_mpdu = prism2_wep_encrypt, .encrypt_mpdu = prism2_wep_encrypt,
...@@ -274,13 +274,13 @@ static struct lib80211_crypto_ops rtllib_crypt_wep = { ...@@ -274,13 +274,13 @@ static struct lib80211_crypto_ops rtllib_crypt_wep = {
int __init rtllib_crypto_wep_init(void) int __init rtllib_crypto_wep_init(void)
{ {
return rtllib_register_crypto_ops(&rtllib_crypt_wep); return lib80211_register_crypto_ops(&rtllib_crypt_wep);
} }
void __exit rtllib_crypto_wep_exit(void) void __exit rtllib_crypto_wep_exit(void)
{ {
rtllib_unregister_crypto_ops(&rtllib_crypt_wep); lib80211_unregister_crypto_ops(&rtllib_crypt_wep);
} }
module_init(rtllib_crypto_wep_init); module_init(rtllib_crypto_wep_init);
......
...@@ -136,11 +136,6 @@ struct net_device *alloc_rtllib(int sizeof_priv) ...@@ -136,11 +136,6 @@ struct net_device *alloc_rtllib(int sizeof_priv)
ieee->host_decrypt = 1; ieee->host_decrypt = 1;
ieee->ieee802_1x = 1; /* Default to supporting 802.1x */ ieee->ieee802_1x = 1; /* Default to supporting 802.1x */
/* SAM Init here */
INIT_LIST_HEAD(&ieee->crypt_info.crypt_deinit_list);
_setup_timer(&ieee->crypt_info.crypt_deinit_timer,
rtllib_crypt_deinit_handler,
(unsigned long)&ieee->crypt_info);
ieee->rtllib_ap_sec_type = rtllib_ap_sec_type; ieee->rtllib_ap_sec_type = rtllib_ap_sec_type;
spin_lock_init(&ieee->lock); spin_lock_init(&ieee->lock);
...@@ -150,6 +145,9 @@ struct net_device *alloc_rtllib(int sizeof_priv) ...@@ -150,6 +145,9 @@ struct net_device *alloc_rtllib(int sizeof_priv)
atomic_set(&(ieee->atm_chnlop), 0); atomic_set(&(ieee->atm_chnlop), 0);
atomic_set(&(ieee->atm_swbw), 0); atomic_set(&(ieee->atm_swbw), 0);
/* SAM FIXME */
lib80211_crypt_info_init(&ieee->crypt_info, "RTLLIB", &ieee->lock);
ieee->bHalfNMode = false; ieee->bHalfNMode = false;
ieee->wpa_enabled = 0; ieee->wpa_enabled = 0;
ieee->tkip_countermeasures = 0; ieee->tkip_countermeasures = 0;
...@@ -192,25 +190,12 @@ void free_rtllib(struct net_device *dev) ...@@ -192,25 +190,12 @@ void free_rtllib(struct net_device *dev)
{ {
struct rtllib_device *ieee = (struct rtllib_device *) struct rtllib_device *ieee = (struct rtllib_device *)
netdev_priv_rsl(dev); netdev_priv_rsl(dev);
int i;
kfree(ieee->pHTInfo); kfree(ieee->pHTInfo);
ieee->pHTInfo = NULL; ieee->pHTInfo = NULL;
rtllib_softmac_free(ieee); rtllib_softmac_free(ieee);
/* SAM cleanup */ lib80211_crypt_info_free(&ieee->crypt_info);
del_timer_sync(&ieee->crypt_info.crypt_deinit_timer);
rtllib_crypt_deinit_entries(&ieee->crypt_info, 1);
for (i = 0; i < NUM_WEP_KEYS; i++) {
struct lib80211_crypt_data *crypt = ieee->crypt_info.crypt[i];
if (crypt) {
if (crypt->ops)
crypt->ops->deinit(crypt->priv);
kfree(crypt);
ieee->crypt_info.crypt[i] = NULL;
}
}
rtllib_networks_free(ieee); rtllib_networks_free(ieee);
free_netdev(dev); free_netdev(dev);
......
...@@ -873,7 +873,7 @@ static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee, u8 *dest) ...@@ -873,7 +873,7 @@ static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee, u8 *dest)
crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx];
encrypt = ieee->host_encrypt && crypt && crypt->ops && encrypt = ieee->host_encrypt && crypt && crypt->ops &&
((0 == strcmp(crypt->ops->name, "WEP") || wpa_ie_len)); ((0 == strcmp(crypt->ops->name, "R-WEP") || wpa_ie_len));
if (ieee->pHTInfo->bCurrentHTSupport) { if (ieee->pHTInfo->bCurrentHTSupport) {
tmp_ht_cap_buf = (u8 *) &(ieee->pHTInfo->SelfHTCap); tmp_ht_cap_buf = (u8 *) &(ieee->pHTInfo->SelfHTCap);
tmp_ht_cap_len = sizeof(ieee->pHTInfo->SelfHTCap); tmp_ht_cap_len = sizeof(ieee->pHTInfo->SelfHTCap);
...@@ -1194,7 +1194,7 @@ inline struct sk_buff *rtllib_association_req(struct rtllib_network *beacon, ...@@ -1194,7 +1194,7 @@ inline struct sk_buff *rtllib_association_req(struct rtllib_network *beacon,
crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx];
if (crypt != NULL) if (crypt != NULL)
encrypt = ieee->host_encrypt && crypt && crypt->ops && encrypt = ieee->host_encrypt && crypt && crypt->ops &&
((0 == strcmp(crypt->ops->name, "WEP") || ((0 == strcmp(crypt->ops->name, "R-WEP") ||
wpa_ie_len)); wpa_ie_len));
else else
encrypt = 0; encrypt = 0;
...@@ -3377,7 +3377,7 @@ static int rtllib_wpa_set_encryption(struct rtllib_device *ieee, ...@@ -3377,7 +3377,7 @@ static int rtllib_wpa_set_encryption(struct rtllib_device *ieee,
sec.enabled = 0; sec.enabled = 0;
sec.level = SEC_LEVEL_0; sec.level = SEC_LEVEL_0;
sec.flags |= SEC_ENABLED | SEC_LEVEL; sec.flags |= SEC_ENABLED | SEC_LEVEL;
rtllib_crypt_delayed_deinit(&ieee->crypt_info, crypt); lib80211_crypt_delayed_deinit(&ieee->crypt_info, crypt);
} }
goto done; goto done;
} }
...@@ -3386,19 +3386,19 @@ static int rtllib_wpa_set_encryption(struct rtllib_device *ieee, ...@@ -3386,19 +3386,19 @@ static int rtllib_wpa_set_encryption(struct rtllib_device *ieee,
/* IPW HW cannot build TKIP MIC, host decryption still needed. */ /* IPW HW cannot build TKIP MIC, host decryption still needed. */
if (!(ieee->host_encrypt || ieee->host_decrypt) && if (!(ieee->host_encrypt || ieee->host_decrypt) &&
strcmp(param->u.crypt.alg, "TKIP")) strcmp(param->u.crypt.alg, "R-TKIP"))
goto skip_host_crypt; goto skip_host_crypt;
ops = rtllib_get_crypto_ops(param->u.crypt.alg); ops = lib80211_get_crypto_ops(param->u.crypt.alg);
if (ops == NULL && strcmp(param->u.crypt.alg, "WEP") == 0) { if (ops == NULL && strcmp(param->u.crypt.alg, "R-WEP") == 0) {
request_module("rtllib_crypt_wep"); request_module("rtllib_crypt_wep");
ops = rtllib_get_crypto_ops(param->u.crypt.alg); ops = lib80211_get_crypto_ops(param->u.crypt.alg);
} else if (ops == NULL && strcmp(param->u.crypt.alg, "TKIP") == 0) { } else if (ops == NULL && strcmp(param->u.crypt.alg, "R-TKIP") == 0) {
request_module("rtllib_crypt_tkip"); request_module("rtllib_crypt_tkip");
ops = rtllib_get_crypto_ops(param->u.crypt.alg); ops = lib80211_get_crypto_ops(param->u.crypt.alg);
} else if (ops == NULL && strcmp(param->u.crypt.alg, "CCMP") == 0) { } else if (ops == NULL && strcmp(param->u.crypt.alg, "R-CCMP") == 0) {
request_module("rtllib_crypt_ccmp"); request_module("rtllib_crypt_ccmp");
ops = rtllib_get_crypto_ops(param->u.crypt.alg); ops = lib80211_get_crypto_ops(param->u.crypt.alg);
} }
if (ops == NULL) { if (ops == NULL) {
printk(KERN_INFO "unknown crypto alg '%s'\n", printk(KERN_INFO "unknown crypto alg '%s'\n",
...@@ -3410,7 +3410,7 @@ static int rtllib_wpa_set_encryption(struct rtllib_device *ieee, ...@@ -3410,7 +3410,7 @@ static int rtllib_wpa_set_encryption(struct rtllib_device *ieee,
if (*crypt == NULL || (*crypt)->ops != ops) { if (*crypt == NULL || (*crypt)->ops != ops) {
struct lib80211_crypt_data *new_crypt; struct lib80211_crypt_data *new_crypt;
rtllib_crypt_delayed_deinit(&ieee->crypt_info, crypt); lib80211_crypt_delayed_deinit(&ieee->crypt_info, crypt);
new_crypt = (struct lib80211_crypt_data *) new_crypt = (struct lib80211_crypt_data *)
kmalloc(sizeof(*new_crypt), GFP_KERNEL); kmalloc(sizeof(*new_crypt), GFP_KERNEL);
...@@ -3459,13 +3459,13 @@ static int rtllib_wpa_set_encryption(struct rtllib_device *ieee, ...@@ -3459,13 +3459,13 @@ static int rtllib_wpa_set_encryption(struct rtllib_device *ieee,
sec.key_sizes[param->u.crypt.idx] = param->u.crypt.key_len; sec.key_sizes[param->u.crypt.idx] = param->u.crypt.key_len;
sec.flags |= (1 << param->u.crypt.idx); sec.flags |= (1 << param->u.crypt.idx);
if (strcmp(param->u.crypt.alg, "WEP") == 0) { if (strcmp(param->u.crypt.alg, "R-WEP") == 0) {
sec.flags |= SEC_LEVEL; sec.flags |= SEC_LEVEL;
sec.level = SEC_LEVEL_1; sec.level = SEC_LEVEL_1;
} else if (strcmp(param->u.crypt.alg, "TKIP") == 0) { } else if (strcmp(param->u.crypt.alg, "R-TKIP") == 0) {
sec.flags |= SEC_LEVEL; sec.flags |= SEC_LEVEL;
sec.level = SEC_LEVEL_2; sec.level = SEC_LEVEL_2;
} else if (strcmp(param->u.crypt.alg, "CCMP") == 0) { } else if (strcmp(param->u.crypt.alg, "R-CCMP") == 0) {
sec.flags |= SEC_LEVEL; sec.flags |= SEC_LEVEL;
sec.level = SEC_LEVEL_3; sec.level = SEC_LEVEL_3;
} }
...@@ -3568,7 +3568,7 @@ u8 rtllib_ap_sec_type(struct rtllib_device *ieee) ...@@ -3568,7 +3568,7 @@ u8 rtllib_ap_sec_type(struct rtllib_device *ieee)
crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx];
encrypt = (ieee->current_network.capability & WLAN_CAPABILITY_PRIVACY) encrypt = (ieee->current_network.capability & WLAN_CAPABILITY_PRIVACY)
|| (ieee->host_encrypt && crypt && crypt->ops && || (ieee->host_encrypt && crypt && crypt->ops &&
(0 == strcmp(crypt->ops->name, "WEP"))); (0 == strcmp(crypt->ops->name, "R-WEP")));
/* simply judge */ /* simply judge */
if (encrypt && (wpa_ie_len == 0)) { if (encrypt && (wpa_ie_len == 0)) {
......
...@@ -328,7 +328,7 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee, ...@@ -328,7 +328,7 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee,
if (key_provided && *crypt) { if (key_provided && *crypt) {
RTLLIB_DEBUG_WX("Disabling encryption on key %d.\n", RTLLIB_DEBUG_WX("Disabling encryption on key %d.\n",
key); key);
rtllib_crypt_delayed_deinit(&ieee->crypt_info, crypt); lib80211_crypt_delayed_deinit(&ieee->crypt_info, crypt);
} else } else
RTLLIB_DEBUG_WX("Disabling encryption.\n"); RTLLIB_DEBUG_WX("Disabling encryption.\n");
...@@ -338,7 +338,7 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee, ...@@ -338,7 +338,7 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee,
if (ieee->crypt_info.crypt[i] != NULL) { if (ieee->crypt_info.crypt[i] != NULL) {
if (key_provided) if (key_provided)
break; break;
rtllib_crypt_delayed_deinit(&ieee->crypt_info, lib80211_crypt_delayed_deinit(&ieee->crypt_info,
&ieee->crypt_info.crypt[i]); &ieee->crypt_info.crypt[i]);
} }
} }
...@@ -358,10 +358,10 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee, ...@@ -358,10 +358,10 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee,
sec.flags |= SEC_ENABLED; sec.flags |= SEC_ENABLED;
if (*crypt != NULL && (*crypt)->ops != NULL && if (*crypt != NULL && (*crypt)->ops != NULL &&
strcmp((*crypt)->ops->name, "WEP") != 0) { strcmp((*crypt)->ops->name, "R-WEP") != 0) {
/* changing to use WEP; deinit previously used algorithm /* changing to use WEP; deinit previously used algorithm
* on this key */ * on this key */
rtllib_crypt_delayed_deinit(&ieee->crypt_info, crypt); lib80211_crypt_delayed_deinit(&ieee->crypt_info, crypt);
} }
if (*crypt == NULL) { if (*crypt == NULL) {
...@@ -372,10 +372,10 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee, ...@@ -372,10 +372,10 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee,
GFP_KERNEL); GFP_KERNEL);
if (new_crypt == NULL) if (new_crypt == NULL)
return -ENOMEM; return -ENOMEM;
new_crypt->ops = rtllib_get_crypto_ops("WEP"); new_crypt->ops = lib80211_get_crypto_ops("R-WEP");
if (!new_crypt->ops) { if (!new_crypt->ops) {
request_module("rtllib_crypt_wep"); request_module("rtllib_crypt_wep");
new_crypt->ops = rtllib_get_crypto_ops("WEP"); new_crypt->ops = lib80211_get_crypto_ops("R-WEP");
} }
if (new_crypt->ops) if (new_crypt->ops)
...@@ -557,7 +557,7 @@ int rtllib_wx_set_encode_ext(struct rtllib_device *ieee, ...@@ -557,7 +557,7 @@ int rtllib_wx_set_encode_ext(struct rtllib_device *ieee,
if ((encoding->flags & IW_ENCODE_DISABLED) || if ((encoding->flags & IW_ENCODE_DISABLED) ||
ext->alg == IW_ENCODE_ALG_NONE) { ext->alg == IW_ENCODE_ALG_NONE) {
if (*crypt) if (*crypt)
rtllib_crypt_delayed_deinit(&ieee->crypt_info, crypt); lib80211_crypt_delayed_deinit(&ieee->crypt_info, crypt);
for (i = 0; i < NUM_WEP_KEYS; i++) { for (i = 0; i < NUM_WEP_KEYS; i++) {
if (ieee->crypt_info.crypt[i] != NULL) if (ieee->crypt_info.crypt[i] != NULL)
...@@ -574,15 +574,15 @@ int rtllib_wx_set_encode_ext(struct rtllib_device *ieee, ...@@ -574,15 +574,15 @@ int rtllib_wx_set_encode_ext(struct rtllib_device *ieee,
sec.enabled = 1; sec.enabled = 1;
switch (ext->alg) { switch (ext->alg) {
case IW_ENCODE_ALG_WEP: case IW_ENCODE_ALG_WEP:
alg = "WEP"; alg = "R-WEP";
module = "rtllib_crypt_wep"; module = "rtllib_crypt_wep";
break; break;
case IW_ENCODE_ALG_TKIP: case IW_ENCODE_ALG_TKIP:
alg = "TKIP"; alg = "R-TKIP";
module = "rtllib_crypt_tkip"; module = "rtllib_crypt_tkip";
break; break;
case IW_ENCODE_ALG_CCMP: case IW_ENCODE_ALG_CCMP:
alg = "CCMP"; alg = "R-CCMP";
module = "rtllib_crypt_ccmp"; module = "rtllib_crypt_ccmp";
break; break;
default: default:
...@@ -593,14 +593,14 @@ int rtllib_wx_set_encode_ext(struct rtllib_device *ieee, ...@@ -593,14 +593,14 @@ int rtllib_wx_set_encode_ext(struct rtllib_device *ieee,
} }
printk(KERN_INFO "alg name:%s\n", alg); printk(KERN_INFO "alg name:%s\n", alg);
ops = rtllib_get_crypto_ops(alg); ops = lib80211_get_crypto_ops(alg);
if (ops == NULL) { if (ops == NULL) {
char tempbuf[100]; char tempbuf[100];
memset(tempbuf, 0x00, 100); memset(tempbuf, 0x00, 100);
sprintf(tempbuf, "%s", module); sprintf(tempbuf, "%s", module);
request_module("%s", tempbuf); request_module("%s", tempbuf);
ops = rtllib_get_crypto_ops(alg); ops = lib80211_get_crypto_ops(alg);
} }
if (ops == NULL) { if (ops == NULL) {
RTLLIB_DEBUG_WX("%s: unknown crypto alg %d\n", RTLLIB_DEBUG_WX("%s: unknown crypto alg %d\n",
...@@ -613,7 +613,7 @@ int rtllib_wx_set_encode_ext(struct rtllib_device *ieee, ...@@ -613,7 +613,7 @@ int rtllib_wx_set_encode_ext(struct rtllib_device *ieee,
if (*crypt == NULL || (*crypt)->ops != ops) { if (*crypt == NULL || (*crypt)->ops != ops) {
struct lib80211_crypt_data *new_crypt; struct lib80211_crypt_data *new_crypt;
rtllib_crypt_delayed_deinit(&ieee->crypt_info, crypt); lib80211_crypt_delayed_deinit(&ieee->crypt_info, crypt);
new_crypt = kzalloc(sizeof(*new_crypt), GFP_KERNEL); new_crypt = kzalloc(sizeof(*new_crypt), GFP_KERNEL);
if (new_crypt == NULL) { if (new_crypt == NULL) {
...@@ -713,11 +713,11 @@ int rtllib_wx_get_encode_ext(struct rtllib_device *ieee, ...@@ -713,11 +713,11 @@ int rtllib_wx_get_encode_ext(struct rtllib_device *ieee,
ext->key_len = 0; ext->key_len = 0;
encoding->flags |= IW_ENCODE_DISABLED; encoding->flags |= IW_ENCODE_DISABLED;
} else { } else {
if (strcmp(crypt->ops->name, "WEP") == 0) if (strcmp(crypt->ops->name, "R-WEP") == 0)
ext->alg = IW_ENCODE_ALG_WEP; ext->alg = IW_ENCODE_ALG_WEP;
else if (strcmp(crypt->ops->name, "TKIP")) else if (strcmp(crypt->ops->name, "R-TKIP"))
ext->alg = IW_ENCODE_ALG_TKIP; ext->alg = IW_ENCODE_ALG_TKIP;
else if (strcmp(crypt->ops->name, "CCMP")) else if (strcmp(crypt->ops->name, "R-CCMP"))
ext->alg = IW_ENCODE_ALG_CCMP; ext->alg = IW_ENCODE_ALG_CCMP;
else else
return -EINVAL; return -EINVAL;
......
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