aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/bluetooth/btusb.c5
-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
-rw-r--r--drivers/ssb/b43_pci_bridge.c1
-rw-r--r--include/linux/pci_ids.h1
-rw-r--r--include/net/cfg80211.h2
-rw-r--r--include/net/dst_ops.h1
-rw-r--r--net/bluetooth/hci_event.c6
-rw-r--r--net/bluetooth/hidp/Kconfig2
-rw-r--r--net/bluetooth/l2cap.c8
-rw-r--r--net/bluetooth/rfcomm/core.c13
-rw-r--r--net/mac80211/iface.c6
-rw-r--r--net/wireless/chan.c54
-rw-r--r--net/wireless/nl80211.c4
32 files changed, 199 insertions, 57 deletions
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index d120a5c1c093..ab3894f742c3 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -68,6 +68,9 @@ static struct usb_device_id btusb_table[] = {
68 /* Apple MacBookPro6,2 */ 68 /* Apple MacBookPro6,2 */
69 { USB_DEVICE(0x05ac, 0x8218) }, 69 { USB_DEVICE(0x05ac, 0x8218) },
70 70
71 /* Apple MacBookAir3,1, MacBookAir3,2 */
72 { USB_DEVICE(0x05ac, 0x821b) },
73
71 /* AVM BlueFRITZ! USB v2.0 */ 74 /* AVM BlueFRITZ! USB v2.0 */
72 { USB_DEVICE(0x057c, 0x3800) }, 75 { USB_DEVICE(0x057c, 0x3800) },
73 76
@@ -1029,6 +1032,8 @@ static int btusb_probe(struct usb_interface *intf,
1029 1032
1030 usb_set_intfdata(intf, data); 1033 usb_set_intfdata(intf, data);
1031 1034
1035 usb_enable_autosuspend(interface_to_usbdev(intf));
1036
1032 return 0; 1037 return 0;
1033} 1038}
1034 1039
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;
diff --git a/drivers/ssb/b43_pci_bridge.c b/drivers/ssb/b43_pci_bridge.c
index ef9c6a04ad8f..744d3f6e4709 100644
--- a/drivers/ssb/b43_pci_bridge.c
+++ b/drivers/ssb/b43_pci_bridge.c
@@ -24,6 +24,7 @@ static const struct pci_device_id b43_pci_bridge_tbl[] = {
24 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4312) }, 24 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4312) },
25 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4315) }, 25 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4315) },
26 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4318) }, 26 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4318) },
27 { PCI_DEVICE(PCI_VENDOR_ID_BCM_GVC, 0x4318) },
27 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4319) }, 28 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4319) },
28 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4320) }, 29 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4320) },
29 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4321) }, 30 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4321) },
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index c6bcfe93b9ca..32bd56949604 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2047,6 +2047,7 @@
2047#define PCI_DEVICE_ID_AFAVLAB_P030 0x2182 2047#define PCI_DEVICE_ID_AFAVLAB_P030 0x2182
2048#define PCI_SUBDEVICE_ID_AFAVLAB_P061 0x2150 2048#define PCI_SUBDEVICE_ID_AFAVLAB_P061 0x2150
2049 2049
2050#define PCI_VENDOR_ID_BCM_GVC 0x14a4
2050#define PCI_VENDOR_ID_BROADCOM 0x14e4 2051#define PCI_VENDOR_ID_BROADCOM 0x14e4
2051#define PCI_DEVICE_ID_TIGON3_5752 0x1600 2052#define PCI_DEVICE_ID_TIGON3_5752 0x1600
2052#define PCI_DEVICE_ID_TIGON3_5752M 0x1601 2053#define PCI_DEVICE_ID_TIGON3_5752M 0x1601
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 8fd9eebd0cc9..91f099556ac1 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1361,7 +1361,7 @@ enum wiphy_flags {
1361 WIPHY_FLAG_4ADDR_AP = BIT(5), 1361 WIPHY_FLAG_4ADDR_AP = BIT(5),
1362 WIPHY_FLAG_4ADDR_STATION = BIT(6), 1362 WIPHY_FLAG_4ADDR_STATION = BIT(6),
1363 WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7), 1363 WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7),
1364 WIPHY_FLAG_IBSS_RSN = BIT(7), 1364 WIPHY_FLAG_IBSS_RSN = BIT(8),
1365}; 1365};
1366 1366
1367struct mac_address { 1367struct mac_address {
diff --git a/include/net/dst_ops.h b/include/net/dst_ops.h
index 1fa5306e3e23..51665b3461b8 100644
--- a/include/net/dst_ops.h
+++ b/include/net/dst_ops.h
@@ -2,6 +2,7 @@
2#define _NET_DST_OPS_H 2#define _NET_DST_OPS_H
3#include <linux/types.h> 3#include <linux/types.h>
4#include <linux/percpu_counter.h> 4#include <linux/percpu_counter.h>
5#include <linux/cache.h>
5 6
6struct dst_entry; 7struct dst_entry;
7struct kmem_cachep; 8struct kmem_cachep;
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index bfef5bae0b3a..84093b0000b9 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1175,6 +1175,12 @@ static inline void hci_remote_features_evt(struct hci_dev *hdev, struct sk_buff
1175 hci_send_cmd(hdev, 1175 hci_send_cmd(hdev,
1176 HCI_OP_READ_REMOTE_EXT_FEATURES, 1176 HCI_OP_READ_REMOTE_EXT_FEATURES,
1177 sizeof(cp), &cp); 1177 sizeof(cp), &cp);
1178 } else if (!ev->status && conn->out &&
1179 conn->sec_level == BT_SECURITY_HIGH) {
1180 struct hci_cp_auth_requested cp;
1181 cp.handle = ev->handle;
1182 hci_send_cmd(hdev, HCI_OP_AUTH_REQUESTED,
1183 sizeof(cp), &cp);
1178 } else { 1184 } else {
1179 conn->state = BT_CONNECTED; 1185 conn->state = BT_CONNECTED;
1180 hci_proto_connect_cfm(conn, ev->status); 1186 hci_proto_connect_cfm(conn, ev->status);
diff --git a/net/bluetooth/hidp/Kconfig b/net/bluetooth/hidp/Kconfig
index 98fdfa1fbddd..86a91543172a 100644
--- a/net/bluetooth/hidp/Kconfig
+++ b/net/bluetooth/hidp/Kconfig
@@ -1,6 +1,6 @@
1config BT_HIDP 1config BT_HIDP
2 tristate "HIDP protocol support" 2 tristate "HIDP protocol support"
3 depends on BT && BT_L2CAP && INPUT 3 depends on BT && BT_L2CAP && INPUT && HID_SUPPORT
4 select HID 4 select HID
5 help 5 help
6 HIDP (Human Interface Device Protocol) is a transport layer 6 HIDP (Human Interface Device Protocol) is a transport layer
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index daa7a988d9a6..cd8f6ea03841 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -2421,11 +2421,11 @@ static inline int l2cap_get_conf_opt(void **ptr, int *type, int *olen, unsigned
2421 break; 2421 break;
2422 2422
2423 case 2: 2423 case 2:
2424 *val = __le16_to_cpu(*((__le16 *) opt->val)); 2424 *val = get_unaligned_le16(opt->val);
2425 break; 2425 break;
2426 2426
2427 case 4: 2427 case 4:
2428 *val = __le32_to_cpu(*((__le32 *) opt->val)); 2428 *val = get_unaligned_le32(opt->val);
2429 break; 2429 break;
2430 2430
2431 default: 2431 default:
@@ -2452,11 +2452,11 @@ static void l2cap_add_conf_opt(void **ptr, u8 type, u8 len, unsigned long val)
2452 break; 2452 break;
2453 2453
2454 case 2: 2454 case 2:
2455 *((__le16 *) opt->val) = cpu_to_le16(val); 2455 put_unaligned_le16(val, opt->val);
2456 break; 2456 break;
2457 2457
2458 case 4: 2458 case 4:
2459 *((__le32 *) opt->val) = cpu_to_le32(val); 2459 put_unaligned_le32(val, opt->val);
2460 break; 2460 break;
2461 2461
2462 default: 2462 default:
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index 39a5d87e33b4..fa642aa652bd 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -79,7 +79,10 @@ static void rfcomm_make_uih(struct sk_buff *skb, u8 addr);
79 79
80static void rfcomm_process_connect(struct rfcomm_session *s); 80static void rfcomm_process_connect(struct rfcomm_session *s);
81 81
82static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, bdaddr_t *dst, int *err); 82static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src,
83 bdaddr_t *dst,
84 u8 sec_level,
85 int *err);
83static struct rfcomm_session *rfcomm_session_get(bdaddr_t *src, bdaddr_t *dst); 86static struct rfcomm_session *rfcomm_session_get(bdaddr_t *src, bdaddr_t *dst);
84static void rfcomm_session_del(struct rfcomm_session *s); 87static void rfcomm_session_del(struct rfcomm_session *s);
85 88
@@ -401,7 +404,7 @@ static int __rfcomm_dlc_open(struct rfcomm_dlc *d, bdaddr_t *src, bdaddr_t *dst,
401 404
402 s = rfcomm_session_get(src, dst); 405 s = rfcomm_session_get(src, dst);
403 if (!s) { 406 if (!s) {
404 s = rfcomm_session_create(src, dst, &err); 407 s = rfcomm_session_create(src, dst, d->sec_level, &err);
405 if (!s) 408 if (!s)
406 return err; 409 return err;
407 } 410 }
@@ -679,7 +682,10 @@ static void rfcomm_session_close(struct rfcomm_session *s, int err)
679 rfcomm_session_put(s); 682 rfcomm_session_put(s);
680} 683}
681 684
682static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, bdaddr_t *dst, int *err) 685static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src,
686 bdaddr_t *dst,
687 u8 sec_level,
688 int *err)
683{ 689{
684 struct rfcomm_session *s = NULL; 690 struct rfcomm_session *s = NULL;
685 struct sockaddr_l2 addr; 691 struct sockaddr_l2 addr;
@@ -704,6 +710,7 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, bdaddr_t *dst
704 sk = sock->sk; 710 sk = sock->sk;
705 lock_sock(sk); 711 lock_sock(sk);
706 l2cap_pi(sk)->imtu = l2cap_mtu; 712 l2cap_pi(sk)->imtu = l2cap_mtu;
713 l2cap_pi(sk)->sec_level = sec_level;
707 if (l2cap_ertm) 714 if (l2cap_ertm)
708 l2cap_pi(sk)->mode = L2CAP_MODE_ERTM; 715 l2cap_pi(sk)->mode = L2CAP_MODE_ERTM;
709 release_sock(sk); 716 release_sock(sk);
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index f9163b12c7f1..7aa85591dbe7 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -391,6 +391,9 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
391 u32 hw_reconf_flags = 0; 391 u32 hw_reconf_flags = 0;
392 int i; 392 int i;
393 393
394 if (local->scan_sdata == sdata)
395 ieee80211_scan_cancel(local);
396
394 clear_bit(SDATA_STATE_RUNNING, &sdata->state); 397 clear_bit(SDATA_STATE_RUNNING, &sdata->state);
395 398
396 /* 399 /*
@@ -523,9 +526,6 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
523 synchronize_rcu(); 526 synchronize_rcu();
524 skb_queue_purge(&sdata->skb_queue); 527 skb_queue_purge(&sdata->skb_queue);
525 528
526 if (local->scan_sdata == sdata)
527 ieee80211_scan_cancel(local);
528
529 /* 529 /*
530 * Disable beaconing here for mesh only, AP and IBSS 530 * Disable beaconing here for mesh only, AP and IBSS
531 * are already taken care of. 531 * are already taken care of.
diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index d0c92dddb26b..17cd0c04d139 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -44,6 +44,38 @@ rdev_freq_to_chan(struct cfg80211_registered_device *rdev,
44 return chan; 44 return chan;
45} 45}
46 46
47static bool can_beacon_sec_chan(struct wiphy *wiphy,
48 struct ieee80211_channel *chan,
49 enum nl80211_channel_type channel_type)
50{
51 struct ieee80211_channel *sec_chan;
52 int diff;
53
54 switch (channel_type) {
55 case NL80211_CHAN_HT40PLUS:
56 diff = 20;
57 break;
58 case NL80211_CHAN_HT40MINUS:
59 diff = -20;
60 break;
61 default:
62 return false;
63 }
64
65 sec_chan = ieee80211_get_channel(wiphy, chan->center_freq + diff);
66 if (!sec_chan)
67 return false;
68
69 /* we'll need a DFS capability later */
70 if (sec_chan->flags & (IEEE80211_CHAN_DISABLED |
71 IEEE80211_CHAN_PASSIVE_SCAN |
72 IEEE80211_CHAN_NO_IBSS |
73 IEEE80211_CHAN_RADAR))
74 return false;
75
76 return true;
77}
78
47int cfg80211_set_freq(struct cfg80211_registered_device *rdev, 79int cfg80211_set_freq(struct cfg80211_registered_device *rdev,
48 struct wireless_dev *wdev, int freq, 80 struct wireless_dev *wdev, int freq,
49 enum nl80211_channel_type channel_type) 81 enum nl80211_channel_type channel_type)
@@ -68,6 +100,28 @@ int cfg80211_set_freq(struct cfg80211_registered_device *rdev,
68 if (!chan) 100 if (!chan)
69 return -EINVAL; 101 return -EINVAL;
70 102
103 /* Both channels should be able to initiate communication */
104 if (wdev && (wdev->iftype == NL80211_IFTYPE_ADHOC ||
105 wdev->iftype == NL80211_IFTYPE_AP ||
106 wdev->iftype == NL80211_IFTYPE_AP_VLAN ||
107 wdev->iftype == NL80211_IFTYPE_MESH_POINT ||
108 wdev->iftype == NL80211_IFTYPE_P2P_GO)) {
109 switch (channel_type) {
110 case NL80211_CHAN_HT40PLUS:
111 case NL80211_CHAN_HT40MINUS:
112 if (!can_beacon_sec_chan(&rdev->wiphy, chan,
113 channel_type)) {
114 printk(KERN_DEBUG
115 "cfg80211: Secondary channel not "
116 "allowed to initiate communication\n");
117 return -EINVAL;
118 }
119 break;
120 default:
121 break;
122 }
123 }
124
71 result = rdev->ops->set_channel(&rdev->wiphy, 125 result = rdev->ops->set_channel(&rdev->wiphy,
72 wdev ? wdev->netdev : NULL, 126 wdev ? wdev->netdev : NULL,
73 chan, channel_type); 127 chan, channel_type);
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 605553842226..b15eb77195d8 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -230,8 +230,8 @@ static int nl80211_prepare_netdev_dump(struct sk_buff *skb,
230 } 230 }
231 231
232 *rdev = cfg80211_get_dev_from_ifindex(sock_net(skb->sk), ifidx); 232 *rdev = cfg80211_get_dev_from_ifindex(sock_net(skb->sk), ifidx);
233 if (IS_ERR(dev)) { 233 if (IS_ERR(*rdev)) {
234 err = PTR_ERR(dev); 234 err = PTR_ERR(*rdev);
235 goto out_rtnl; 235 goto out_rtnl;
236 } 236 }
237 237