diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-04 19:31:56 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-04 19:31:56 -0500 |
commit | d779188d2baf436e67fe8816fca2ef53d246900f (patch) | |
tree | 9bac75842a5611172860feec3c4019ff874a2b89 /drivers/net/wireless/airo.c | |
parent | f61ea1b0c825a20a1826bb43a226387091934586 (diff) | |
parent | ac67c6247361b3b8644b34e5301a46d5069c1373 (diff) |
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
Diffstat (limited to 'drivers/net/wireless/airo.c')
-rw-r--r-- | drivers/net/wireless/airo.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index 7a92b1cbd6aa..ee866fd6957d 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -4037,7 +4037,7 @@ static int PC4500_writerid(struct airo_info *ai, u16 rid, | |||
4037 | Cmd cmd; | 4037 | Cmd cmd; |
4038 | Resp rsp; | 4038 | Resp rsp; |
4039 | 4039 | ||
4040 | if (test_bit(FLAG_ENABLED, &ai->flags)) | 4040 | if (test_bit(FLAG_ENABLED, &ai->flags) && (RID_WEP_TEMP != rid)) |
4041 | printk(KERN_ERR | 4041 | printk(KERN_ERR |
4042 | "%s: MAC should be disabled (rid=%04x)\n", | 4042 | "%s: MAC should be disabled (rid=%04x)\n", |
4043 | __FUNCTION__, rid); | 4043 | __FUNCTION__, rid); |
@@ -5093,9 +5093,9 @@ static int set_wep_key(struct airo_info *ai, u16 index, | |||
5093 | printk(KERN_INFO "Setting key %d\n", index); | 5093 | printk(KERN_INFO "Setting key %d\n", index); |
5094 | } | 5094 | } |
5095 | 5095 | ||
5096 | disable_MAC(ai, lock); | 5096 | if (perm) disable_MAC(ai, lock); |
5097 | writeWepKeyRid(ai, &wkr, perm, lock); | 5097 | writeWepKeyRid(ai, &wkr, perm, lock); |
5098 | enable_MAC(ai, &rsp, lock); | 5098 | if (perm) enable_MAC(ai, &rsp, lock); |
5099 | return 0; | 5099 | return 0; |
5100 | } | 5100 | } |
5101 | 5101 | ||
@@ -6170,6 +6170,8 @@ static int airo_set_encode(struct net_device *dev, | |||
6170 | { | 6170 | { |
6171 | struct airo_info *local = dev->priv; | 6171 | struct airo_info *local = dev->priv; |
6172 | CapabilityRid cap_rid; /* Card capability info */ | 6172 | CapabilityRid cap_rid; /* Card capability info */ |
6173 | int perm = ( dwrq->flags & IW_ENCODE_TEMP ? 0 : 1 ); | ||
6174 | u16 currentAuthType = local->config.authType; | ||
6173 | 6175 | ||
6174 | /* Is WEP supported ? */ | 6176 | /* Is WEP supported ? */ |
6175 | readCapabilityRid(local, &cap_rid, 1); | 6177 | readCapabilityRid(local, &cap_rid, 1); |
@@ -6212,7 +6214,7 @@ static int airo_set_encode(struct net_device *dev, | |||
6212 | /* Copy the key in the driver */ | 6214 | /* Copy the key in the driver */ |
6213 | memcpy(key.key, extra, dwrq->length); | 6215 | memcpy(key.key, extra, dwrq->length); |
6214 | /* Send the key to the card */ | 6216 | /* Send the key to the card */ |
6215 | set_wep_key(local, index, key.key, key.len, 1, 1); | 6217 | set_wep_key(local, index, key.key, key.len, perm, 1); |
6216 | } | 6218 | } |
6217 | /* WE specify that if a valid key is set, encryption | 6219 | /* WE specify that if a valid key is set, encryption |
6218 | * should be enabled (user may turn it off later) | 6220 | * should be enabled (user may turn it off later) |
@@ -6220,13 +6222,12 @@ static int airo_set_encode(struct net_device *dev, | |||
6220 | if((index == current_index) && (key.len > 0) && | 6222 | if((index == current_index) && (key.len > 0) && |
6221 | (local->config.authType == AUTH_OPEN)) { | 6223 | (local->config.authType == AUTH_OPEN)) { |
6222 | local->config.authType = AUTH_ENCRYPT; | 6224 | local->config.authType = AUTH_ENCRYPT; |
6223 | set_bit (FLAG_COMMIT, &local->flags); | ||
6224 | } | 6225 | } |
6225 | } else { | 6226 | } else { |
6226 | /* Do we want to just set the transmit key index ? */ | 6227 | /* Do we want to just set the transmit key index ? */ |
6227 | int index = (dwrq->flags & IW_ENCODE_INDEX) - 1; | 6228 | int index = (dwrq->flags & IW_ENCODE_INDEX) - 1; |
6228 | if ((index >= 0) && (index < ((cap_rid.softCap & 0x80)?4:1))) { | 6229 | if ((index >= 0) && (index < ((cap_rid.softCap & 0x80)?4:1))) { |
6229 | set_wep_key(local, index, NULL, 0, 1, 1); | 6230 | set_wep_key(local, index, NULL, 0, perm, 1); |
6230 | } else | 6231 | } else |
6231 | /* Don't complain if only change the mode */ | 6232 | /* Don't complain if only change the mode */ |
6232 | if(!dwrq->flags & IW_ENCODE_MODE) { | 6233 | if(!dwrq->flags & IW_ENCODE_MODE) { |
@@ -6241,7 +6242,7 @@ static int airo_set_encode(struct net_device *dev, | |||
6241 | if(dwrq->flags & IW_ENCODE_OPEN) | 6242 | if(dwrq->flags & IW_ENCODE_OPEN) |
6242 | local->config.authType = AUTH_ENCRYPT; // Only Wep | 6243 | local->config.authType = AUTH_ENCRYPT; // Only Wep |
6243 | /* Commit the changes to flags if needed */ | 6244 | /* Commit the changes to flags if needed */ |
6244 | if(dwrq->flags & IW_ENCODE_MODE) | 6245 | if (local->config.authType != currentAuthType) |
6245 | set_bit (FLAG_COMMIT, &local->flags); | 6246 | set_bit (FLAG_COMMIT, &local->flags); |
6246 | return -EINPROGRESS; /* Call commit handler */ | 6247 | return -EINPROGRESS; /* Call commit handler */ |
6247 | } | 6248 | } |