Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 15777
b: refs/heads/master
c: f89b232
h: refs/heads/master
i:
  15775: ee5c0c9
v: v3
  • Loading branch information
Dan Streetman authored and Jeff Garzik committed Dec 1, 2005
1 parent ecbd405 commit c0d635a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 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: 127477840b9fd205958203648b9fa89860d69a43
refs/heads/master: f89b23217372ed9bdba8804c1616d445402d1e05
15 changes: 8 additions & 7 deletions trunk/drivers/net/wireless/airo.c
Original file line number Diff line number Diff line change
Expand Up @@ -4037,7 +4037,7 @@ static int PC4500_writerid(struct airo_info *ai, u16 rid,
Cmd cmd;
Resp rsp;

if (test_bit(FLAG_ENABLED, &ai->flags))
if (test_bit(FLAG_ENABLED, &ai->flags) && (RID_WEP_TEMP != rid))
printk(KERN_ERR
"%s: MAC should be disabled (rid=%04x)\n",
__FUNCTION__, rid);
Expand Down Expand Up @@ -5093,9 +5093,9 @@ static int set_wep_key(struct airo_info *ai, u16 index,
printk(KERN_INFO "Setting key %d\n", index);
}

disable_MAC(ai, lock);
if (perm) disable_MAC(ai, lock);
writeWepKeyRid(ai, &wkr, perm, lock);
enable_MAC(ai, &rsp, lock);
if (perm) enable_MAC(ai, &rsp, lock);
return 0;
}

Expand Down Expand Up @@ -6170,6 +6170,8 @@ static int airo_set_encode(struct net_device *dev,
{
struct airo_info *local = dev->priv;
CapabilityRid cap_rid; /* Card capability info */
int perm = ( dwrq->flags & IW_ENCODE_TEMP ? 0 : 1 );
u16 currentAuthType = local->config.authType;

/* Is WEP supported ? */
readCapabilityRid(local, &cap_rid, 1);
Expand Down Expand Up @@ -6212,21 +6214,20 @@ static int airo_set_encode(struct net_device *dev,
/* Copy the key in the driver */
memcpy(key.key, extra, dwrq->length);
/* Send the key to the card */
set_wep_key(local, index, key.key, key.len, 1, 1);
set_wep_key(local, index, key.key, key.len, perm, 1);
}
/* WE specify that if a valid key is set, encryption
* should be enabled (user may turn it off later)
* This is also how "iwconfig ethX key on" works */
if((index == current_index) && (key.len > 0) &&
(local->config.authType == AUTH_OPEN)) {
local->config.authType = AUTH_ENCRYPT;
set_bit (FLAG_COMMIT, &local->flags);
}
} else {
/* Do we want to just set the transmit key index ? */
int index = (dwrq->flags & IW_ENCODE_INDEX) - 1;
if ((index >= 0) && (index < ((cap_rid.softCap & 0x80)?4:1))) {
set_wep_key(local, index, NULL, 0, 1, 1);
set_wep_key(local, index, NULL, 0, perm, 1);
} else
/* Don't complain if only change the mode */
if(!dwrq->flags & IW_ENCODE_MODE) {
Expand All @@ -6241,7 +6242,7 @@ static int airo_set_encode(struct net_device *dev,
if(dwrq->flags & IW_ENCODE_OPEN)
local->config.authType = AUTH_ENCRYPT; // Only Wep
/* Commit the changes to flags if needed */
if(dwrq->flags & IW_ENCODE_MODE)
if (local->config.authType != currentAuthType)
set_bit (FLAG_COMMIT, &local->flags);
return -EINPROGRESS; /* Call commit handler */
}
Expand Down

0 comments on commit c0d635a

Please sign in to comment.