diff options
author | Dan Williams <dcbw@redhat.com> | 2006-02-05 18:00:30 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-02-17 08:17:00 -0500 |
commit | 22d8846e5ce329436628da71a4239ccc2745869f (patch) | |
tree | 623c307aaf08150a39a480241711fb0ec2e99416 /drivers/net/wireless/airo.c | |
parent | 1ba61e05e254a587b7a6be9484a8bcd973551be1 (diff) |
[PATCH] wireless/airo: fix setting TX key index plus key in ENCODEEXT
The previous patch that added ENCODEEXT and AUTH support to the airo
driver contained a slight error which would cause setting the TX
key index ignore a valid key-set request at the same time. This patch
allows any combination of setting the TX key index and setting an
encryption key.
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/airo.c')
-rw-r--r-- | drivers/net/wireless/airo.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index ef6495b07890..b96b6dbe01f9 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -6266,7 +6266,7 @@ static int airo_set_encodeext(struct net_device *dev, | |||
6266 | CapabilityRid cap_rid; /* Card capability info */ | 6266 | CapabilityRid cap_rid; /* Card capability info */ |
6267 | int perm = ( encoding->flags & IW_ENCODE_TEMP ? 0 : 1 ); | 6267 | int perm = ( encoding->flags & IW_ENCODE_TEMP ? 0 : 1 ); |
6268 | u16 currentAuthType = local->config.authType; | 6268 | u16 currentAuthType = local->config.authType; |
6269 | int idx, key_len, alg = ext->alg; /* Check encryption mode */ | 6269 | int idx, key_len, alg = ext->alg, set_key = 1; |
6270 | wep_key_t key; | 6270 | wep_key_t key; |
6271 | 6271 | ||
6272 | /* Is WEP supported ? */ | 6272 | /* Is WEP supported ? */ |
@@ -6289,10 +6289,15 @@ static int airo_set_encodeext(struct net_device *dev, | |||
6289 | if (encoding->flags & IW_ENCODE_DISABLED) | 6289 | if (encoding->flags & IW_ENCODE_DISABLED) |
6290 | alg = IW_ENCODE_ALG_NONE; | 6290 | alg = IW_ENCODE_ALG_NONE; |
6291 | 6291 | ||
6292 | /* Just setting the transmit key? */ | ||
6293 | if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) { | 6292 | if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) { |
6293 | /* Only set transmit key index here, actual | ||
6294 | * key is set below if needed. | ||
6295 | */ | ||
6294 | set_wep_key(local, idx, NULL, 0, perm, 1); | 6296 | set_wep_key(local, idx, NULL, 0, perm, 1); |
6295 | } else { | 6297 | set_key = ext->key_len > 0 ? 1 : 0; |
6298 | } | ||
6299 | |||
6300 | if (set_key) { | ||
6296 | /* Set the requested key first */ | 6301 | /* Set the requested key first */ |
6297 | memset(key.key, 0, MAX_KEY_SIZE); | 6302 | memset(key.key, 0, MAX_KEY_SIZE); |
6298 | switch (alg) { | 6303 | switch (alg) { |