aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2010-11-24 16:19:24 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-11-24 16:19:24 -0500
commitd7a066c92394f3e777351de0c903beeb8a08af76 (patch)
treef54ce8ac77d32b4c3166b4a2ca92525174a3213b /drivers/net
parentccb14354017272ddac002e859a2711610b6af174 (diff)
parente476a5a41ad67d0e2b4a652820c49a3923eb936b (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9002_hw.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom_9287.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/hif_usb.c40
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_init.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_txrx.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c15
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c7
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c29
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c6
-rw-r--r--drivers/net/wireless/ath/ath9k/reg.h9
-rw-r--r--drivers/net/wireless/ath/carl9170/main.c2
-rw-r--r--drivers/net/wireless/ath/carl9170/usb.c8
-rw-r--r--drivers/net/wireless/b43/sdio.c1
-rw-r--r--drivers/net/wireless/ipw2x00/libipw_module.c9
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c3
-rw-r--r--drivers/net/wireless/libertas/cfg.c5
-rw-r--r--drivers/net/wireless/libertas/dev.h1
-rw-r--r--drivers/net/wireless/libertas/main.c7
20 files changed, 110 insertions, 43 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_hw.c b/drivers/net/wireless/ath/ath9k/ar9002_hw.c
index a0471f2e1c7a..48261b7252d0 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_hw.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_hw.c
@@ -410,6 +410,9 @@ static void ar9002_hw_configpcipowersave(struct ath_hw *ah,
410 val &= ~(AR_WA_BIT6 | AR_WA_BIT7); 410 val &= ~(AR_WA_BIT6 | AR_WA_BIT7);
411 } 411 }
412 412
413 if (AR_SREV_9280(ah))
414 val |= AR_WA_BIT22;
415
413 if (AR_SREV_9285E_20(ah)) 416 if (AR_SREV_9285E_20(ah))
414 val |= AR_WA_BIT23; 417 val |= AR_WA_BIT23;
415 418
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index be9c8d3b3337..6f90acc5cca7 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -657,6 +657,7 @@ static inline void ath_read_cachesize(struct ath_common *common, int *csz)
657} 657}
658 658
659extern struct ieee80211_ops ath9k_ops; 659extern struct ieee80211_ops ath9k_ops;
660extern struct pm_qos_request_list ath9k_pm_qos_req;
660extern int modparam_nohwcrypt; 661extern int modparam_nohwcrypt;
661extern int led_blink; 662extern int led_blink;
662 663
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_9287.c b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
index 34a588837d4d..e75697858ae8 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
@@ -37,7 +37,7 @@ static bool ath9k_hw_ar9287_fill_eeprom(struct ath_hw *ah)
37 int addr, eep_start_loc; 37 int addr, eep_start_loc;
38 eep_data = (u16 *)eep; 38 eep_data = (u16 *)eep;
39 39
40 if (ah->hw_version.devid == 0x7015) 40 if (AR9287_HTC_DEVID(ah))
41 eep_start_loc = AR9287_HTC_EEP_START_LOC; 41 eep_start_loc = AR9287_HTC_EEP_START_LOC;
42 else 42 else
43 eep_start_loc = AR9287_EEP_START_LOC; 43 eep_start_loc = AR9287_EEP_START_LOC;
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index 6576f683dba0..dfb6560dab92 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -35,8 +35,14 @@ static struct usb_device_id ath9k_hif_usb_ids[] = {
35 { USB_DEVICE(0x07D1, 0x3A10) }, /* Dlink Wireless 150 */ 35 { USB_DEVICE(0x07D1, 0x3A10) }, /* Dlink Wireless 150 */
36 { USB_DEVICE(0x13D3, 0x3327) }, /* Azurewave */ 36 { USB_DEVICE(0x13D3, 0x3327) }, /* Azurewave */
37 { USB_DEVICE(0x13D3, 0x3328) }, /* Azurewave */ 37 { USB_DEVICE(0x13D3, 0x3328) }, /* Azurewave */
38 { USB_DEVICE(0x13D3, 0x3346) }, /* IMC Networks */
39 { USB_DEVICE(0x13D3, 0x3348) }, /* Azurewave */
40 { USB_DEVICE(0x13D3, 0x3349) }, /* Azurewave */
41 { USB_DEVICE(0x13D3, 0x3350) }, /* Azurewave */
38 { USB_DEVICE(0x04CA, 0x4605) }, /* Liteon */ 42 { USB_DEVICE(0x04CA, 0x4605) }, /* Liteon */
39 { USB_DEVICE(0x083A, 0xA704) }, /* SMC Networks */ 43 { USB_DEVICE(0x083A, 0xA704) }, /* SMC Networks */
44 { USB_DEVICE(0x040D, 0x3801) }, /* VIA */
45 { USB_DEVICE(0x1668, 0x1200) }, /* Verizon */
40 { }, 46 { },
41}; 47};
42 48
@@ -540,11 +546,11 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb)
540 return; 546 return;
541 } 547 }
542 548
543 usb_fill_int_urb(urb, hif_dev->udev, 549 usb_fill_bulk_urb(urb, hif_dev->udev,
544 usb_rcvbulkpipe(hif_dev->udev, 550 usb_rcvbulkpipe(hif_dev->udev,
545 USB_REG_IN_PIPE), 551 USB_REG_IN_PIPE),
546 nskb->data, MAX_REG_IN_BUF_SIZE, 552 nskb->data, MAX_REG_IN_BUF_SIZE,
547 ath9k_hif_usb_reg_in_cb, nskb, 1); 553 ath9k_hif_usb_reg_in_cb, nskb);
548 554
549 ret = usb_submit_urb(urb, GFP_ATOMIC); 555 ret = usb_submit_urb(urb, GFP_ATOMIC);
550 if (ret) { 556 if (ret) {
@@ -720,11 +726,11 @@ static int ath9k_hif_usb_alloc_reg_in_urb(struct hif_device_usb *hif_dev)
720 if (!skb) 726 if (!skb)
721 goto err; 727 goto err;
722 728
723 usb_fill_int_urb(hif_dev->reg_in_urb, hif_dev->udev, 729 usb_fill_bulk_urb(hif_dev->reg_in_urb, hif_dev->udev,
724 usb_rcvbulkpipe(hif_dev->udev, 730 usb_rcvbulkpipe(hif_dev->udev,
725 USB_REG_IN_PIPE), 731 USB_REG_IN_PIPE),
726 skb->data, MAX_REG_IN_BUF_SIZE, 732 skb->data, MAX_REG_IN_BUF_SIZE,
727 ath9k_hif_usb_reg_in_cb, skb, 1); 733 ath9k_hif_usb_reg_in_cb, skb);
728 734
729 if (usb_submit_urb(hif_dev->reg_in_urb, GFP_KERNEL) != 0) 735 if (usb_submit_urb(hif_dev->reg_in_urb, GFP_KERNEL) != 0)
730 goto err; 736 goto err;
@@ -805,6 +811,8 @@ static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev)
805 case 0x7010: 811 case 0x7010:
806 case 0x7015: 812 case 0x7015:
807 case 0x9018: 813 case 0x9018:
814 case 0xA704:
815 case 0x1200:
808 firm_offset = AR7010_FIRMWARE_TEXT; 816 firm_offset = AR7010_FIRMWARE_TEXT;
809 break; 817 break;
810 default: 818 default:
@@ -843,14 +851,6 @@ static int ath9k_hif_usb_dev_init(struct hif_device_usb *hif_dev)
843 goto err_fw_req; 851 goto err_fw_req;
844 } 852 }
845 853
846 /* Alloc URBs */
847 ret = ath9k_hif_usb_alloc_urbs(hif_dev);
848 if (ret) {
849 dev_err(&hif_dev->udev->dev,
850 "ath9k_htc: Unable to allocate URBs\n");
851 goto err_urb;
852 }
853
854 /* Download firmware */ 854 /* Download firmware */
855 ret = ath9k_hif_usb_download_fw(hif_dev); 855 ret = ath9k_hif_usb_download_fw(hif_dev);
856 if (ret) { 856 if (ret) {
@@ -866,16 +866,22 @@ static int ath9k_hif_usb_dev_init(struct hif_device_usb *hif_dev)
866 */ 866 */
867 for (idx = 0; idx < alt->desc.bNumEndpoints; idx++) { 867 for (idx = 0; idx < alt->desc.bNumEndpoints; idx++) {
868 endp = &alt->endpoint[idx].desc; 868 endp = &alt->endpoint[idx].desc;
869 if (((endp->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK) 869 if ((endp->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
870 == 0x04) && 870 == USB_ENDPOINT_XFER_INT) {
871 ((endp->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
872 == USB_ENDPOINT_XFER_INT)) {
873 endp->bmAttributes &= ~USB_ENDPOINT_XFERTYPE_MASK; 871 endp->bmAttributes &= ~USB_ENDPOINT_XFERTYPE_MASK;
874 endp->bmAttributes |= USB_ENDPOINT_XFER_BULK; 872 endp->bmAttributes |= USB_ENDPOINT_XFER_BULK;
875 endp->bInterval = 0; 873 endp->bInterval = 0;
876 } 874 }
877 } 875 }
878 876
877 /* Alloc URBs */
878 ret = ath9k_hif_usb_alloc_urbs(hif_dev);
879 if (ret) {
880 dev_err(&hif_dev->udev->dev,
881 "ath9k_htc: Unable to allocate URBs\n");
882 goto err_urb;
883 }
884
879 return 0; 885 return 0;
880 886
881err_fw_download: 887err_fw_download:
@@ -929,6 +935,8 @@ static int ath9k_hif_usb_probe(struct usb_interface *interface,
929 case 0x7010: 935 case 0x7010:
930 case 0x7015: 936 case 0x7015:
931 case 0x9018: 937 case 0x9018:
938 case 0xA704:
939 case 0x1200:
932 if (le16_to_cpu(udev->descriptor.bcdDevice) == 0x0202) 940 if (le16_to_cpu(udev->descriptor.bcdDevice) == 0x0202)
933 hif_dev->fw_name = FIRMWARE_AR7010_1_1; 941 hif_dev->fw_name = FIRMWARE_AR7010_1_1;
934 else 942 else
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index f214e8e581ca..cba904a3e320 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -249,6 +249,8 @@ static int ath9k_init_htc_services(struct ath9k_htc_priv *priv, u16 devid)
249 case 0x7010: 249 case 0x7010:
250 case 0x7015: 250 case 0x7015:
251 case 0x9018: 251 case 0x9018:
252 case 0xA704:
253 case 0x1200:
252 priv->htc->credits = 45; 254 priv->htc->credits = 45;
253 break; 255 break;
254 default: 256 default:
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
index 5324ffd96ec7..77958675b55f 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
@@ -128,7 +128,7 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb)
128 tx_hdr.data_type = ATH9K_HTC_NORMAL; 128 tx_hdr.data_type = ATH9K_HTC_NORMAL;
129 } 129 }
130 130
131 if (ieee80211_is_data(fc)) { 131 if (ieee80211_is_data_qos(fc)) {
132 qc = ieee80211_get_qos_ctl(hdr); 132 qc = ieee80211_get_qos_ctl(hdr);
133 tx_hdr.tidno = qc[0] & IEEE80211_QOS_CTL_TID_MASK; 133 tx_hdr.tidno = qc[0] & IEEE80211_QOS_CTL_TID_MASK;
134 } 134 }
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index c686987c4840..ce9e59f4cd3d 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -479,6 +479,7 @@ static int ath9k_hw_post_init(struct ath_hw *ah)
479 ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL, 479 ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL,
480 "Failed allocating banks for " 480 "Failed allocating banks for "
481 "external radio\n"); 481 "external radio\n");
482 ath9k_hw_rf_free_ext_banks(ah);
482 return ecode; 483 return ecode;
483 } 484 }
484 485
@@ -947,9 +948,12 @@ static void ath9k_hw_set_operating_mode(struct ath_hw *ah, int opmode)
947 REG_SET_BIT(ah, AR_CFG, AR_CFG_AP_ADHOC_INDICATION); 948 REG_SET_BIT(ah, AR_CFG, AR_CFG_AP_ADHOC_INDICATION);
948 break; 949 break;
949 case NL80211_IFTYPE_STATION: 950 case NL80211_IFTYPE_STATION:
950 case NL80211_IFTYPE_MONITOR:
951 REG_WRITE(ah, AR_STA_ID1, val | AR_STA_ID1_KSRCH_MODE); 951 REG_WRITE(ah, AR_STA_ID1, val | AR_STA_ID1_KSRCH_MODE);
952 break; 952 break;
953 default:
954 if (ah->is_monitoring)
955 REG_WRITE(ah, AR_STA_ID1, val | AR_STA_ID1_KSRCH_MODE);
956 break;
953 } 957 }
954} 958}
955 959
@@ -1629,7 +1633,6 @@ void ath9k_hw_beaconinit(struct ath_hw *ah, u32 next_beacon, u32 beacon_period)
1629 1633
1630 switch (ah->opmode) { 1634 switch (ah->opmode) {
1631 case NL80211_IFTYPE_STATION: 1635 case NL80211_IFTYPE_STATION:
1632 case NL80211_IFTYPE_MONITOR:
1633 REG_WRITE(ah, AR_NEXT_TBTT_TIMER, TU_TO_USEC(next_beacon)); 1636 REG_WRITE(ah, AR_NEXT_TBTT_TIMER, TU_TO_USEC(next_beacon));
1634 REG_WRITE(ah, AR_NEXT_DMA_BEACON_ALERT, 0xffff); 1637 REG_WRITE(ah, AR_NEXT_DMA_BEACON_ALERT, 0xffff);
1635 REG_WRITE(ah, AR_NEXT_SWBA, 0x7ffff); 1638 REG_WRITE(ah, AR_NEXT_SWBA, 0x7ffff);
@@ -1658,6 +1661,14 @@ void ath9k_hw_beaconinit(struct ath_hw *ah, u32 next_beacon, u32 beacon_period)
1658 AR_TBTT_TIMER_EN | AR_DBA_TIMER_EN | AR_SWBA_TIMER_EN; 1661 AR_TBTT_TIMER_EN | AR_DBA_TIMER_EN | AR_SWBA_TIMER_EN;
1659 break; 1662 break;
1660 default: 1663 default:
1664 if (ah->is_monitoring) {
1665 REG_WRITE(ah, AR_NEXT_TBTT_TIMER,
1666 TU_TO_USEC(next_beacon));
1667 REG_WRITE(ah, AR_NEXT_DMA_BEACON_ALERT, 0xffff);
1668 REG_WRITE(ah, AR_NEXT_SWBA, 0x7ffff);
1669 flags |= AR_TBTT_TIMER_EN;
1670 break;
1671 }
1661 ath_print(ath9k_hw_common(ah), ATH_DBG_BEACON, 1672 ath_print(ath9k_hw_common(ah), ATH_DBG_BEACON,
1662 "%s: unsupported opmode: %d\n", 1673 "%s: unsupported opmode: %d\n",
1663 __func__, ah->opmode); 1674 __func__, ah->opmode);
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index d5e68347ef72..cc8f3b9af71f 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -665,6 +665,7 @@ struct ath_hw {
665 665
666 bool sw_mgmt_crypto; 666 bool sw_mgmt_crypto;
667 bool is_pciexpress; 667 bool is_pciexpress;
668 bool is_monitoring;
668 bool need_an_top2_fixup; 669 bool need_an_top2_fixup;
669 u16 tx_trig_level; 670 u16 tx_trig_level;
670 671
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index e7764ce881df..7eef1faee668 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -15,6 +15,7 @@
15 */ 15 */
16 16
17#include <linux/slab.h> 17#include <linux/slab.h>
18#include <linux/pm_qos_params.h>
18 19
19#include "ath9k.h" 20#include "ath9k.h"
20 21
@@ -179,6 +180,8 @@ static const struct ath_ops ath9k_common_ops = {
179 .write = ath9k_iowrite32, 180 .write = ath9k_iowrite32,
180}; 181};
181 182
183struct pm_qos_request_list ath9k_pm_qos_req;
184
182/**************************/ 185/**************************/
183/* Initialization */ 186/* Initialization */
184/**************************/ 187/**************************/
@@ -753,6 +756,9 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid,
753 ath_init_leds(sc); 756 ath_init_leds(sc);
754 ath_start_rfkill_poll(sc); 757 ath_start_rfkill_poll(sc);
755 758
759 pm_qos_add_request(&ath9k_pm_qos_req, PM_QOS_CPU_DMA_LATENCY,
760 PM_QOS_DEFAULT_VALUE);
761
756 return 0; 762 return 0;
757 763
758error_world: 764error_world:
@@ -821,6 +827,7 @@ void ath9k_deinit_device(struct ath_softc *sc)
821 } 827 }
822 828
823 ieee80211_unregister_hw(hw); 829 ieee80211_unregister_hw(hw);
830 pm_qos_remove_request(&ath9k_pm_qos_req);
824 ath_rx_cleanup(sc); 831 ath_rx_cleanup(sc);
825 ath_tx_cleanup(sc); 832 ath_tx_cleanup(sc);
826 ath9k_deinit_softc(sc); 833 ath9k_deinit_softc(sc);
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index dede9a9aa689..50bdb5db23b4 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -15,6 +15,7 @@
15 */ 15 */
16 16
17#include <linux/nl80211.h> 17#include <linux/nl80211.h>
18#include <linux/pm_qos_params.h>
18#include "ath9k.h" 19#include "ath9k.h"
19#include "btcoex.h" 20#include "btcoex.h"
20 21
@@ -93,11 +94,13 @@ void ath9k_ps_wakeup(struct ath_softc *sc)
93{ 94{
94 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 95 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
95 unsigned long flags; 96 unsigned long flags;
97 enum ath9k_power_mode power_mode;
96 98
97 spin_lock_irqsave(&sc->sc_pm_lock, flags); 99 spin_lock_irqsave(&sc->sc_pm_lock, flags);
98 if (++sc->ps_usecount != 1) 100 if (++sc->ps_usecount != 1)
99 goto unlock; 101 goto unlock;
100 102
103 power_mode = sc->sc_ah->power_mode;
101 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE); 104 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE);
102 105
103 /* 106 /*
@@ -105,10 +108,12 @@ void ath9k_ps_wakeup(struct ath_softc *sc)
105 * useful data. Better clear them now so that they don't mess up 108 * useful data. Better clear them now so that they don't mess up
106 * survey data results. 109 * survey data results.
107 */ 110 */
108 spin_lock(&common->cc_lock); 111 if (power_mode != ATH9K_PM_AWAKE) {
109 ath_hw_cycle_counters_update(common); 112 spin_lock(&common->cc_lock);
110 memset(&common->cc_survey, 0, sizeof(common->cc_survey)); 113 ath_hw_cycle_counters_update(common);
111 spin_unlock(&common->cc_lock); 114 memset(&common->cc_survey, 0, sizeof(common->cc_survey));
115 spin_unlock(&common->cc_lock);
116 }
112 117
113 unlock: 118 unlock:
114 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); 119 spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
@@ -1157,6 +1162,7 @@ static int ath9k_start(struct ieee80211_hw *hw)
1157 ah->imask |= ATH9K_INT_CST; 1162 ah->imask |= ATH9K_INT_CST;
1158 1163
1159 sc->sc_flags &= ~SC_OP_INVALID; 1164 sc->sc_flags &= ~SC_OP_INVALID;
1165 sc->sc_ah->is_monitoring = false;
1160 1166
1161 /* Disable BMISS interrupt when we're not associated */ 1167 /* Disable BMISS interrupt when we're not associated */
1162 ah->imask &= ~(ATH9K_INT_SWBA | ATH9K_INT_BMISS); 1168 ah->imask &= ~(ATH9K_INT_SWBA | ATH9K_INT_BMISS);
@@ -1178,6 +1184,8 @@ static int ath9k_start(struct ieee80211_hw *hw)
1178 ath9k_btcoex_timer_resume(sc); 1184 ath9k_btcoex_timer_resume(sc);
1179 } 1185 }
1180 1186
1187 pm_qos_update_request(&ath9k_pm_qos_req, 55);
1188
1181mutex_unlock: 1189mutex_unlock:
1182 mutex_unlock(&sc->mutex); 1190 mutex_unlock(&sc->mutex);
1183 1191
@@ -1331,6 +1339,8 @@ static void ath9k_stop(struct ieee80211_hw *hw)
1331 1339
1332 sc->sc_flags |= SC_OP_INVALID; 1340 sc->sc_flags |= SC_OP_INVALID;
1333 1341
1342 pm_qos_update_request(&ath9k_pm_qos_req, PM_QOS_DEFAULT_VALUE);
1343
1334 mutex_unlock(&sc->mutex); 1344 mutex_unlock(&sc->mutex);
1335 1345
1336 ath_print(common, ATH_DBG_CONFIG, "Driver halt\n"); 1346 ath_print(common, ATH_DBG_CONFIG, "Driver halt\n");
@@ -1409,8 +1419,7 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
1409 ath9k_hw_set_interrupts(ah, ah->imask); 1419 ath9k_hw_set_interrupts(ah, ah->imask);
1410 1420
1411 if (vif->type == NL80211_IFTYPE_AP || 1421 if (vif->type == NL80211_IFTYPE_AP ||
1412 vif->type == NL80211_IFTYPE_ADHOC || 1422 vif->type == NL80211_IFTYPE_ADHOC) {
1413 vif->type == NL80211_IFTYPE_MONITOR) {
1414 sc->sc_flags |= SC_OP_ANI_RUN; 1423 sc->sc_flags |= SC_OP_ANI_RUN;
1415 ath_start_ani(common); 1424 ath_start_ani(common);
1416 } 1425 }
@@ -1560,8 +1569,12 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
1560 if (changed & IEEE80211_CONF_CHANGE_MONITOR) { 1569 if (changed & IEEE80211_CONF_CHANGE_MONITOR) {
1561 if (conf->flags & IEEE80211_CONF_MONITOR) { 1570 if (conf->flags & IEEE80211_CONF_MONITOR) {
1562 ath_print(common, ATH_DBG_CONFIG, 1571 ath_print(common, ATH_DBG_CONFIG,
1563 "HW opmode set to Monitor mode\n"); 1572 "Monitor mode is enabled\n");
1564 sc->sc_ah->opmode = NL80211_IFTYPE_MONITOR; 1573 sc->sc_ah->is_monitoring = true;
1574 } else {
1575 ath_print(common, ATH_DBG_CONFIG,
1576 "Monitor mode is disabled\n");
1577 sc->sc_ah->is_monitoring = false;
1565 } 1578 }
1566 } 1579 }
1567 1580
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 60300b225b6d..262c81595f6d 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -441,7 +441,7 @@ u32 ath_calcrxfilter(struct ath_softc *sc)
441 */ 441 */
442 if (((sc->sc_ah->opmode != NL80211_IFTYPE_AP) && 442 if (((sc->sc_ah->opmode != NL80211_IFTYPE_AP) &&
443 (sc->rx.rxfilter & FIF_PROMISC_IN_BSS)) || 443 (sc->rx.rxfilter & FIF_PROMISC_IN_BSS)) ||
444 (sc->sc_ah->opmode == NL80211_IFTYPE_MONITOR)) 444 (sc->sc_ah->is_monitoring))
445 rfilt |= ATH9K_RX_FILTER_PROM; 445 rfilt |= ATH9K_RX_FILTER_PROM;
446 446
447 if (sc->rx.rxfilter & FIF_CONTROL) 447 if (sc->rx.rxfilter & FIF_CONTROL)
@@ -518,7 +518,7 @@ bool ath_stoprecv(struct ath_softc *sc)
518 bool stopped; 518 bool stopped;
519 519
520 spin_lock_bh(&sc->rx.rxbuflock); 520 spin_lock_bh(&sc->rx.rxbuflock);
521 ath9k_hw_stoppcurecv(ah); 521 ath9k_hw_abortpcurecv(ah);
522 ath9k_hw_setrxfilter(ah, 0); 522 ath9k_hw_setrxfilter(ah, 0);
523 stopped = ath9k_hw_stopdmarecv(ah); 523 stopped = ath9k_hw_stopdmarecv(ah);
524 524
@@ -899,7 +899,7 @@ static bool ath9k_rx_accept(struct ath_common *common,
899 * decryption and MIC failures. For monitor mode, 899 * decryption and MIC failures. For monitor mode,
900 * we also ignore the CRC error. 900 * we also ignore the CRC error.
901 */ 901 */
902 if (ah->opmode == NL80211_IFTYPE_MONITOR) { 902 if (ah->is_monitoring) {
903 if (rx_stats->rs_status & 903 if (rx_stats->rs_status &
904 ~(ATH9K_RXERR_DECRYPT | ATH9K_RXERR_MIC | 904 ~(ATH9K_RXERR_DECRYPT | ATH9K_RXERR_MIC |
905 ATH9K_RXERR_CRC)) 905 ATH9K_RXERR_CRC))
diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h
index f6058b439fb3..f1bbc7560c86 100644
--- a/drivers/net/wireless/ath/ath9k/reg.h
+++ b/drivers/net/wireless/ath/ath9k/reg.h
@@ -703,6 +703,7 @@
703#define AR_WA_RESET_EN (1 << 18) /* Sw Control to enable PCI-Reset to POR (bit 15) */ 703#define AR_WA_RESET_EN (1 << 18) /* Sw Control to enable PCI-Reset to POR (bit 15) */
704#define AR_WA_ANALOG_SHIFT (1 << 20) 704#define AR_WA_ANALOG_SHIFT (1 << 20)
705#define AR_WA_POR_SHORT (1 << 21) /* PCI-E Phy reset control */ 705#define AR_WA_POR_SHORT (1 << 21) /* PCI-E Phy reset control */
706#define AR_WA_BIT22 (1 << 22)
706#define AR9285_WA_DEFAULT 0x004a050b 707#define AR9285_WA_DEFAULT 0x004a050b
707#define AR9280_WA_DEFAULT 0x0040073b 708#define AR9280_WA_DEFAULT 0x0040073b
708#define AR_WA_DEFAULT 0x0000073f 709#define AR_WA_DEFAULT 0x0000073f
@@ -865,7 +866,13 @@
865#define AR_DEVID_7010(_ah) \ 866#define AR_DEVID_7010(_ah) \
866 (((_ah)->hw_version.devid == 0x7010) || \ 867 (((_ah)->hw_version.devid == 0x7010) || \
867 ((_ah)->hw_version.devid == 0x7015) || \ 868 ((_ah)->hw_version.devid == 0x7015) || \
868 ((_ah)->hw_version.devid == 0x9018)) 869 ((_ah)->hw_version.devid == 0x9018) || \
870 ((_ah)->hw_version.devid == 0xA704) || \
871 ((_ah)->hw_version.devid == 0x1200))
872
873#define AR9287_HTC_DEVID(_ah) \
874 (((_ah)->hw_version.devid == 0x7015) || \
875 ((_ah)->hw_version.devid == 0x1200))
869 876
870#define AR_RADIO_SREV_MAJOR 0xf0 877#define AR_RADIO_SREV_MAJOR 0xf0
871#define AR_RAD5133_SREV_MAJOR 0xc0 878#define AR_RAD5133_SREV_MAJOR 0xc0
diff --git a/drivers/net/wireless/ath/carl9170/main.c b/drivers/net/wireless/ath/carl9170/main.c
index 4ae6a5849076..511dbe3caf58 100644
--- a/drivers/net/wireless/ath/carl9170/main.c
+++ b/drivers/net/wireless/ath/carl9170/main.c
@@ -663,7 +663,7 @@ init:
663 } 663 }
664 664
665unlock: 665unlock:
666 if (err && (vif_id != -1)) { 666 if (err && (vif_id >= 0)) {
667 vif_priv->active = false; 667 vif_priv->active = false;
668 bitmap_release_region(&ar->vif_bitmap, vif_id, 0); 668 bitmap_release_region(&ar->vif_bitmap, vif_id, 0);
669 ar->vifs--; 669 ar->vifs--;
diff --git a/drivers/net/wireless/ath/carl9170/usb.c b/drivers/net/wireless/ath/carl9170/usb.c
index ddf5373ee689..a268053e18e5 100644
--- a/drivers/net/wireless/ath/carl9170/usb.c
+++ b/drivers/net/wireless/ath/carl9170/usb.c
@@ -82,9 +82,11 @@ static struct usb_device_id carl9170_usb_ids[] = {
82 { USB_DEVICE(0x07d1, 0x3c10) }, 82 { USB_DEVICE(0x07d1, 0x3c10) },
83 /* D-Link DWA 160 A2 */ 83 /* D-Link DWA 160 A2 */
84 { USB_DEVICE(0x07d1, 0x3a09) }, 84 { USB_DEVICE(0x07d1, 0x3a09) },
85 /* D-Link DWA 130 D */
86 { USB_DEVICE(0x07d1, 0x3a0f) },
85 /* Netgear WNA1000 */ 87 /* Netgear WNA1000 */
86 { USB_DEVICE(0x0846, 0x9040) }, 88 { USB_DEVICE(0x0846, 0x9040) },
87 /* Netgear WNDA3100 */ 89 /* Netgear WNDA3100 (v1) */
88 { USB_DEVICE(0x0846, 0x9010) }, 90 { USB_DEVICE(0x0846, 0x9010) },
89 /* Netgear WN111 v2 */ 91 /* Netgear WN111 v2 */
90 { USB_DEVICE(0x0846, 0x9001), .driver_info = CARL9170_ONE_LED }, 92 { USB_DEVICE(0x0846, 0x9001), .driver_info = CARL9170_ONE_LED },
@@ -551,12 +553,12 @@ static int carl9170_usb_flush(struct ar9170 *ar)
551 usb_free_urb(urb); 553 usb_free_urb(urb);
552 } 554 }
553 555
554 ret = usb_wait_anchor_empty_timeout(&ar->tx_cmd, HZ); 556 ret = usb_wait_anchor_empty_timeout(&ar->tx_cmd, 1000);
555 if (ret == 0) 557 if (ret == 0)
556 err = -ETIMEDOUT; 558 err = -ETIMEDOUT;
557 559
558 /* lets wait a while until the tx - queues are dried out */ 560 /* lets wait a while until the tx - queues are dried out */
559 ret = usb_wait_anchor_empty_timeout(&ar->tx_anch, HZ); 561 ret = usb_wait_anchor_empty_timeout(&ar->tx_anch, 1000);
560 if (ret == 0) 562 if (ret == 0)
561 err = -ETIMEDOUT; 563 err = -ETIMEDOUT;
562 564
diff --git a/drivers/net/wireless/b43/sdio.c b/drivers/net/wireless/b43/sdio.c
index 9a55338d957f..09e2dfd7b175 100644
--- a/drivers/net/wireless/b43/sdio.c
+++ b/drivers/net/wireless/b43/sdio.c
@@ -163,6 +163,7 @@ static int b43_sdio_probe(struct sdio_func *func,
163err_free_ssb: 163err_free_ssb:
164 kfree(sdio); 164 kfree(sdio);
165err_disable_func: 165err_disable_func:
166 sdio_claim_host(func);
166 sdio_disable_func(func); 167 sdio_disable_func(func);
167err_release_host: 168err_release_host:
168 sdio_release_host(func); 169 sdio_release_host(func);
diff --git a/drivers/net/wireless/ipw2x00/libipw_module.c b/drivers/net/wireless/ipw2x00/libipw_module.c
index 32dee2ce5d31..d5ef696298ee 100644
--- a/drivers/net/wireless/ipw2x00/libipw_module.c
+++ b/drivers/net/wireless/ipw2x00/libipw_module.c
@@ -54,6 +54,7 @@
54 54
55#define DRV_DESCRIPTION "802.11 data/management/control stack" 55#define DRV_DESCRIPTION "802.11 data/management/control stack"
56#define DRV_NAME "libipw" 56#define DRV_NAME "libipw"
57#define DRV_PROCNAME "ieee80211"
57#define DRV_VERSION LIBIPW_VERSION 58#define DRV_VERSION LIBIPW_VERSION
58#define DRV_COPYRIGHT "Copyright (C) 2004-2005 Intel Corporation <jketreno@linux.intel.com>" 59#define DRV_COPYRIGHT "Copyright (C) 2004-2005 Intel Corporation <jketreno@linux.intel.com>"
59 60
@@ -293,16 +294,16 @@ static int __init libipw_init(void)
293 struct proc_dir_entry *e; 294 struct proc_dir_entry *e;
294 295
295 libipw_debug_level = debug; 296 libipw_debug_level = debug;
296 libipw_proc = proc_mkdir("ieee80211", init_net.proc_net); 297 libipw_proc = proc_mkdir(DRV_PROCNAME, init_net.proc_net);
297 if (libipw_proc == NULL) { 298 if (libipw_proc == NULL) {
298 LIBIPW_ERROR("Unable to create " DRV_NAME 299 LIBIPW_ERROR("Unable to create " DRV_PROCNAME
299 " proc directory\n"); 300 " proc directory\n");
300 return -EIO; 301 return -EIO;
301 } 302 }
302 e = proc_create("debug_level", S_IRUGO | S_IWUSR, libipw_proc, 303 e = proc_create("debug_level", S_IRUGO | S_IWUSR, libipw_proc,
303 &debug_level_proc_fops); 304 &debug_level_proc_fops);
304 if (!e) { 305 if (!e) {
305 remove_proc_entry(DRV_NAME, init_net.proc_net); 306 remove_proc_entry(DRV_PROCNAME, init_net.proc_net);
306 libipw_proc = NULL; 307 libipw_proc = NULL;
307 return -EIO; 308 return -EIO;
308 } 309 }
@@ -319,7 +320,7 @@ static void __exit libipw_exit(void)
319#ifdef CONFIG_LIBIPW_DEBUG 320#ifdef CONFIG_LIBIPW_DEBUG
320 if (libipw_proc) { 321 if (libipw_proc) {
321 remove_proc_entry("debug_level", libipw_proc); 322 remove_proc_entry("debug_level", libipw_proc);
322 remove_proc_entry(DRV_NAME, init_net.proc_net); 323 remove_proc_entry(DRV_PROCNAME, init_net.proc_net);
323 libipw_proc = NULL; 324 libipw_proc = NULL;
324 } 325 }
325#endif /* CONFIG_LIBIPW_DEBUG */ 326#endif /* CONFIG_LIBIPW_DEBUG */
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index c3ebc04cbd00..8eb1393506bc 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -3997,7 +3997,8 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
3997 * "the hard way", rather than using device's scan. 3997 * "the hard way", rather than using device's scan.
3998 */ 3998 */
3999 if (iwl3945_mod_params.disable_hw_scan) { 3999 if (iwl3945_mod_params.disable_hw_scan) {
4000 IWL_ERR(priv, "sw scan support is deprecated\n"); 4000 dev_printk(KERN_DEBUG, &(pdev->dev),
4001 "sw scan support is deprecated\n");
4001 iwl3945_hw_ops.hw_scan = NULL; 4002 iwl3945_hw_ops.hw_scan = NULL;
4002 } 4003 }
4003 4004
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
index a90953678b99..dee32d3681a5 100644
--- a/drivers/net/wireless/libertas/cfg.c
+++ b/drivers/net/wireless/libertas/cfg.c
@@ -698,8 +698,9 @@ static void lbs_scan_worker(struct work_struct *work)
698 698
699 if (priv->scan_channel < priv->scan_req->n_channels) { 699 if (priv->scan_channel < priv->scan_req->n_channels) {
700 cancel_delayed_work(&priv->scan_work); 700 cancel_delayed_work(&priv->scan_work);
701 queue_delayed_work(priv->work_thread, &priv->scan_work, 701 if (!priv->stopping)
702 msecs_to_jiffies(300)); 702 queue_delayed_work(priv->work_thread, &priv->scan_work,
703 msecs_to_jiffies(300));
703 } 704 }
704 705
705 /* This is the final data we are about to send */ 706 /* This is the final data we are about to send */
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
index f5a9851fc7ee..18dd9a02c459 100644
--- a/drivers/net/wireless/libertas/dev.h
+++ b/drivers/net/wireless/libertas/dev.h
@@ -36,6 +36,7 @@ struct lbs_private {
36 /* CFG80211 */ 36 /* CFG80211 */
37 struct wireless_dev *wdev; 37 struct wireless_dev *wdev;
38 bool wiphy_registered; 38 bool wiphy_registered;
39 bool stopping;
39 struct cfg80211_scan_request *scan_req; 40 struct cfg80211_scan_request *scan_req;
40 u8 assoc_bss[ETH_ALEN]; 41 u8 assoc_bss[ETH_ALEN];
41 u8 disassoc_reason; 42 u8 disassoc_reason;
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 6d7af91d52c2..143473c59393 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -104,6 +104,7 @@ static int lbs_dev_open(struct net_device *dev)
104 lbs_deb_enter(LBS_DEB_NET); 104 lbs_deb_enter(LBS_DEB_NET);
105 105
106 spin_lock_irq(&priv->driver_lock); 106 spin_lock_irq(&priv->driver_lock);
107 priv->stopping = false;
107 108
108 if (priv->connect_status == LBS_CONNECTED) 109 if (priv->connect_status == LBS_CONNECTED)
109 netif_carrier_on(dev); 110 netif_carrier_on(dev);
@@ -131,10 +132,16 @@ static int lbs_eth_stop(struct net_device *dev)
131 lbs_deb_enter(LBS_DEB_NET); 132 lbs_deb_enter(LBS_DEB_NET);
132 133
133 spin_lock_irq(&priv->driver_lock); 134 spin_lock_irq(&priv->driver_lock);
135 priv->stopping = true;
134 netif_stop_queue(dev); 136 netif_stop_queue(dev);
135 spin_unlock_irq(&priv->driver_lock); 137 spin_unlock_irq(&priv->driver_lock);
136 138
137 schedule_work(&priv->mcast_work); 139 schedule_work(&priv->mcast_work);
140 cancel_delayed_work_sync(&priv->scan_work);
141 if (priv->scan_req) {
142 cfg80211_scan_done(priv->scan_req, false);
143 priv->scan_req = NULL;
144 }
138 145
139 lbs_deb_leave(LBS_DEB_NET); 146 lbs_deb_leave(LBS_DEB_NET);
140 return 0; 147 return 0;