diff options
-rw-r--r-- | drivers/net/wireless/ipw2100.c | 97 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2100.h | 2 |
2 files changed, 51 insertions, 48 deletions
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index e7c222119da6..cf5da20d1d45 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c | |||
@@ -1616,7 +1616,7 @@ static int ipw2100_set_scan_options(struct ipw2100_priv *priv) | |||
1616 | 1616 | ||
1617 | if (!(priv->config & CFG_ASSOCIATE)) | 1617 | if (!(priv->config & CFG_ASSOCIATE)) |
1618 | cmd.host_command_parameters[0] |= IPW_SCAN_NOASSOCIATE; | 1618 | cmd.host_command_parameters[0] |= IPW_SCAN_NOASSOCIATE; |
1619 | if ((priv->sec.flags & SEC_ENABLED) && priv->sec.enabled) | 1619 | if ((priv->ieee->sec.flags & SEC_ENABLED) && priv->ieee->sec.enabled) |
1620 | cmd.host_command_parameters[0] |= IPW_SCAN_MIXED_CELL; | 1620 | cmd.host_command_parameters[0] |= IPW_SCAN_MIXED_CELL; |
1621 | if (priv->config & CFG_PASSIVE_SCAN) | 1621 | if (priv->config & CFG_PASSIVE_SCAN) |
1622 | cmd.host_command_parameters[0] |= IPW_SCAN_PASSIVE; | 1622 | cmd.host_command_parameters[0] |= IPW_SCAN_PASSIVE; |
@@ -5349,23 +5349,23 @@ static int ipw2100_configure_security(struct ipw2100_priv *priv, int batch_mode) | |||
5349 | return err; | 5349 | return err; |
5350 | } | 5350 | } |
5351 | 5351 | ||
5352 | if (!priv->sec.enabled) { | 5352 | if (!priv->ieee->sec.enabled) { |
5353 | err = | 5353 | err = |
5354 | ipw2100_set_security_information(priv, IPW_AUTH_OPEN, | 5354 | ipw2100_set_security_information(priv, IPW_AUTH_OPEN, |
5355 | SEC_LEVEL_0, 0, 1); | 5355 | SEC_LEVEL_0, 0, 1); |
5356 | } else { | 5356 | } else { |
5357 | auth_mode = IPW_AUTH_OPEN; | 5357 | auth_mode = IPW_AUTH_OPEN; |
5358 | if ((priv->sec.flags & SEC_AUTH_MODE) && | 5358 | if ((priv->ieee->sec.flags & SEC_AUTH_MODE) && |
5359 | (priv->sec.auth_mode == WLAN_AUTH_SHARED_KEY)) | 5359 | (priv->ieee->sec.auth_mode == WLAN_AUTH_SHARED_KEY)) |
5360 | auth_mode = IPW_AUTH_SHARED; | 5360 | auth_mode = IPW_AUTH_SHARED; |
5361 | 5361 | ||
5362 | sec_level = SEC_LEVEL_0; | 5362 | sec_level = SEC_LEVEL_0; |
5363 | if (priv->sec.flags & SEC_LEVEL) | 5363 | if (priv->ieee->sec.flags & SEC_LEVEL) |
5364 | sec_level = priv->sec.level; | 5364 | sec_level = priv->ieee->sec.level; |
5365 | 5365 | ||
5366 | use_group = 0; | 5366 | use_group = 0; |
5367 | if (priv->sec.flags & SEC_UNICAST_GROUP) | 5367 | if (priv->ieee->sec.flags & SEC_UNICAST_GROUP) |
5368 | use_group = priv->sec.unicast_uses_group; | 5368 | use_group = priv->ieee->sec.unicast_uses_group; |
5369 | 5369 | ||
5370 | err = | 5370 | err = |
5371 | ipw2100_set_security_information(priv, auth_mode, sec_level, | 5371 | ipw2100_set_security_information(priv, auth_mode, sec_level, |
@@ -5375,16 +5375,16 @@ static int ipw2100_configure_security(struct ipw2100_priv *priv, int batch_mode) | |||
5375 | if (err) | 5375 | if (err) |
5376 | goto exit; | 5376 | goto exit; |
5377 | 5377 | ||
5378 | if (priv->sec.enabled) { | 5378 | if (priv->ieee->sec.enabled) { |
5379 | for (i = 0; i < 4; i++) { | 5379 | for (i = 0; i < 4; i++) { |
5380 | if (!(priv->sec.flags & (1 << i))) { | 5380 | if (!(priv->ieee->sec.flags & (1 << i))) { |
5381 | memset(priv->sec.keys[i], 0, WEP_KEY_LEN); | 5381 | memset(priv->ieee->sec.keys[i], 0, WEP_KEY_LEN); |
5382 | priv->sec.key_sizes[i] = 0; | 5382 | priv->ieee->sec.key_sizes[i] = 0; |
5383 | } else { | 5383 | } else { |
5384 | err = ipw2100_set_key(priv, i, | 5384 | err = ipw2100_set_key(priv, i, |
5385 | priv->sec.keys[i], | 5385 | priv->ieee->sec.keys[i], |
5386 | priv->sec.key_sizes[i], | 5386 | priv->ieee->sec. |
5387 | 1); | 5387 | key_sizes[i], 1); |
5388 | if (err) | 5388 | if (err) |
5389 | goto exit; | 5389 | goto exit; |
5390 | } | 5390 | } |
@@ -5397,8 +5397,8 @@ static int ipw2100_configure_security(struct ipw2100_priv *priv, int batch_mode) | |||
5397 | * encrypted data is sent up */ | 5397 | * encrypted data is sent up */ |
5398 | err = | 5398 | err = |
5399 | ipw2100_set_wep_flags(priv, | 5399 | ipw2100_set_wep_flags(priv, |
5400 | priv->sec.enabled ? IPW_PRIVACY_CAPABLE : 0, | 5400 | priv->ieee->sec. |
5401 | 1); | 5401 | enabled ? IPW_PRIVACY_CAPABLE : 0, 1); |
5402 | if (err) | 5402 | if (err) |
5403 | goto exit; | 5403 | goto exit; |
5404 | 5404 | ||
@@ -5433,58 +5433,61 @@ static void shim__set_security(struct net_device *dev, | |||
5433 | 5433 | ||
5434 | for (i = 0; i < 4; i++) { | 5434 | for (i = 0; i < 4; i++) { |
5435 | if (sec->flags & (1 << i)) { | 5435 | if (sec->flags & (1 << i)) { |
5436 | priv->sec.key_sizes[i] = sec->key_sizes[i]; | 5436 | priv->ieee->sec.key_sizes[i] = sec->key_sizes[i]; |
5437 | if (sec->key_sizes[i] == 0) | 5437 | if (sec->key_sizes[i] == 0) |
5438 | priv->sec.flags &= ~(1 << i); | 5438 | priv->ieee->sec.flags &= ~(1 << i); |
5439 | else | 5439 | else |
5440 | memcpy(priv->sec.keys[i], sec->keys[i], | 5440 | memcpy(priv->ieee->sec.keys[i], sec->keys[i], |
5441 | sec->key_sizes[i]); | 5441 | sec->key_sizes[i]); |
5442 | priv->sec.flags |= (1 << i); | 5442 | priv->ieee->sec.flags |= (1 << i); |
5443 | priv->status |= STATUS_SECURITY_UPDATED; | 5443 | priv->status |= STATUS_SECURITY_UPDATED; |
5444 | } | 5444 | } |
5445 | } | 5445 | } |
5446 | 5446 | ||
5447 | if ((sec->flags & SEC_ACTIVE_KEY) && | 5447 | if ((sec->flags & SEC_ACTIVE_KEY) && |
5448 | priv->sec.active_key != sec->active_key) { | 5448 | priv->ieee->sec.active_key != sec->active_key) { |
5449 | if (sec->active_key <= 3) { | 5449 | if (sec->active_key <= 3) { |
5450 | priv->sec.active_key = sec->active_key; | 5450 | priv->ieee->sec.active_key = sec->active_key; |
5451 | priv->sec.flags |= SEC_ACTIVE_KEY; | 5451 | priv->ieee->sec.flags |= SEC_ACTIVE_KEY; |
5452 | } else | 5452 | } else |
5453 | priv->sec.flags &= ~SEC_ACTIVE_KEY; | 5453 | priv->ieee->sec.flags &= ~SEC_ACTIVE_KEY; |
5454 | 5454 | ||
5455 | priv->status |= STATUS_SECURITY_UPDATED; | 5455 | priv->status |= STATUS_SECURITY_UPDATED; |
5456 | } | 5456 | } |
5457 | 5457 | ||
5458 | if ((sec->flags & SEC_AUTH_MODE) && | 5458 | if ((sec->flags & SEC_AUTH_MODE) && |
5459 | (priv->sec.auth_mode != sec->auth_mode)) { | 5459 | (priv->ieee->sec.auth_mode != sec->auth_mode)) { |
5460 | priv->sec.auth_mode = sec->auth_mode; | 5460 | priv->ieee->sec.auth_mode = sec->auth_mode; |
5461 | priv->sec.flags |= SEC_AUTH_MODE; | 5461 | priv->ieee->sec.flags |= SEC_AUTH_MODE; |
5462 | priv->status |= STATUS_SECURITY_UPDATED; | 5462 | priv->status |= STATUS_SECURITY_UPDATED; |
5463 | } | 5463 | } |
5464 | 5464 | ||
5465 | if (sec->flags & SEC_ENABLED && priv->sec.enabled != sec->enabled) { | 5465 | if (sec->flags & SEC_ENABLED && priv->ieee->sec.enabled != sec->enabled) { |
5466 | priv->sec.flags |= SEC_ENABLED; | 5466 | priv->ieee->sec.flags |= SEC_ENABLED; |
5467 | priv->sec.enabled = sec->enabled; | 5467 | priv->ieee->sec.enabled = sec->enabled; |
5468 | priv->status |= STATUS_SECURITY_UPDATED; | 5468 | priv->status |= STATUS_SECURITY_UPDATED; |
5469 | force_update = 1; | 5469 | force_update = 1; |
5470 | } | 5470 | } |
5471 | 5471 | ||
5472 | if (sec->flags & SEC_LEVEL && priv->sec.level != sec->level) { | 5472 | if (sec->flags & SEC_ENCRYPT) |
5473 | priv->sec.level = sec->level; | 5473 | priv->ieee->sec.encrypt = sec->encrypt; |
5474 | priv->sec.flags |= SEC_LEVEL; | 5474 | |
5475 | if (sec->flags & SEC_LEVEL && priv->ieee->sec.level != sec->level) { | ||
5476 | priv->ieee->sec.level = sec->level; | ||
5477 | priv->ieee->sec.flags |= SEC_LEVEL; | ||
5475 | priv->status |= STATUS_SECURITY_UPDATED; | 5478 | priv->status |= STATUS_SECURITY_UPDATED; |
5476 | } | 5479 | } |
5477 | 5480 | ||
5478 | IPW_DEBUG_WEP("Security flags: %c %c%c%c%c %c%c%c%c\n", | 5481 | IPW_DEBUG_WEP("Security flags: %c %c%c%c%c %c%c%c%c\n", |
5479 | priv->sec.flags & (1 << 8) ? '1' : '0', | 5482 | priv->ieee->sec.flags & (1 << 8) ? '1' : '0', |
5480 | priv->sec.flags & (1 << 7) ? '1' : '0', | 5483 | priv->ieee->sec.flags & (1 << 7) ? '1' : '0', |
5481 | priv->sec.flags & (1 << 6) ? '1' : '0', | 5484 | priv->ieee->sec.flags & (1 << 6) ? '1' : '0', |
5482 | priv->sec.flags & (1 << 5) ? '1' : '0', | 5485 | priv->ieee->sec.flags & (1 << 5) ? '1' : '0', |
5483 | priv->sec.flags & (1 << 4) ? '1' : '0', | 5486 | priv->ieee->sec.flags & (1 << 4) ? '1' : '0', |
5484 | priv->sec.flags & (1 << 3) ? '1' : '0', | 5487 | priv->ieee->sec.flags & (1 << 3) ? '1' : '0', |
5485 | priv->sec.flags & (1 << 2) ? '1' : '0', | 5488 | priv->ieee->sec.flags & (1 << 2) ? '1' : '0', |
5486 | priv->sec.flags & (1 << 1) ? '1' : '0', | 5489 | priv->ieee->sec.flags & (1 << 1) ? '1' : '0', |
5487 | priv->sec.flags & (1 << 0) ? '1' : '0'); | 5490 | priv->ieee->sec.flags & (1 << 0) ? '1' : '0'); |
5488 | 5491 | ||
5489 | /* As a temporary work around to enable WPA until we figure out why | 5492 | /* As a temporary work around to enable WPA until we figure out why |
5490 | * wpa_supplicant toggles the security capability of the driver, which | 5493 | * wpa_supplicant toggles the security capability of the driver, which |
@@ -5995,17 +5998,19 @@ static int ipw2100_wpa_set_encryption(struct net_device *dev, | |||
5995 | return -EINVAL; | 5998 | return -EINVAL; |
5996 | } | 5999 | } |
5997 | 6000 | ||
6001 | sec.flags |= SEC_ENABLED | SEC_ENCRYPT; | ||
5998 | if (strcmp(param->u.crypt.alg, "none") == 0) { | 6002 | if (strcmp(param->u.crypt.alg, "none") == 0) { |
5999 | if (crypt) { | 6003 | if (crypt) { |
6000 | sec.enabled = 0; | 6004 | sec.enabled = 0; |
6005 | sec.encrypt = 0; | ||
6001 | sec.level = SEC_LEVEL_0; | 6006 | sec.level = SEC_LEVEL_0; |
6002 | sec.flags |= SEC_ENABLED | SEC_LEVEL; | 6007 | sec.flags |= SEC_LEVEL; |
6003 | ieee80211_crypt_delayed_deinit(ieee, crypt); | 6008 | ieee80211_crypt_delayed_deinit(ieee, crypt); |
6004 | } | 6009 | } |
6005 | goto done; | 6010 | goto done; |
6006 | } | 6011 | } |
6007 | sec.enabled = 1; | 6012 | sec.enabled = 1; |
6008 | sec.flags |= SEC_ENABLED; | 6013 | sec.encrypt = 1; |
6009 | 6014 | ||
6010 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); | 6015 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); |
6011 | if (ops == NULL && strcmp(param->u.crypt.alg, "WEP") == 0) { | 6016 | if (ops == NULL && strcmp(param->u.crypt.alg, "WEP") == 0) { |
@@ -8029,7 +8034,7 @@ static int ipw2100_wx_get_auth(struct net_device *dev, | |||
8029 | break; | 8034 | break; |
8030 | 8035 | ||
8031 | case IW_AUTH_80211_AUTH_ALG: | 8036 | case IW_AUTH_80211_AUTH_ALG: |
8032 | param->value = priv->sec.auth_mode; | 8037 | param->value = priv->ieee->sec.auth_mode; |
8033 | break; | 8038 | break; |
8034 | 8039 | ||
8035 | case IW_AUTH_WPA_ENABLED: | 8040 | case IW_AUTH_WPA_ENABLED: |
diff --git a/drivers/net/wireless/ipw2100.h b/drivers/net/wireless/ipw2100.h index 99fce99b701a..a1a9cbcf6c2f 100644 --- a/drivers/net/wireless/ipw2100.h +++ b/drivers/net/wireless/ipw2100.h | |||
@@ -524,8 +524,6 @@ struct ipw2100_priv { | |||
524 | 524 | ||
525 | int power_mode; | 525 | int power_mode; |
526 | 526 | ||
527 | /* WEP data */ | ||
528 | struct ieee80211_security sec; | ||
529 | int messages_sent; | 527 | int messages_sent; |
530 | 528 | ||
531 | int short_retry_limit; | 529 | int short_retry_limit; |