aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/hostap/hostap_ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/hostap/hostap_ioctl.c')
-rw-r--r--drivers/net/wireless/hostap/hostap_ioctl.c77
1 files changed, 40 insertions, 37 deletions
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
index bbed1e63458..f892aa87b13 100644
--- a/drivers/net/wireless/hostap/hostap_ioctl.c
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c
@@ -115,9 +115,9 @@ static int prism2_get_name(struct net_device *dev,
115 115
116 116
117static void prism2_crypt_delayed_deinit(local_info_t *local, 117static void prism2_crypt_delayed_deinit(local_info_t *local,
118 struct prism2_crypt_data **crypt) 118 struct ieee80211_crypt_data **crypt)
119{ 119{
120 struct prism2_crypt_data *tmp; 120 struct ieee80211_crypt_data *tmp;
121 unsigned long flags; 121 unsigned long flags;
122 122
123 tmp = *crypt; 123 tmp = *crypt;
@@ -147,7 +147,7 @@ static int prism2_ioctl_siwencode(struct net_device *dev,
147 struct hostap_interface *iface; 147 struct hostap_interface *iface;
148 local_info_t *local; 148 local_info_t *local;
149 int i; 149 int i;
150 struct prism2_crypt_data **crypt; 150 struct ieee80211_crypt_data **crypt;
151 151
152 iface = netdev_priv(dev); 152 iface = netdev_priv(dev);
153 local = iface->local; 153 local = iface->local;
@@ -175,18 +175,19 @@ static int prism2_ioctl_siwencode(struct net_device *dev,
175 } 175 }
176 176
177 if (*crypt == NULL) { 177 if (*crypt == NULL) {
178 struct prism2_crypt_data *new_crypt; 178 struct ieee80211_crypt_data *new_crypt;
179 179
180 /* take WEP into use */ 180 /* take WEP into use */
181 new_crypt = (struct prism2_crypt_data *) 181 new_crypt = (struct ieee80211_crypt_data *)
182 kmalloc(sizeof(struct prism2_crypt_data), GFP_KERNEL); 182 kmalloc(sizeof(struct ieee80211_crypt_data),
183 GFP_KERNEL);
183 if (new_crypt == NULL) 184 if (new_crypt == NULL)
184 return -ENOMEM; 185 return -ENOMEM;
185 memset(new_crypt, 0, sizeof(struct prism2_crypt_data)); 186 memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data));
186 new_crypt->ops = hostap_get_crypto_ops("WEP"); 187 new_crypt->ops = ieee80211_get_crypto_ops("WEP");
187 if (!new_crypt->ops) { 188 if (!new_crypt->ops) {
188 request_module("hostap_crypt_wep"); 189 request_module("ieee80211_crypt_wep");
189 new_crypt->ops = hostap_get_crypto_ops("WEP"); 190 new_crypt->ops = ieee80211_get_crypto_ops("WEP");
190 } 191 }
191 if (new_crypt->ops) 192 if (new_crypt->ops)
192 new_crypt->priv = new_crypt->ops->init(i); 193 new_crypt->priv = new_crypt->ops->init(i);
@@ -251,7 +252,7 @@ static int prism2_ioctl_giwencode(struct net_device *dev,
251 local_info_t *local; 252 local_info_t *local;
252 int i, len; 253 int i, len;
253 u16 val; 254 u16 val;
254 struct prism2_crypt_data *crypt; 255 struct ieee80211_crypt_data *crypt;
255 256
256 iface = netdev_priv(dev); 257 iface = netdev_priv(dev);
257 local = iface->local; 258 local = iface->local;
@@ -3259,8 +3260,8 @@ static int prism2_ioctl_siwencodeext(struct net_device *dev,
3259 local_info_t *local = iface->local; 3260 local_info_t *local = iface->local;
3260 struct iw_encode_ext *ext = (struct iw_encode_ext *) extra; 3261 struct iw_encode_ext *ext = (struct iw_encode_ext *) extra;
3261 int i, ret = 0; 3262 int i, ret = 0;
3262 struct hostap_crypto_ops *ops; 3263 struct ieee80211_crypto_ops *ops;
3263 struct prism2_crypt_data **crypt; 3264 struct ieee80211_crypt_data **crypt;
3264 void *sta_ptr; 3265 void *sta_ptr;
3265 u8 *addr; 3266 u8 *addr;
3266 const char *alg, *module; 3267 const char *alg, *module;
@@ -3308,15 +3309,15 @@ static int prism2_ioctl_siwencodeext(struct net_device *dev,
3308 switch (ext->alg) { 3309 switch (ext->alg) {
3309 case IW_ENCODE_ALG_WEP: 3310 case IW_ENCODE_ALG_WEP:
3310 alg = "WEP"; 3311 alg = "WEP";
3311 module = "hostap_crypt_wep"; 3312 module = "ieee80211_crypt_wep";
3312 break; 3313 break;
3313 case IW_ENCODE_ALG_TKIP: 3314 case IW_ENCODE_ALG_TKIP:
3314 alg = "TKIP"; 3315 alg = "TKIP";
3315 module = "hostap_crypt_tkip"; 3316 module = "ieee80211_crypt_tkip";
3316 break; 3317 break;
3317 case IW_ENCODE_ALG_CCMP: 3318 case IW_ENCODE_ALG_CCMP:
3318 alg = "CCMP"; 3319 alg = "CCMP";
3319 module = "hostap_crypt_ccmp"; 3320 module = "ieee80211_crypt_ccmp";
3320 break; 3321 break;
3321 default: 3322 default:
3322 printk(KERN_DEBUG "%s: unsupported algorithm %d\n", 3323 printk(KERN_DEBUG "%s: unsupported algorithm %d\n",
@@ -3325,10 +3326,10 @@ static int prism2_ioctl_siwencodeext(struct net_device *dev,
3325 goto done; 3326 goto done;
3326 } 3327 }
3327 3328
3328 ops = hostap_get_crypto_ops(alg); 3329 ops = ieee80211_get_crypto_ops(alg);
3329 if (ops == NULL) { 3330 if (ops == NULL) {
3330 request_module(module); 3331 request_module(module);
3331 ops = hostap_get_crypto_ops(alg); 3332 ops = ieee80211_get_crypto_ops(alg);
3332 } 3333 }
3333 if (ops == NULL) { 3334 if (ops == NULL) {
3334 printk(KERN_DEBUG "%s: unknown crypto alg '%s'\n", 3335 printk(KERN_DEBUG "%s: unknown crypto alg '%s'\n",
@@ -3347,17 +3348,18 @@ static int prism2_ioctl_siwencodeext(struct net_device *dev,
3347 } 3348 }
3348 3349
3349 if (*crypt == NULL || (*crypt)->ops != ops) { 3350 if (*crypt == NULL || (*crypt)->ops != ops) {
3350 struct prism2_crypt_data *new_crypt; 3351 struct ieee80211_crypt_data *new_crypt;
3351 3352
3352 prism2_crypt_delayed_deinit(local, crypt); 3353 prism2_crypt_delayed_deinit(local, crypt);
3353 3354
3354 new_crypt = (struct prism2_crypt_data *) 3355 new_crypt = (struct ieee80211_crypt_data *)
3355 kmalloc(sizeof(struct prism2_crypt_data), GFP_KERNEL); 3356 kmalloc(sizeof(struct ieee80211_crypt_data),
3357 GFP_KERNEL);
3356 if (new_crypt == NULL) { 3358 if (new_crypt == NULL) {
3357 ret = -ENOMEM; 3359 ret = -ENOMEM;
3358 goto done; 3360 goto done;
3359 } 3361 }
3360 memset(new_crypt, 0, sizeof(struct prism2_crypt_data)); 3362 memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data));
3361 new_crypt->ops = ops; 3363 new_crypt->ops = ops;
3362 new_crypt->priv = new_crypt->ops->init(i); 3364 new_crypt->priv = new_crypt->ops->init(i);
3363 if (new_crypt->priv == NULL) { 3365 if (new_crypt->priv == NULL) {
@@ -3436,7 +3438,7 @@ static int prism2_ioctl_giwencodeext(struct net_device *dev,
3436{ 3438{
3437 struct hostap_interface *iface = dev->priv; 3439 struct hostap_interface *iface = dev->priv;
3438 local_info_t *local = iface->local; 3440 local_info_t *local = iface->local;
3439 struct prism2_crypt_data **crypt; 3441 struct ieee80211_crypt_data **crypt;
3440 void *sta_ptr; 3442 void *sta_ptr;
3441 int max_key_len, i; 3443 int max_key_len, i;
3442 struct iw_encode_ext *ext = (struct iw_encode_ext *) extra; 3444 struct iw_encode_ext *ext = (struct iw_encode_ext *) extra;
@@ -3505,8 +3507,8 @@ static int prism2_ioctl_set_encryption(local_info_t *local,
3505 int param_len) 3507 int param_len)
3506{ 3508{
3507 int ret = 0; 3509 int ret = 0;
3508 struct hostap_crypto_ops *ops; 3510 struct ieee80211_crypto_ops *ops;
3509 struct prism2_crypt_data **crypt; 3511 struct ieee80211_crypt_data **crypt;
3510 void *sta_ptr; 3512 void *sta_ptr;
3511 3513
3512 param->u.crypt.err = 0; 3514 param->u.crypt.err = 0;
@@ -3544,16 +3546,16 @@ static int prism2_ioctl_set_encryption(local_info_t *local,
3544 goto done; 3546 goto done;
3545 } 3547 }
3546 3548
3547 ops = hostap_get_crypto_ops(param->u.crypt.alg); 3549 ops = ieee80211_get_crypto_ops(param->u.crypt.alg);
3548 if (ops == NULL && strcmp(param->u.crypt.alg, "WEP") == 0) { 3550 if (ops == NULL && strcmp(param->u.crypt.alg, "WEP") == 0) {
3549 request_module("hostap_crypt_wep"); 3551 request_module("ieee80211_crypt_wep");
3550 ops = hostap_get_crypto_ops(param->u.crypt.alg); 3552 ops = ieee80211_get_crypto_ops(param->u.crypt.alg);
3551 } else if (ops == NULL && strcmp(param->u.crypt.alg, "TKIP") == 0) { 3553 } else if (ops == NULL && strcmp(param->u.crypt.alg, "TKIP") == 0) {
3552 request_module("hostap_crypt_tkip"); 3554 request_module("ieee80211_crypt_tkip");
3553 ops = hostap_get_crypto_ops(param->u.crypt.alg); 3555 ops = ieee80211_get_crypto_ops(param->u.crypt.alg);
3554 } else if (ops == NULL && strcmp(param->u.crypt.alg, "CCMP") == 0) { 3556 } else if (ops == NULL && strcmp(param->u.crypt.alg, "CCMP") == 0) {
3555 request_module("hostap_crypt_ccmp"); 3557 request_module("ieee80211_crypt_ccmp");
3556 ops = hostap_get_crypto_ops(param->u.crypt.alg); 3558 ops = ieee80211_get_crypto_ops(param->u.crypt.alg);
3557 } 3559 }
3558 if (ops == NULL) { 3560 if (ops == NULL) {
3559 printk(KERN_DEBUG "%s: unknown crypto alg '%s'\n", 3561 printk(KERN_DEBUG "%s: unknown crypto alg '%s'\n",
@@ -3568,17 +3570,18 @@ static int prism2_ioctl_set_encryption(local_info_t *local,
3568 local->host_decrypt = local->host_encrypt = 1; 3570 local->host_decrypt = local->host_encrypt = 1;
3569 3571
3570 if (*crypt == NULL || (*crypt)->ops != ops) { 3572 if (*crypt == NULL || (*crypt)->ops != ops) {
3571 struct prism2_crypt_data *new_crypt; 3573 struct ieee80211_crypt_data *new_crypt;
3572 3574
3573 prism2_crypt_delayed_deinit(local, crypt); 3575 prism2_crypt_delayed_deinit(local, crypt);
3574 3576
3575 new_crypt = (struct prism2_crypt_data *) 3577 new_crypt = (struct ieee80211_crypt_data *)
3576 kmalloc(sizeof(struct prism2_crypt_data), GFP_KERNEL); 3578 kmalloc(sizeof(struct ieee80211_crypt_data),
3579 GFP_KERNEL);
3577 if (new_crypt == NULL) { 3580 if (new_crypt == NULL) {
3578 ret = -ENOMEM; 3581 ret = -ENOMEM;
3579 goto done; 3582 goto done;
3580 } 3583 }
3581 memset(new_crypt, 0, sizeof(struct prism2_crypt_data)); 3584 memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data));
3582 new_crypt->ops = ops; 3585 new_crypt->ops = ops;
3583 new_crypt->priv = new_crypt->ops->init(param->u.crypt.idx); 3586 new_crypt->priv = new_crypt->ops->init(param->u.crypt.idx);
3584 if (new_crypt->priv == NULL) { 3587 if (new_crypt->priv == NULL) {
@@ -3642,7 +3645,7 @@ static int prism2_ioctl_get_encryption(local_info_t *local,
3642 struct prism2_hostapd_param *param, 3645 struct prism2_hostapd_param *param,
3643 int param_len) 3646 int param_len)
3644{ 3647{
3645 struct prism2_crypt_data **crypt; 3648 struct ieee80211_crypt_data **crypt;
3646 void *sta_ptr; 3649 void *sta_ptr;
3647 int max_key_len; 3650 int max_key_len;
3648 3651