diff options
Diffstat (limited to 'drivers/net/wireless/airo.c')
-rw-r--r-- | drivers/net/wireless/airo.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index 4331d675fcc6..c22a34c7639c 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -57,7 +57,7 @@ | |||
57 | #define DRV_NAME "airo" | 57 | #define DRV_NAME "airo" |
58 | 58 | ||
59 | #ifdef CONFIG_PCI | 59 | #ifdef CONFIG_PCI |
60 | static struct pci_device_id card_ids[] = { | 60 | static DEFINE_PCI_DEVICE_TABLE(card_ids) = { |
61 | { 0x14b9, 1, PCI_ANY_ID, PCI_ANY_ID, }, | 61 | { 0x14b9, 1, PCI_ANY_ID, PCI_ANY_ID, }, |
62 | { 0x14b9, 0x4500, PCI_ANY_ID, PCI_ANY_ID }, | 62 | { 0x14b9, 0x4500, PCI_ANY_ID, PCI_ANY_ID }, |
63 | { 0x14b9, 0x4800, PCI_ANY_ID, PCI_ANY_ID, }, | 63 | { 0x14b9, 0x4800, PCI_ANY_ID, PCI_ANY_ID, }, |
@@ -2310,7 +2310,7 @@ static void airo_set_multicast_list(struct net_device *dev) { | |||
2310 | airo_set_promisc(ai); | 2310 | airo_set_promisc(ai); |
2311 | } | 2311 | } |
2312 | 2312 | ||
2313 | if ((dev->flags&IFF_ALLMULTI)||dev->mc_count>0) { | 2313 | if ((dev->flags&IFF_ALLMULTI) || !netdev_mc_empty(dev)) { |
2314 | /* Turn on multicast. (Should be already setup...) */ | 2314 | /* Turn on multicast. (Should be already setup...) */ |
2315 | } | 2315 | } |
2316 | } | 2316 | } |
@@ -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 | ||