diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/wireless/airo.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/wireless/airo.c')
-rw-r--r-- | drivers/net/wireless/airo.c | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index abf896a7390e..dc5018a6d9ed 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -51,13 +51,14 @@ | |||
51 | #include <linux/freezer.h> | 51 | #include <linux/freezer.h> |
52 | 52 | ||
53 | #include <linux/ieee80211.h> | 53 | #include <linux/ieee80211.h> |
54 | #include <net/iw_handler.h> | ||
54 | 55 | ||
55 | #include "airo.h" | 56 | #include "airo.h" |
56 | 57 | ||
57 | #define DRV_NAME "airo" | 58 | #define DRV_NAME "airo" |
58 | 59 | ||
59 | #ifdef CONFIG_PCI | 60 | #ifdef CONFIG_PCI |
60 | static struct pci_device_id card_ids[] = { | 61 | static DEFINE_PCI_DEVICE_TABLE(card_ids) = { |
61 | { 0x14b9, 1, PCI_ANY_ID, PCI_ANY_ID, }, | 62 | { 0x14b9, 1, PCI_ANY_ID, PCI_ANY_ID, }, |
62 | { 0x14b9, 0x4500, PCI_ANY_ID, PCI_ANY_ID }, | 63 | { 0x14b9, 0x4500, PCI_ANY_ID, PCI_ANY_ID }, |
63 | { 0x14b9, 0x4800, PCI_ANY_ID, PCI_ANY_ID, }, | 64 | { 0x14b9, 0x4800, PCI_ANY_ID, PCI_ANY_ID, }, |
@@ -2310,7 +2311,7 @@ static void airo_set_multicast_list(struct net_device *dev) { | |||
2310 | airo_set_promisc(ai); | 2311 | airo_set_promisc(ai); |
2311 | } | 2312 | } |
2312 | 2313 | ||
2313 | if ((dev->flags&IFF_ALLMULTI)||dev->mc_count>0) { | 2314 | if ((dev->flags&IFF_ALLMULTI) || !netdev_mc_empty(dev)) { |
2314 | /* Turn on multicast. (Should be already setup...) */ | 2315 | /* Turn on multicast. (Should be already setup...) */ |
2315 | } | 2316 | } |
2316 | } | 2317 | } |
@@ -4806,7 +4807,7 @@ static int airo_config_commit(struct net_device *dev, | |||
4806 | 4807 | ||
4807 | static inline int sniffing_mode(struct airo_info *ai) | 4808 | static inline int sniffing_mode(struct airo_info *ai) |
4808 | { | 4809 | { |
4809 | return le16_to_cpu(ai->config.rmode & RXMODE_MASK) >= | 4810 | return (le16_to_cpu(ai->config.rmode) & le16_to_cpu(RXMODE_MASK)) >= |
4810 | le16_to_cpu(RXMODE_RFMON); | 4811 | le16_to_cpu(RXMODE_RFMON); |
4811 | } | 4812 | } |
4812 | 4813 | ||
@@ -5254,11 +5255,8 @@ static int set_wep_key(struct airo_info *ai, u16 index, const char *key, | |||
5254 | WepKeyRid wkr; | 5255 | WepKeyRid wkr; |
5255 | int rc; | 5256 | int rc; |
5256 | 5257 | ||
5257 | if (keylen == 0) { | 5258 | if (WARN_ON(keylen == 0)) |
5258 | airo_print_err(ai->dev->name, "%s: key length to set was zero", | ||
5259 | __func__); | ||
5260 | return -1; | 5259 | return -1; |
5261 | } | ||
5262 | 5260 | ||
5263 | memset(&wkr, 0, sizeof(wkr)); | 5261 | memset(&wkr, 0, sizeof(wkr)); |
5264 | wkr.len = cpu_to_le16(sizeof(wkr)); | 5262 | wkr.len = cpu_to_le16(sizeof(wkr)); |
@@ -5659,7 +5657,8 @@ static int airo_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
5659 | 5657 | ||
5660 | pci_enable_wake(pdev, pci_choose_state(pdev, state), 1); | 5658 | pci_enable_wake(pdev, pci_choose_state(pdev, state), 1); |
5661 | pci_save_state(pdev); | 5659 | pci_save_state(pdev); |
5662 | return pci_set_power_state(pdev, pci_choose_state(pdev, state)); | 5660 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); |
5661 | return 0; | ||
5663 | } | 5662 | } |
5664 | 5663 | ||
5665 | static int airo_pci_resume(struct pci_dev *pdev) | 5664 | static int airo_pci_resume(struct pci_dev *pdev) |
@@ -6404,11 +6403,7 @@ static int airo_set_encode(struct net_device *dev, | |||
6404 | if (dwrq->length > MIN_KEY_SIZE) | 6403 | if (dwrq->length > MIN_KEY_SIZE) |
6405 | key.len = MAX_KEY_SIZE; | 6404 | key.len = MAX_KEY_SIZE; |
6406 | else | 6405 | else |
6407 | if (dwrq->length > 0) | 6406 | key.len = MIN_KEY_SIZE; |
6408 | key.len = MIN_KEY_SIZE; | ||
6409 | else | ||
6410 | /* Disable the key */ | ||
6411 | key.len = 0; | ||
6412 | /* Check if the key is not marked as invalid */ | 6407 | /* Check if the key is not marked as invalid */ |
6413 | if(!(dwrq->flags & IW_ENCODE_NOKEY)) { | 6408 | if(!(dwrq->flags & IW_ENCODE_NOKEY)) { |
6414 | /* Cleanup */ | 6409 | /* Cleanup */ |
@@ -6589,12 +6584,22 @@ static int airo_set_encodeext(struct net_device *dev, | |||
6589 | default: | 6584 | default: |
6590 | return -EINVAL; | 6585 | return -EINVAL; |
6591 | } | 6586 | } |
6592 | /* Send the key to the card */ | 6587 | if (key.len == 0) { |
6593 | rc = set_wep_key(local, idx, key.key, key.len, perm, 1); | 6588 | rc = set_wep_tx_idx(local, idx, perm, 1); |
6594 | if (rc < 0) { | 6589 | if (rc < 0) { |
6595 | airo_print_err(local->dev->name, "failed to set WEP key" | 6590 | airo_print_err(local->dev->name, |
6596 | " at index %d: %d.", idx, rc); | 6591 | "failed to set WEP transmit index to %d: %d.", |
6597 | return rc; | 6592 | idx, rc); |
6593 | return rc; | ||
6594 | } | ||
6595 | } else { | ||
6596 | rc = set_wep_key(local, idx, key.key, key.len, perm, 1); | ||
6597 | if (rc < 0) { | ||
6598 | airo_print_err(local->dev->name, | ||
6599 | "failed to set WEP key at index %d: %d.", | ||
6600 | idx, rc); | ||
6601 | return rc; | ||
6602 | } | ||
6598 | } | 6603 | } |
6599 | } | 6604 | } |
6600 | 6605 | ||