aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/airo.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 4331d675fcc6..2a9f029a3c74 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -5254,11 +5254,7 @@ static int set_wep_key(struct airo_info *ai, u16 index, const char *key,
5254 WepKeyRid wkr; 5254 WepKeyRid wkr;
5255 int rc; 5255 int rc;
5256 5256
5257 if (keylen == 0) { 5257 WARN_ON(keylen == 0);
5258 airo_print_err(ai->dev->name, "%s: key length to set was zero",
5259 __func__);
5260 return -1;
5261 }
5262 5258
5263 memset(&wkr, 0, sizeof(wkr)); 5259 memset(&wkr, 0, sizeof(wkr));
5264 wkr.len = cpu_to_le16(sizeof(wkr)); 5260 wkr.len = cpu_to_le16(sizeof(wkr));
@@ -6405,11 +6401,7 @@ static int airo_set_encode(struct net_device *dev,
6405 if (dwrq->length > MIN_KEY_SIZE) 6401 if (dwrq->length > MIN_KEY_SIZE)
6406 key.len = MAX_KEY_SIZE; 6402 key.len = MAX_KEY_SIZE;
6407 else 6403 else
6408 if (dwrq->length > 0) 6404 key.len = MIN_KEY_SIZE;
6409 key.len = MIN_KEY_SIZE;
6410 else
6411 /* Disable the key */
6412 key.len = 0;
6413 /* Check if the key is not marked as invalid */ 6405 /* Check if the key is not marked as invalid */
6414 if(!(dwrq->flags & IW_ENCODE_NOKEY)) { 6406 if(!(dwrq->flags & IW_ENCODE_NOKEY)) {
6415 /* Cleanup */ 6407 /* Cleanup */
@@ -6590,12 +6582,22 @@ static int airo_set_encodeext(struct net_device *dev,
6590 default: 6582 default:
6591 return -EINVAL; 6583 return -EINVAL;
6592 } 6584 }
6593 /* Send the key to the card */ 6585 if (key.len == 0) {
6594 rc = set_wep_key(local, idx, key.key, key.len, perm, 1); 6586 rc = set_wep_tx_idx(local, idx, perm, 1);
6595 if (rc < 0) { 6587 if (rc < 0) {
6596 airo_print_err(local->dev->name, "failed to set WEP key" 6588 airo_print_err(local->dev->name,
6597 " at index %d: %d.", idx, rc); 6589 "failed to set WEP transmit index to %d: %d.",
6598 return rc; 6590 idx, rc);
6591 return rc;
6592 }
6593 } else {
6594 rc = set_wep_key(local, idx, key.key, key.len, perm, 1);
6595 if (rc < 0) {
6596 airo_print_err(local->dev->name,
6597 "failed to set WEP key at index %d: %d.",
6598 idx, rc);
6599 return rc;
6600 }
6599 } 6601 }
6600 } 6602 }
6601 6603