Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 183959
b: refs/heads/master
c: f09c256
h: refs/heads/master
i:
  183957: b37583d
  183955: e2991f9
  183951: ae83811
v: v3
  • Loading branch information
Stanislaw Gruszka authored and John W. Linville committed Feb 2, 2010
1 parent 06610a2 commit 4e48e7d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 299af9d3db0fd3a4994e5e66717ecd276bdd60da
refs/heads/master: f09c256375c7cf1e112b8ef6306cdd313490d7c0
34 changes: 18 additions & 16 deletions trunk/drivers/net/wireless/airo.c
Original file line number Diff line number Diff line change
Expand Up @@ -5254,11 +5254,7 @@ static int set_wep_key(struct airo_info *ai, u16 index, const char *key,
WepKeyRid wkr;
int rc;

if (keylen == 0) {
airo_print_err(ai->dev->name, "%s: key length to set was zero",
__func__);
return -1;
}
WARN_ON(keylen == 0);

memset(&wkr, 0, sizeof(wkr));
wkr.len = cpu_to_le16(sizeof(wkr));
Expand Down Expand Up @@ -6405,11 +6401,7 @@ static int airo_set_encode(struct net_device *dev,
if (dwrq->length > MIN_KEY_SIZE)
key.len = MAX_KEY_SIZE;
else
if (dwrq->length > 0)
key.len = MIN_KEY_SIZE;
else
/* Disable the key */
key.len = 0;
key.len = MIN_KEY_SIZE;
/* Check if the key is not marked as invalid */
if(!(dwrq->flags & IW_ENCODE_NOKEY)) {
/* Cleanup */
Expand Down Expand Up @@ -6590,12 +6582,22 @@ static int airo_set_encodeext(struct net_device *dev,
default:
return -EINVAL;
}
/* Send the key to the card */
rc = set_wep_key(local, idx, key.key, key.len, perm, 1);
if (rc < 0) {
airo_print_err(local->dev->name, "failed to set WEP key"
" at index %d: %d.", idx, rc);
return rc;
if (key.len == 0) {
rc = set_wep_tx_idx(local, idx, perm, 1);
if (rc < 0) {
airo_print_err(local->dev->name,
"failed to set WEP transmit index to %d: %d.",
idx, rc);
return rc;
}
} else {
rc = set_wep_key(local, idx, key.key, key.len, perm, 1);
if (rc < 0) {
airo_print_err(local->dev->name,
"failed to set WEP key at index %d: %d.",
idx, rc);
return rc;
}
}
}

Expand Down

0 comments on commit 4e48e7d

Please sign in to comment.