aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-09-25 08:37:05 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-09-25 08:37:05 -0400
commit8e5d0661b3948f3c5a143f32d192710375822af2 (patch)
treeca18920d3f7219f7ffb7ca2fa372b82558938006 /drivers/net/wireless
parent39a6ac11df6579df0361922f05c43f0fac8daa37 (diff)
parent5698bd757d55b1bb87edd1a9744ab09c142abfc2 (diff)
Merge tag 'v3.6-rc6' into spi-drivers
Linux 3.6-rc6 Conflicts: drivers/spi/spi-omap2-mcspi.c
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/at76c50x-usb.c2
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c6
-rw-r--r--drivers/net/wireless/ath/ath5k/eeprom.c2
-rw-r--r--drivers/net/wireless/ath/ath5k/eeprom.h1
-rw-r--r--drivers/net/wireless/ath/ath5k/mac80211-ops.c5
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_paprd.c105
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_phy.h4
-rw-r--r--drivers/net/wireless/ath/ath9k/gpio.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c11
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/link.c18
-rw-r--r--drivers/net/wireless/ath/ath9k/mac.c18
-rw-r--r--drivers/net/wireless/ath/ath9k/mac.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c4
-rw-r--r--drivers/net/wireless/ath/ath9k/pci.c1
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c3
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/usb.c30
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c15
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c3
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2100.c3
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/debugfs.c3
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/internal.h2
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/rx.c2
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/trans.c30
-rw-r--r--drivers/net/wireless/libertas/if_sdio.c5
-rw-r--r--drivers/net/wireless/mwifiex/cmdevt.c15
-rw-r--r--drivers/net/wireless/p54/p54usb.c2
-rw-r--r--drivers/net/wireless/rndis_wlan.c6
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c9
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.h1
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c9
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c11
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.h17
-rw-r--r--drivers/net/wireless/rt2x00/rt2800lib.c1
-rw-r--r--drivers/net/wireless/rt2x00/rt2800pci.c9
-rw-r--r--drivers/net/wireless/rt2x00/rt2800usb.c22
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c9
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.h1
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c9
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.h3
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187/dev.c2
43 files changed, 317 insertions, 91 deletions
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c
index efc162e0b511..88b8d64c90f1 100644
--- a/drivers/net/wireless/at76c50x-usb.c
+++ b/drivers/net/wireless/at76c50x-usb.c
@@ -342,7 +342,7 @@ static int at76_dfu_get_status(struct usb_device *udev,
342 return ret; 342 return ret;
343} 343}
344 344
345static u8 at76_dfu_get_state(struct usb_device *udev, u8 *state) 345static int at76_dfu_get_state(struct usb_device *udev, u8 *state)
346{ 346{
347 int ret; 347 int ret;
348 348
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 8c4c040a47b8..2aab20ee9f38 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2056,9 +2056,7 @@ ath5k_beacon_update_timers(struct ath5k_hw *ah, u64 bc_tsf)
2056void 2056void
2057ath5k_beacon_config(struct ath5k_hw *ah) 2057ath5k_beacon_config(struct ath5k_hw *ah)
2058{ 2058{
2059 unsigned long flags; 2059 spin_lock_bh(&ah->block);
2060
2061 spin_lock_irqsave(&ah->block, flags);
2062 ah->bmisscount = 0; 2060 ah->bmisscount = 0;
2063 ah->imask &= ~(AR5K_INT_BMISS | AR5K_INT_SWBA); 2061 ah->imask &= ~(AR5K_INT_BMISS | AR5K_INT_SWBA);
2064 2062
@@ -2085,7 +2083,7 @@ ath5k_beacon_config(struct ath5k_hw *ah)
2085 2083
2086 ath5k_hw_set_imr(ah, ah->imask); 2084 ath5k_hw_set_imr(ah, ah->imask);
2087 mmiowb(); 2085 mmiowb();
2088 spin_unlock_irqrestore(&ah->block, flags); 2086 spin_unlock_bh(&ah->block);
2089} 2087}
2090 2088
2091static void ath5k_tasklet_beacon(unsigned long data) 2089static void ath5k_tasklet_beacon(unsigned long data)
diff --git a/drivers/net/wireless/ath/ath5k/eeprom.c b/drivers/net/wireless/ath/ath5k/eeprom.c
index 4026c906cc7b..b7e0258887e7 100644
--- a/drivers/net/wireless/ath/ath5k/eeprom.c
+++ b/drivers/net/wireless/ath/ath5k/eeprom.c
@@ -1482,7 +1482,7 @@ ath5k_eeprom_read_target_rate_pwr_info(struct ath5k_hw *ah, unsigned int mode)
1482 case AR5K_EEPROM_MODE_11A: 1482 case AR5K_EEPROM_MODE_11A:
1483 offset += AR5K_EEPROM_TARGET_PWR_OFF_11A(ee->ee_version); 1483 offset += AR5K_EEPROM_TARGET_PWR_OFF_11A(ee->ee_version);
1484 rate_pcal_info = ee->ee_rate_tpwr_a; 1484 rate_pcal_info = ee->ee_rate_tpwr_a;
1485 ee->ee_rate_target_pwr_num[mode] = AR5K_EEPROM_N_5GHZ_CHAN; 1485 ee->ee_rate_target_pwr_num[mode] = AR5K_EEPROM_N_5GHZ_RATE_CHAN;
1486 break; 1486 break;
1487 case AR5K_EEPROM_MODE_11B: 1487 case AR5K_EEPROM_MODE_11B:
1488 offset += AR5K_EEPROM_TARGET_PWR_OFF_11B(ee->ee_version); 1488 offset += AR5K_EEPROM_TARGET_PWR_OFF_11B(ee->ee_version);
diff --git a/drivers/net/wireless/ath/ath5k/eeprom.h b/drivers/net/wireless/ath/ath5k/eeprom.h
index dc2bcfeadeb4..94a9bbea6874 100644
--- a/drivers/net/wireless/ath/ath5k/eeprom.h
+++ b/drivers/net/wireless/ath/ath5k/eeprom.h
@@ -182,6 +182,7 @@
182#define AR5K_EEPROM_EEP_DELTA 10 182#define AR5K_EEPROM_EEP_DELTA 10
183#define AR5K_EEPROM_N_MODES 3 183#define AR5K_EEPROM_N_MODES 3
184#define AR5K_EEPROM_N_5GHZ_CHAN 10 184#define AR5K_EEPROM_N_5GHZ_CHAN 10
185#define AR5K_EEPROM_N_5GHZ_RATE_CHAN 8
185#define AR5K_EEPROM_N_2GHZ_CHAN 3 186#define AR5K_EEPROM_N_2GHZ_CHAN 3
186#define AR5K_EEPROM_N_2GHZ_CHAN_2413 4 187#define AR5K_EEPROM_N_2GHZ_CHAN_2413 4
187#define AR5K_EEPROM_N_2GHZ_CHAN_MAX 4 188#define AR5K_EEPROM_N_2GHZ_CHAN_MAX 4
diff --git a/drivers/net/wireless/ath/ath5k/mac80211-ops.c b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
index 260e7dc7f751..d56453e43d7e 100644
--- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c
+++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
@@ -254,7 +254,6 @@ ath5k_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
254 struct ath5k_vif *avf = (void *)vif->drv_priv; 254 struct ath5k_vif *avf = (void *)vif->drv_priv;
255 struct ath5k_hw *ah = hw->priv; 255 struct ath5k_hw *ah = hw->priv;
256 struct ath_common *common = ath5k_hw_common(ah); 256 struct ath_common *common = ath5k_hw_common(ah);
257 unsigned long flags;
258 257
259 mutex_lock(&ah->lock); 258 mutex_lock(&ah->lock);
260 259
@@ -300,9 +299,9 @@ ath5k_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
300 } 299 }
301 300
302 if (changes & BSS_CHANGED_BEACON) { 301 if (changes & BSS_CHANGED_BEACON) {
303 spin_lock_irqsave(&ah->block, flags); 302 spin_lock_bh(&ah->block);
304 ath5k_beacon_update(hw, vif); 303 ath5k_beacon_update(hw, vif);
305 spin_unlock_irqrestore(&ah->block, flags); 304 spin_unlock_bh(&ah->block);
306 } 305 }
307 306
308 if (changes & BSS_CHANGED_BEACON_ENABLED) 307 if (changes & BSS_CHANGED_BEACON_ENABLED)
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
index 2c9f7d7ed4cc..0ed3846f9cbb 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
@@ -142,6 +142,7 @@ static int ar9003_paprd_setup_single_table(struct ath_hw *ah)
142 }; 142 };
143 int training_power; 143 int training_power;
144 int i, val; 144 int i, val;
145 u32 am2pm_mask = ah->paprd_ratemask;
145 146
146 if (IS_CHAN_2GHZ(ah->curchan)) 147 if (IS_CHAN_2GHZ(ah->curchan))
147 training_power = ar9003_get_training_power_2g(ah); 148 training_power = ar9003_get_training_power_2g(ah);
@@ -158,10 +159,13 @@ static int ar9003_paprd_setup_single_table(struct ath_hw *ah)
158 } 159 }
159 ah->paprd_training_power = training_power; 160 ah->paprd_training_power = training_power;
160 161
162 if (AR_SREV_9330(ah))
163 am2pm_mask = 0;
164
161 REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2AM, AR_PHY_PAPRD_AM2AM_MASK, 165 REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2AM, AR_PHY_PAPRD_AM2AM_MASK,
162 ah->paprd_ratemask); 166 ah->paprd_ratemask);
163 REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2PM, AR_PHY_PAPRD_AM2PM_MASK, 167 REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2PM, AR_PHY_PAPRD_AM2PM_MASK,
164 ah->paprd_ratemask); 168 am2pm_mask);
165 REG_RMW_FIELD(ah, AR_PHY_PAPRD_HT40, AR_PHY_PAPRD_HT40_MASK, 169 REG_RMW_FIELD(ah, AR_PHY_PAPRD_HT40, AR_PHY_PAPRD_HT40_MASK,
166 ah->paprd_ratemask_ht40); 170 ah->paprd_ratemask_ht40);
167 171
@@ -782,6 +786,102 @@ int ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain)
782} 786}
783EXPORT_SYMBOL(ar9003_paprd_setup_gain_table); 787EXPORT_SYMBOL(ar9003_paprd_setup_gain_table);
784 788
789static bool ar9003_paprd_retrain_pa_in(struct ath_hw *ah,
790 struct ath9k_hw_cal_data *caldata,
791 int chain)
792{
793 u32 *pa_in = caldata->pa_table[chain];
794 int capdiv_offset, quick_drop_offset;
795 int capdiv2g, quick_drop;
796 int count = 0;
797 int i;
798
799 if (!AR_SREV_9485(ah) && !AR_SREV_9330(ah))
800 return false;
801
802 capdiv2g = REG_READ_FIELD(ah, AR_PHY_65NM_CH0_TXRF3,
803 AR_PHY_65NM_CH0_TXRF3_CAPDIV2G);
804
805 quick_drop = REG_READ_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3,
806 AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP);
807
808 if (quick_drop)
809 quick_drop -= 0x40;
810
811 for (i = 0; i < NUM_BIN + 1; i++) {
812 if (pa_in[i] == 1400)
813 count++;
814 }
815
816 if (AR_SREV_9485(ah)) {
817 if (pa_in[23] < 800) {
818 capdiv_offset = (int)((1000 - pa_in[23] + 75) / 150);
819 capdiv2g += capdiv_offset;
820 if (capdiv2g > 7) {
821 capdiv2g = 7;
822 if (pa_in[23] < 600) {
823 quick_drop++;
824 if (quick_drop > 0)
825 quick_drop = 0;
826 }
827 }
828 } else if (pa_in[23] == 1400) {
829 quick_drop_offset = min_t(int, count / 3, 2);
830 quick_drop += quick_drop_offset;
831 capdiv2g += quick_drop_offset / 2;
832
833 if (capdiv2g > 7)
834 capdiv2g = 7;
835
836 if (quick_drop > 0) {
837 quick_drop = 0;
838 capdiv2g -= quick_drop_offset;
839 if (capdiv2g < 0)
840 capdiv2g = 0;
841 }
842 } else {
843 return false;
844 }
845 } else if (AR_SREV_9330(ah)) {
846 if (pa_in[23] < 1000) {
847 capdiv_offset = (1000 - pa_in[23]) / 100;
848 capdiv2g += capdiv_offset;
849 if (capdiv_offset > 3) {
850 capdiv_offset = 1;
851 quick_drop--;
852 }
853
854 capdiv2g += capdiv_offset;
855 if (capdiv2g > 6)
856 capdiv2g = 6;
857 if (quick_drop < -4)
858 quick_drop = -4;
859 } else if (pa_in[23] == 1400) {
860 if (count > 3) {
861 quick_drop++;
862 capdiv2g -= count / 4;
863 if (quick_drop > -2)
864 quick_drop = -2;
865 } else {
866 capdiv2g--;
867 }
868
869 if (capdiv2g < 0)
870 capdiv2g = 0;
871 } else {
872 return false;
873 }
874 }
875
876 REG_RMW_FIELD(ah, AR_PHY_65NM_CH0_TXRF3,
877 AR_PHY_65NM_CH0_TXRF3_CAPDIV2G, capdiv2g);
878 REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3,
879 AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP,
880 quick_drop);
881
882 return true;
883}
884
785int ar9003_paprd_create_curve(struct ath_hw *ah, 885int ar9003_paprd_create_curve(struct ath_hw *ah,
786 struct ath9k_hw_cal_data *caldata, int chain) 886 struct ath9k_hw_cal_data *caldata, int chain)
787{ 887{
@@ -817,6 +917,9 @@ int ar9003_paprd_create_curve(struct ath_hw *ah,
817 if (!create_pa_curve(data_L, data_U, pa_table, small_signal_gain)) 917 if (!create_pa_curve(data_L, data_U, pa_table, small_signal_gain))
818 status = -2; 918 status = -2;
819 919
920 if (ar9003_paprd_retrain_pa_in(ah, caldata, chain))
921 status = -EINPROGRESS;
922
820 REG_CLR_BIT(ah, AR_PHY_PAPRD_TRAINER_STAT1, 923 REG_CLR_BIT(ah, AR_PHY_PAPRD_TRAINER_STAT1,
821 AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE); 924 AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE);
822 925
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.h b/drivers/net/wireless/ath/ath9k/ar9003_phy.h
index 7bfbaf065a43..84d3d4956861 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.h
@@ -625,6 +625,10 @@
625#define AR_PHY_AIC_CTRL_4_B0 (AR_SM_BASE + 0x4c0) 625#define AR_PHY_AIC_CTRL_4_B0 (AR_SM_BASE + 0x4c0)
626#define AR_PHY_AIC_STAT_2_B0 (AR_SM_BASE + 0x4cc) 626#define AR_PHY_AIC_STAT_2_B0 (AR_SM_BASE + 0x4cc)
627 627
628#define AR_PHY_65NM_CH0_TXRF3 0x16048
629#define AR_PHY_65NM_CH0_TXRF3_CAPDIV2G 0x0000001e
630#define AR_PHY_65NM_CH0_TXRF3_CAPDIV2G_S 1
631
628#define AR_PHY_65NM_CH0_SYNTH4 0x1608c 632#define AR_PHY_65NM_CH0_SYNTH4 0x1608c
629#define AR_PHY_SYNTH4_LONG_SHIFT_SELECT (AR_SREV_9462(ah) ? 0x00000001 : 0x00000002) 633#define AR_PHY_SYNTH4_LONG_SHIFT_SELECT (AR_SREV_9462(ah) ? 0x00000001 : 0x00000002)
630#define AR_PHY_SYNTH4_LONG_SHIFT_SELECT_S (AR_SREV_9462(ah) ? 0 : 1) 634#define AR_PHY_SYNTH4_LONG_SHIFT_SELECT_S (AR_SREV_9462(ah) ? 0 : 1)
diff --git a/drivers/net/wireless/ath/ath9k/gpio.c b/drivers/net/wireless/ath/ath9k/gpio.c
index bacdb8fb4ef4..9f83f71742a5 100644
--- a/drivers/net/wireless/ath/ath9k/gpio.c
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
@@ -341,7 +341,8 @@ void ath9k_btcoex_stop_gen_timer(struct ath_softc *sc)
341{ 341{
342 struct ath_btcoex *btcoex = &sc->btcoex; 342 struct ath_btcoex *btcoex = &sc->btcoex;
343 343
344 ath9k_gen_timer_stop(sc->sc_ah, btcoex->no_stomp_timer); 344 if (btcoex->hw_timer_enabled)
345 ath9k_gen_timer_stop(sc->sc_ah, btcoex->no_stomp_timer);
345} 346}
346 347
347u16 ath9k_btcoex_aggr_limit(struct ath_softc *sc, u32 max_4ms_framelen) 348u16 ath9k_btcoex_aggr_limit(struct ath_softc *sc, u32 max_4ms_framelen)
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 60b6a9daff7e..48af40151d23 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -463,9 +463,6 @@ static void ath9k_hw_init_config(struct ath_hw *ah)
463 ah->config.spurchans[i][1] = AR_NO_SPUR; 463 ah->config.spurchans[i][1] = AR_NO_SPUR;
464 } 464 }
465 465
466 /* PAPRD needs some more work to be enabled */
467 ah->config.paprd_disable = 1;
468
469 ah->config.rx_intr_mitigation = true; 466 ah->config.rx_intr_mitigation = true;
470 ah->config.pcieSerDesWrite = true; 467 ah->config.pcieSerDesWrite = true;
471 468
@@ -978,9 +975,6 @@ static void ath9k_hw_init_interrupt_masks(struct ath_hw *ah,
978 else 975 else
979 imr_reg |= AR_IMR_TXOK; 976 imr_reg |= AR_IMR_TXOK;
980 977
981 if (opmode == NL80211_IFTYPE_AP)
982 imr_reg |= AR_IMR_MIB;
983
984 ENABLE_REGWRITE_BUFFER(ah); 978 ENABLE_REGWRITE_BUFFER(ah);
985 979
986 REG_WRITE(ah, AR_IMR, imr_reg); 980 REG_WRITE(ah, AR_IMR, imr_reg);
@@ -1778,6 +1772,8 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
1778 /* Operating channel changed, reset channel calibration data */ 1772 /* Operating channel changed, reset channel calibration data */
1779 memset(caldata, 0, sizeof(*caldata)); 1773 memset(caldata, 0, sizeof(*caldata));
1780 ath9k_init_nfcal_hist_buffer(ah, chan); 1774 ath9k_init_nfcal_hist_buffer(ah, chan);
1775 } else if (caldata) {
1776 caldata->paprd_packet_sent = false;
1781 } 1777 }
1782 ah->noise = ath9k_hw_getchan_noise(ah, chan); 1778 ah->noise = ath9k_hw_getchan_noise(ah, chan);
1783 1779
@@ -2502,7 +2498,8 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
2502 pCap->tx_desc_len = sizeof(struct ar9003_txc); 2498 pCap->tx_desc_len = sizeof(struct ar9003_txc);
2503 pCap->txs_len = sizeof(struct ar9003_txs); 2499 pCap->txs_len = sizeof(struct ar9003_txs);
2504 if (!ah->config.paprd_disable && 2500 if (!ah->config.paprd_disable &&
2505 ah->eep_ops->get_eeprom(ah, EEP_PAPRD)) 2501 ah->eep_ops->get_eeprom(ah, EEP_PAPRD) &&
2502 !AR_SREV_9462(ah))
2506 pCap->hw_caps |= ATH9K_HW_CAP_PAPRD; 2503 pCap->hw_caps |= ATH9K_HW_CAP_PAPRD;
2507 } else { 2504 } else {
2508 pCap->tx_desc_len = sizeof(struct ath_desc); 2505 pCap->tx_desc_len = sizeof(struct ath_desc);
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index ce7332c64efb..6599a75f01fe 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -405,6 +405,7 @@ struct ath9k_hw_cal_data {
405 int8_t iCoff; 405 int8_t iCoff;
406 int8_t qCoff; 406 int8_t qCoff;
407 bool rtt_done; 407 bool rtt_done;
408 bool paprd_packet_sent;
408 bool paprd_done; 409 bool paprd_done;
409 bool nfcal_pending; 410 bool nfcal_pending;
410 bool nfcal_interference; 411 bool nfcal_interference;
diff --git a/drivers/net/wireless/ath/ath9k/link.c b/drivers/net/wireless/ath/ath9k/link.c
index d4549e9aac5c..825a29cc9313 100644
--- a/drivers/net/wireless/ath/ath9k/link.c
+++ b/drivers/net/wireless/ath/ath9k/link.c
@@ -254,8 +254,9 @@ void ath_paprd_calibrate(struct work_struct *work)
254 int chain_ok = 0; 254 int chain_ok = 0;
255 int chain; 255 int chain;
256 int len = 1800; 256 int len = 1800;
257 int ret;
257 258
258 if (!caldata) 259 if (!caldata || !caldata->paprd_packet_sent || caldata->paprd_done)
259 return; 260 return;
260 261
261 ath9k_ps_wakeup(sc); 262 ath9k_ps_wakeup(sc);
@@ -282,13 +283,6 @@ void ath_paprd_calibrate(struct work_struct *work)
282 continue; 283 continue;
283 284
284 chain_ok = 0; 285 chain_ok = 0;
285
286 ath_dbg(common, CALIBRATE,
287 "Sending PAPRD frame for thermal measurement on chain %d\n",
288 chain);
289 if (!ath_paprd_send_frame(sc, skb, chain))
290 goto fail_paprd;
291
292 ar9003_paprd_setup_gain_table(ah, chain); 286 ar9003_paprd_setup_gain_table(ah, chain);
293 287
294 ath_dbg(common, CALIBRATE, 288 ath_dbg(common, CALIBRATE,
@@ -302,7 +296,13 @@ void ath_paprd_calibrate(struct work_struct *work)
302 break; 296 break;
303 } 297 }
304 298
305 if (ar9003_paprd_create_curve(ah, caldata, chain)) { 299 ret = ar9003_paprd_create_curve(ah, caldata, chain);
300 if (ret == -EINPROGRESS) {
301 ath_dbg(common, CALIBRATE,
302 "PAPRD curve on chain %d needs to be re-trained\n",
303 chain);
304 break;
305 } else if (ret) {
306 ath_dbg(common, CALIBRATE, 306 ath_dbg(common, CALIBRATE,
307 "PAPRD create curve failed on chain %d\n", 307 "PAPRD create curve failed on chain %d\n",
308 chain); 308 chain);
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
index 7990cd55599c..b42be910a83d 100644
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -773,15 +773,10 @@ bool ath9k_hw_intrpend(struct ath_hw *ah)
773} 773}
774EXPORT_SYMBOL(ath9k_hw_intrpend); 774EXPORT_SYMBOL(ath9k_hw_intrpend);
775 775
776void ath9k_hw_disable_interrupts(struct ath_hw *ah) 776void ath9k_hw_kill_interrupts(struct ath_hw *ah)
777{ 777{
778 struct ath_common *common = ath9k_hw_common(ah); 778 struct ath_common *common = ath9k_hw_common(ah);
779 779
780 if (!(ah->imask & ATH9K_INT_GLOBAL))
781 atomic_set(&ah->intr_ref_cnt, -1);
782 else
783 atomic_dec(&ah->intr_ref_cnt);
784
785 ath_dbg(common, INTERRUPT, "disable IER\n"); 780 ath_dbg(common, INTERRUPT, "disable IER\n");
786 REG_WRITE(ah, AR_IER, AR_IER_DISABLE); 781 REG_WRITE(ah, AR_IER, AR_IER_DISABLE);
787 (void) REG_READ(ah, AR_IER); 782 (void) REG_READ(ah, AR_IER);
@@ -793,6 +788,17 @@ void ath9k_hw_disable_interrupts(struct ath_hw *ah)
793 (void) REG_READ(ah, AR_INTR_SYNC_ENABLE); 788 (void) REG_READ(ah, AR_INTR_SYNC_ENABLE);
794 } 789 }
795} 790}
791EXPORT_SYMBOL(ath9k_hw_kill_interrupts);
792
793void ath9k_hw_disable_interrupts(struct ath_hw *ah)
794{
795 if (!(ah->imask & ATH9K_INT_GLOBAL))
796 atomic_set(&ah->intr_ref_cnt, -1);
797 else
798 atomic_dec(&ah->intr_ref_cnt);
799
800 ath9k_hw_kill_interrupts(ah);
801}
796EXPORT_SYMBOL(ath9k_hw_disable_interrupts); 802EXPORT_SYMBOL(ath9k_hw_disable_interrupts);
797 803
798void ath9k_hw_enable_interrupts(struct ath_hw *ah) 804void ath9k_hw_enable_interrupts(struct ath_hw *ah)
diff --git a/drivers/net/wireless/ath/ath9k/mac.h b/drivers/net/wireless/ath/ath9k/mac.h
index 0eba36dca6f8..4a745e68dd94 100644
--- a/drivers/net/wireless/ath/ath9k/mac.h
+++ b/drivers/net/wireless/ath/ath9k/mac.h
@@ -738,6 +738,7 @@ bool ath9k_hw_intrpend(struct ath_hw *ah);
738void ath9k_hw_set_interrupts(struct ath_hw *ah); 738void ath9k_hw_set_interrupts(struct ath_hw *ah);
739void ath9k_hw_enable_interrupts(struct ath_hw *ah); 739void ath9k_hw_enable_interrupts(struct ath_hw *ah);
740void ath9k_hw_disable_interrupts(struct ath_hw *ah); 740void ath9k_hw_disable_interrupts(struct ath_hw *ah);
741void ath9k_hw_kill_interrupts(struct ath_hw *ah);
741 742
742void ar9002_hw_attach_mac_ops(struct ath_hw *ah); 743void ar9002_hw_attach_mac_ops(struct ath_hw *ah);
743 744
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 6049d8b82855..a22df749b8db 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -462,8 +462,10 @@ irqreturn_t ath_isr(int irq, void *dev)
462 if (!ath9k_hw_intrpend(ah)) 462 if (!ath9k_hw_intrpend(ah))
463 return IRQ_NONE; 463 return IRQ_NONE;
464 464
465 if(test_bit(SC_OP_HW_RESET, &sc->sc_flags)) 465 if (test_bit(SC_OP_HW_RESET, &sc->sc_flags)) {
466 ath9k_hw_kill_interrupts(ah);
466 return IRQ_HANDLED; 467 return IRQ_HANDLED;
468 }
467 469
468 /* 470 /*
469 * Figure out the reason(s) for the interrupt. Note 471 * Figure out the reason(s) for the interrupt. Note
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
index d455de9162ec..a978984d78a5 100644
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -321,6 +321,7 @@ static int ath_pci_suspend(struct device *device)
321 * Otherwise the chip never moved to full sleep, 321 * Otherwise the chip never moved to full sleep,
322 * when no interface is up. 322 * when no interface is up.
323 */ 323 */
324 ath9k_stop_btcoex(sc);
324 ath9k_hw_disable(sc->sc_ah); 325 ath9k_hw_disable(sc->sc_ah);
325 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_FULL_SLEEP); 326 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_FULL_SLEEP);
326 327
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 12aca02228c2..4480c0cc655f 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -1044,7 +1044,6 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
1044 struct ieee80211_hw *hw = sc->hw; 1044 struct ieee80211_hw *hw = sc->hw;
1045 struct ieee80211_hdr *hdr; 1045 struct ieee80211_hdr *hdr;
1046 int retval; 1046 int retval;
1047 bool decrypt_error = false;
1048 struct ath_rx_status rs; 1047 struct ath_rx_status rs;
1049 enum ath9k_rx_qtype qtype; 1048 enum ath9k_rx_qtype qtype;
1050 bool edma = !!(ah->caps.hw_caps & ATH9K_HW_CAP_EDMA); 1049 bool edma = !!(ah->caps.hw_caps & ATH9K_HW_CAP_EDMA);
@@ -1066,6 +1065,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
1066 tsf_lower = tsf & 0xffffffff; 1065 tsf_lower = tsf & 0xffffffff;
1067 1066
1068 do { 1067 do {
1068 bool decrypt_error = false;
1069 /* If handling rx interrupt and flush is in progress => exit */ 1069 /* If handling rx interrupt and flush is in progress => exit */
1070 if (test_bit(SC_OP_RXFLUSH, &sc->sc_flags) && (flush == 0)) 1070 if (test_bit(SC_OP_RXFLUSH, &sc->sc_flags) && (flush == 0))
1071 break; 1071 break;
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 2c9da6b2ecb1..0d4155aec48d 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -2018,6 +2018,9 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
2018 2018
2019 ath_dbg(common, XMIT, "TX complete: skb: %p\n", skb); 2019 ath_dbg(common, XMIT, "TX complete: skb: %p\n", skb);
2020 2020
2021 if (sc->sc_ah->caldata)
2022 sc->sc_ah->caldata->paprd_packet_sent = true;
2023
2021 if (!(tx_flags & ATH_TX_ERROR)) 2024 if (!(tx_flags & ATH_TX_ERROR))
2022 /* Frame was ACKed */ 2025 /* Frame was ACKed */
2023 tx_info->flags |= IEEE80211_TX_STAT_ACK; 2026 tx_info->flags |= IEEE80211_TX_STAT_ACK;
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/brcm80211/brcmfmac/usb.c
index a299d42da8e7..58f89fa9c9f8 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c
@@ -519,7 +519,7 @@ static void brcmf_usb_tx_complete(struct urb *urb)
519 else 519 else
520 devinfo->bus_pub.bus->dstats.tx_errors++; 520 devinfo->bus_pub.bus->dstats.tx_errors++;
521 521
522 dev_kfree_skb(req->skb); 522 brcmu_pkt_buf_free_skb(req->skb);
523 req->skb = NULL; 523 req->skb = NULL;
524 brcmf_usb_enq(devinfo, &devinfo->tx_freeq, req); 524 brcmf_usb_enq(devinfo, &devinfo->tx_freeq, req);
525 525
@@ -540,7 +540,7 @@ static void brcmf_usb_rx_complete(struct urb *urb)
540 devinfo->bus_pub.bus->dstats.rx_packets++; 540 devinfo->bus_pub.bus->dstats.rx_packets++;
541 } else { 541 } else {
542 devinfo->bus_pub.bus->dstats.rx_errors++; 542 devinfo->bus_pub.bus->dstats.rx_errors++;
543 dev_kfree_skb(skb); 543 brcmu_pkt_buf_free_skb(skb);
544 brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req); 544 brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req);
545 return; 545 return;
546 } 546 }
@@ -550,13 +550,15 @@ static void brcmf_usb_rx_complete(struct urb *urb)
550 if (brcmf_proto_hdrpull(devinfo->dev, &ifidx, skb) != 0) { 550 if (brcmf_proto_hdrpull(devinfo->dev, &ifidx, skb) != 0) {
551 brcmf_dbg(ERROR, "rx protocol error\n"); 551 brcmf_dbg(ERROR, "rx protocol error\n");
552 brcmu_pkt_buf_free_skb(skb); 552 brcmu_pkt_buf_free_skb(skb);
553 brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req);
553 devinfo->bus_pub.bus->dstats.rx_errors++; 554 devinfo->bus_pub.bus->dstats.rx_errors++;
554 } else { 555 } else {
555 brcmf_rx_packet(devinfo->dev, ifidx, skb); 556 brcmf_rx_packet(devinfo->dev, ifidx, skb);
556 brcmf_usb_rx_refill(devinfo, req); 557 brcmf_usb_rx_refill(devinfo, req);
557 } 558 }
558 } else { 559 } else {
559 dev_kfree_skb(skb); 560 brcmu_pkt_buf_free_skb(skb);
561 brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req);
560 } 562 }
561 return; 563 return;
562 564
@@ -581,14 +583,13 @@ static void brcmf_usb_rx_refill(struct brcmf_usbdev_info *devinfo,
581 usb_fill_bulk_urb(req->urb, devinfo->usbdev, devinfo->rx_pipe, 583 usb_fill_bulk_urb(req->urb, devinfo->usbdev, devinfo->rx_pipe,
582 skb->data, skb_tailroom(skb), brcmf_usb_rx_complete, 584 skb->data, skb_tailroom(skb), brcmf_usb_rx_complete,
583 req); 585 req);
584 req->urb->transfer_flags |= URB_ZERO_PACKET;
585 req->devinfo = devinfo; 586 req->devinfo = devinfo;
587 brcmf_usb_enq(devinfo, &devinfo->rx_postq, req);
586 588
587 ret = usb_submit_urb(req->urb, GFP_ATOMIC); 589 ret = usb_submit_urb(req->urb, GFP_ATOMIC);
588 if (ret == 0) { 590 if (ret) {
589 brcmf_usb_enq(devinfo, &devinfo->rx_postq, req); 591 brcmf_usb_del_fromq(devinfo, req);
590 } else { 592 brcmu_pkt_buf_free_skb(req->skb);
591 dev_kfree_skb(req->skb);
592 req->skb = NULL; 593 req->skb = NULL;
593 brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req); 594 brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req);
594 } 595 }
@@ -683,23 +684,22 @@ static int brcmf_usb_tx(struct device *dev, struct sk_buff *skb)
683 684
684 req = brcmf_usb_deq(devinfo, &devinfo->tx_freeq); 685 req = brcmf_usb_deq(devinfo, &devinfo->tx_freeq);
685 if (!req) { 686 if (!req) {
687 brcmu_pkt_buf_free_skb(skb);
686 brcmf_dbg(ERROR, "no req to send\n"); 688 brcmf_dbg(ERROR, "no req to send\n");
687 return -ENOMEM; 689 return -ENOMEM;
688 } 690 }
689 if (!req->urb) {
690 brcmf_dbg(ERROR, "no urb for req %p\n", req);
691 return -ENOBUFS;
692 }
693 691
694 req->skb = skb; 692 req->skb = skb;
695 req->devinfo = devinfo; 693 req->devinfo = devinfo;
696 usb_fill_bulk_urb(req->urb, devinfo->usbdev, devinfo->tx_pipe, 694 usb_fill_bulk_urb(req->urb, devinfo->usbdev, devinfo->tx_pipe,
697 skb->data, skb->len, brcmf_usb_tx_complete, req); 695 skb->data, skb->len, brcmf_usb_tx_complete, req);
698 req->urb->transfer_flags |= URB_ZERO_PACKET; 696 req->urb->transfer_flags |= URB_ZERO_PACKET;
697 brcmf_usb_enq(devinfo, &devinfo->tx_postq, req);
699 ret = usb_submit_urb(req->urb, GFP_ATOMIC); 698 ret = usb_submit_urb(req->urb, GFP_ATOMIC);
700 if (!ret) { 699 if (ret) {
701 brcmf_usb_enq(devinfo, &devinfo->tx_postq, req); 700 brcmf_dbg(ERROR, "brcmf_usb_tx usb_submit_urb FAILED\n");
702 } else { 701 brcmf_usb_del_fromq(devinfo, req);
702 brcmu_pkt_buf_free_skb(req->skb);
703 req->skb = NULL; 703 req->skb = NULL;
704 brcmf_usb_enq(devinfo, &devinfo->tx_freeq, req); 704 brcmf_usb_enq(devinfo, &devinfo->tx_freeq, req);
705 } 705 }
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index 28c5fbb4af26..c36e92312443 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -1876,16 +1876,17 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev,
1876 } 1876 }
1877 1877
1878 if (test_bit(WL_STATUS_CONNECTED, &cfg_priv->status)) { 1878 if (test_bit(WL_STATUS_CONNECTED, &cfg_priv->status)) {
1879 scb_val.val = cpu_to_le32(0); 1879 memset(&scb_val, 0, sizeof(scb_val));
1880 err = brcmf_exec_dcmd(ndev, BRCMF_C_GET_RSSI, &scb_val, 1880 err = brcmf_exec_dcmd(ndev, BRCMF_C_GET_RSSI, &scb_val,
1881 sizeof(struct brcmf_scb_val_le)); 1881 sizeof(struct brcmf_scb_val_le));
1882 if (err) 1882 if (err) {
1883 WL_ERR("Could not get rssi (%d)\n", err); 1883 WL_ERR("Could not get rssi (%d)\n", err);
1884 1884 } else {
1885 rssi = le32_to_cpu(scb_val.val); 1885 rssi = le32_to_cpu(scb_val.val);
1886 sinfo->filled |= STATION_INFO_SIGNAL; 1886 sinfo->filled |= STATION_INFO_SIGNAL;
1887 sinfo->signal = rssi; 1887 sinfo->signal = rssi;
1888 WL_CONN("RSSI %d dBm\n", rssi); 1888 WL_CONN("RSSI %d dBm\n", rssi);
1889 }
1889 } 1890 }
1890 1891
1891done: 1892done:
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
index 192ad5c1fcc8..a5edebeb0b4f 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
@@ -1233,6 +1233,9 @@ uint brcms_reset(struct brcms_info *wl)
1233 /* dpc will not be rescheduled */ 1233 /* dpc will not be rescheduled */
1234 wl->resched = false; 1234 wl->resched = false;
1235 1235
1236 /* inform publicly that interface is down */
1237 wl->pub->up = false;
1238
1236 return 0; 1239 return 0;
1237} 1240}
1238 1241
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 95aa8e1683ec..83324b321652 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -2042,7 +2042,8 @@ static void isr_indicate_associated(struct ipw2100_priv *priv, u32 status)
2042 return; 2042 return;
2043 } 2043 }
2044 len = ETH_ALEN; 2044 len = ETH_ALEN;
2045 ipw2100_get_ordinal(priv, IPW_ORD_STAT_ASSN_AP_BSSID, &bssid, &len); 2045 ret = ipw2100_get_ordinal(priv, IPW_ORD_STAT_ASSN_AP_BSSID, bssid,
2046 &len);
2046 if (ret) { 2047 if (ret) {
2047 IPW_DEBUG_INFO("failed querying ordinals at line %d\n", 2048 IPW_DEBUG_INFO("failed querying ordinals at line %d\n",
2048 __LINE__); 2049 __LINE__);
diff --git a/drivers/net/wireless/iwlwifi/dvm/debugfs.c b/drivers/net/wireless/iwlwifi/dvm/debugfs.c
index 46782f1102ac..a47b306b522c 100644
--- a/drivers/net/wireless/iwlwifi/dvm/debugfs.c
+++ b/drivers/net/wireless/iwlwifi/dvm/debugfs.c
@@ -124,6 +124,9 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file,
124 const struct fw_img *img; 124 const struct fw_img *img;
125 size_t bufsz; 125 size_t bufsz;
126 126
127 if (!iwl_is_ready_rf(priv))
128 return -EAGAIN;
129
127 /* default is to dump the entire data segment */ 130 /* default is to dump the entire data segment */
128 if (!priv->dbgfs_sram_offset && !priv->dbgfs_sram_len) { 131 if (!priv->dbgfs_sram_offset && !priv->dbgfs_sram_len) {
129 priv->dbgfs_sram_offset = 0x800000; 132 priv->dbgfs_sram_offset = 0x800000;
diff --git a/drivers/net/wireless/iwlwifi/pcie/internal.h b/drivers/net/wireless/iwlwifi/pcie/internal.h
index d9694c58208c..4ffc18dc3a57 100644
--- a/drivers/net/wireless/iwlwifi/pcie/internal.h
+++ b/drivers/net/wireless/iwlwifi/pcie/internal.h
@@ -350,7 +350,7 @@ int iwl_queue_space(const struct iwl_queue *q);
350/***************************************************** 350/*****************************************************
351* Error handling 351* Error handling
352******************************************************/ 352******************************************************/
353int iwl_dump_fh(struct iwl_trans *trans, char **buf, bool display); 353int iwl_dump_fh(struct iwl_trans *trans, char **buf);
354void iwl_dump_csr(struct iwl_trans *trans); 354void iwl_dump_csr(struct iwl_trans *trans);
355 355
356/***************************************************** 356/*****************************************************
diff --git a/drivers/net/wireless/iwlwifi/pcie/rx.c b/drivers/net/wireless/iwlwifi/pcie/rx.c
index 39a6ca1f009c..d1a61ba6247a 100644
--- a/drivers/net/wireless/iwlwifi/pcie/rx.c
+++ b/drivers/net/wireless/iwlwifi/pcie/rx.c
@@ -555,7 +555,7 @@ static void iwl_irq_handle_error(struct iwl_trans *trans)
555 } 555 }
556 556
557 iwl_dump_csr(trans); 557 iwl_dump_csr(trans);
558 iwl_dump_fh(trans, NULL, false); 558 iwl_dump_fh(trans, NULL);
559 559
560 iwl_op_mode_nic_error(trans->op_mode); 560 iwl_op_mode_nic_error(trans->op_mode);
561} 561}
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c
index 939c2f78df58..1e86ea2266d4 100644
--- a/drivers/net/wireless/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/iwlwifi/pcie/trans.c
@@ -1649,13 +1649,9 @@ static const char *get_fh_string(int cmd)
1649#undef IWL_CMD 1649#undef IWL_CMD
1650} 1650}
1651 1651
1652int iwl_dump_fh(struct iwl_trans *trans, char **buf, bool display) 1652int iwl_dump_fh(struct iwl_trans *trans, char **buf)
1653{ 1653{
1654 int i; 1654 int i;
1655#ifdef CONFIG_IWLWIFI_DEBUG
1656 int pos = 0;
1657 size_t bufsz = 0;
1658#endif
1659 static const u32 fh_tbl[] = { 1655 static const u32 fh_tbl[] = {
1660 FH_RSCSR_CHNL0_STTS_WPTR_REG, 1656 FH_RSCSR_CHNL0_STTS_WPTR_REG,
1661 FH_RSCSR_CHNL0_RBDCB_BASE_REG, 1657 FH_RSCSR_CHNL0_RBDCB_BASE_REG,
@@ -1667,29 +1663,35 @@ int iwl_dump_fh(struct iwl_trans *trans, char **buf, bool display)
1667 FH_TSSR_TX_STATUS_REG, 1663 FH_TSSR_TX_STATUS_REG,
1668 FH_TSSR_TX_ERROR_REG 1664 FH_TSSR_TX_ERROR_REG
1669 }; 1665 };
1670#ifdef CONFIG_IWLWIFI_DEBUG 1666
1671 if (display) { 1667#ifdef CONFIG_IWLWIFI_DEBUGFS
1672 bufsz = ARRAY_SIZE(fh_tbl) * 48 + 40; 1668 if (buf) {
1669 int pos = 0;
1670 size_t bufsz = ARRAY_SIZE(fh_tbl) * 48 + 40;
1671
1673 *buf = kmalloc(bufsz, GFP_KERNEL); 1672 *buf = kmalloc(bufsz, GFP_KERNEL);
1674 if (!*buf) 1673 if (!*buf)
1675 return -ENOMEM; 1674 return -ENOMEM;
1675
1676 pos += scnprintf(*buf + pos, bufsz - pos, 1676 pos += scnprintf(*buf + pos, bufsz - pos,
1677 "FH register values:\n"); 1677 "FH register values:\n");
1678 for (i = 0; i < ARRAY_SIZE(fh_tbl); i++) { 1678
1679 for (i = 0; i < ARRAY_SIZE(fh_tbl); i++)
1679 pos += scnprintf(*buf + pos, bufsz - pos, 1680 pos += scnprintf(*buf + pos, bufsz - pos,
1680 " %34s: 0X%08x\n", 1681 " %34s: 0X%08x\n",
1681 get_fh_string(fh_tbl[i]), 1682 get_fh_string(fh_tbl[i]),
1682 iwl_read_direct32(trans, fh_tbl[i])); 1683 iwl_read_direct32(trans, fh_tbl[i]));
1683 } 1684
1684 return pos; 1685 return pos;
1685 } 1686 }
1686#endif 1687#endif
1688
1687 IWL_ERR(trans, "FH register values:\n"); 1689 IWL_ERR(trans, "FH register values:\n");
1688 for (i = 0; i < ARRAY_SIZE(fh_tbl); i++) { 1690 for (i = 0; i < ARRAY_SIZE(fh_tbl); i++)
1689 IWL_ERR(trans, " %34s: 0X%08x\n", 1691 IWL_ERR(trans, " %34s: 0X%08x\n",
1690 get_fh_string(fh_tbl[i]), 1692 get_fh_string(fh_tbl[i]),
1691 iwl_read_direct32(trans, fh_tbl[i])); 1693 iwl_read_direct32(trans, fh_tbl[i]));
1692 } 1694
1693 return 0; 1695 return 0;
1694} 1696}
1695 1697
@@ -1982,11 +1984,11 @@ static ssize_t iwl_dbgfs_fh_reg_read(struct file *file,
1982 size_t count, loff_t *ppos) 1984 size_t count, loff_t *ppos)
1983{ 1985{
1984 struct iwl_trans *trans = file->private_data; 1986 struct iwl_trans *trans = file->private_data;
1985 char *buf; 1987 char *buf = NULL;
1986 int pos = 0; 1988 int pos = 0;
1987 ssize_t ret = -EFAULT; 1989 ssize_t ret = -EFAULT;
1988 1990
1989 ret = pos = iwl_dump_fh(trans, &buf, true); 1991 ret = pos = iwl_dump_fh(trans, &buf);
1990 if (buf) { 1992 if (buf) {
1991 ret = simple_read_from_buffer(user_buf, 1993 ret = simple_read_from_buffer(user_buf,
1992 count, ppos, buf, pos); 1994 count, ppos, buf, pos);
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index e970897f6ab5..4cb234349fbf 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -1326,6 +1326,11 @@ static int if_sdio_suspend(struct device *dev)
1326 1326
1327 mmc_pm_flag_t flags = sdio_get_host_pm_caps(func); 1327 mmc_pm_flag_t flags = sdio_get_host_pm_caps(func);
1328 1328
1329 /* If we're powered off anyway, just let the mmc layer remove the
1330 * card. */
1331 if (!lbs_iface_active(card->priv))
1332 return -ENOSYS;
1333
1329 dev_info(dev, "%s: suspend: PM flags = 0x%x\n", 1334 dev_info(dev, "%s: suspend: PM flags = 0x%x\n",
1330 sdio_func_id(func), flags); 1335 sdio_func_id(func), flags);
1331 1336
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c
index c68adec3cc8b..565527aee0ea 100644
--- a/drivers/net/wireless/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/mwifiex/cmdevt.c
@@ -170,7 +170,20 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv,
170 cmd_code = le16_to_cpu(host_cmd->command); 170 cmd_code = le16_to_cpu(host_cmd->command);
171 cmd_size = le16_to_cpu(host_cmd->size); 171 cmd_size = le16_to_cpu(host_cmd->size);
172 172
173 skb_trim(cmd_node->cmd_skb, cmd_size); 173 /* Adjust skb length */
174 if (cmd_node->cmd_skb->len > cmd_size)
175 /*
176 * cmd_size is less than sizeof(struct host_cmd_ds_command).
177 * Trim off the unused portion.
178 */
179 skb_trim(cmd_node->cmd_skb, cmd_size);
180 else if (cmd_node->cmd_skb->len < cmd_size)
181 /*
182 * cmd_size is larger than sizeof(struct host_cmd_ds_command)
183 * because we have appended custom IE TLV. Increase skb length
184 * accordingly.
185 */
186 skb_put(cmd_node->cmd_skb, cmd_size - cmd_node->cmd_skb->len);
174 187
175 do_gettimeofday(&tstamp); 188 do_gettimeofday(&tstamp);
176 dev_dbg(adapter->dev, "cmd: DNLD_CMD: (%lu.%lu): %#x, act %#x, len %d," 189 dev_dbg(adapter->dev, "cmd: DNLD_CMD: (%lu.%lu): %#x, act %#x, len %d,"
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
index 7f207b6e9552..effb044a8a9d 100644
--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -42,7 +42,7 @@ MODULE_FIRMWARE("isl3887usb");
42 * whenever you add a new device. 42 * whenever you add a new device.
43 */ 43 */
44 44
45static struct usb_device_id p54u_table[] __devinitdata = { 45static struct usb_device_id p54u_table[] = {
46 /* Version 1 devices (pci chip + net2280) */ 46 /* Version 1 devices (pci chip + net2280) */
47 {USB_DEVICE(0x0411, 0x0050)}, /* Buffalo WLI2-USB2-G54 */ 47 {USB_DEVICE(0x0411, 0x0050)}, /* Buffalo WLI2-USB2-G54 */
48 {USB_DEVICE(0x045e, 0x00c2)}, /* Microsoft MN-710 */ 48 {USB_DEVICE(0x045e, 0x00c2)}, /* Microsoft MN-710 */
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index 241162e8111d..7a4ae9ee1c63 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -1803,6 +1803,7 @@ static struct ndis_80211_pmkid *update_pmkid(struct usbnet *usbdev,
1803 struct cfg80211_pmksa *pmksa, 1803 struct cfg80211_pmksa *pmksa,
1804 int max_pmkids) 1804 int max_pmkids)
1805{ 1805{
1806 struct ndis_80211_pmkid *new_pmkids;
1806 int i, err, newlen; 1807 int i, err, newlen;
1807 unsigned int count; 1808 unsigned int count;
1808 1809
@@ -1833,11 +1834,12 @@ static struct ndis_80211_pmkid *update_pmkid(struct usbnet *usbdev,
1833 /* add new pmkid */ 1834 /* add new pmkid */
1834 newlen = sizeof(*pmkids) + (count + 1) * sizeof(pmkids->bssid_info[0]); 1835 newlen = sizeof(*pmkids) + (count + 1) * sizeof(pmkids->bssid_info[0]);
1835 1836
1836 pmkids = krealloc(pmkids, newlen, GFP_KERNEL); 1837 new_pmkids = krealloc(pmkids, newlen, GFP_KERNEL);
1837 if (!pmkids) { 1838 if (!new_pmkids) {
1838 err = -ENOMEM; 1839 err = -ENOMEM;
1839 goto error; 1840 goto error;
1840 } 1841 }
1842 pmkids = new_pmkids;
1841 1843
1842 pmkids->length = cpu_to_le32(newlen); 1844 pmkids->length = cpu_to_le32(newlen);
1843 pmkids->bssid_info_count = cpu_to_le32(count + 1); 1845 pmkids->bssid_info_count = cpu_to_le32(count + 1);
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 8b9dbd76a252..64328af496f5 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1611,6 +1611,7 @@ static int rt2400pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
1611static int rt2400pci_probe_hw(struct rt2x00_dev *rt2x00dev) 1611static int rt2400pci_probe_hw(struct rt2x00_dev *rt2x00dev)
1612{ 1612{
1613 int retval; 1613 int retval;
1614 u32 reg;
1614 1615
1615 /* 1616 /*
1616 * Allocate eeprom data. 1617 * Allocate eeprom data.
@@ -1624,6 +1625,14 @@ static int rt2400pci_probe_hw(struct rt2x00_dev *rt2x00dev)
1624 return retval; 1625 return retval;
1625 1626
1626 /* 1627 /*
1628 * Enable rfkill polling by setting GPIO direction of the
1629 * rfkill switch GPIO pin correctly.
1630 */
1631 rt2x00pci_register_read(rt2x00dev, GPIOCSR, &reg);
1632 rt2x00_set_field32(&reg, GPIOCSR_BIT8, 1);
1633 rt2x00pci_register_write(rt2x00dev, GPIOCSR, reg);
1634
1635 /*
1627 * Initialize hw specifications. 1636 * Initialize hw specifications.
1628 */ 1637 */
1629 retval = rt2400pci_probe_hw_mode(rt2x00dev); 1638 retval = rt2400pci_probe_hw_mode(rt2x00dev);
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.h b/drivers/net/wireless/rt2x00/rt2400pci.h
index d3a4a68cc439..7564ae992b73 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.h
+++ b/drivers/net/wireless/rt2x00/rt2400pci.h
@@ -670,6 +670,7 @@
670#define GPIOCSR_BIT5 FIELD32(0x00000020) 670#define GPIOCSR_BIT5 FIELD32(0x00000020)
671#define GPIOCSR_BIT6 FIELD32(0x00000040) 671#define GPIOCSR_BIT6 FIELD32(0x00000040)
672#define GPIOCSR_BIT7 FIELD32(0x00000080) 672#define GPIOCSR_BIT7 FIELD32(0x00000080)
673#define GPIOCSR_BIT8 FIELD32(0x00000100)
673 674
674/* 675/*
675 * BBPPCSR: BBP Pin control register. 676 * BBPPCSR: BBP Pin control register.
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index d2cf8a4bc8b5..3de0406735f6 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1929,6 +1929,7 @@ static int rt2500pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
1929static int rt2500pci_probe_hw(struct rt2x00_dev *rt2x00dev) 1929static int rt2500pci_probe_hw(struct rt2x00_dev *rt2x00dev)
1930{ 1930{
1931 int retval; 1931 int retval;
1932 u32 reg;
1932 1933
1933 /* 1934 /*
1934 * Allocate eeprom data. 1935 * Allocate eeprom data.
@@ -1942,6 +1943,14 @@ static int rt2500pci_probe_hw(struct rt2x00_dev *rt2x00dev)
1942 return retval; 1943 return retval;
1943 1944
1944 /* 1945 /*
1946 * Enable rfkill polling by setting GPIO direction of the
1947 * rfkill switch GPIO pin correctly.
1948 */
1949 rt2x00pci_register_read(rt2x00dev, GPIOCSR, &reg);
1950 rt2x00_set_field32(&reg, GPIOCSR_DIR0, 1);
1951 rt2x00pci_register_write(rt2x00dev, GPIOCSR, reg);
1952
1953 /*
1945 * Initialize hw specifications. 1954 * Initialize hw specifications.
1946 */ 1955 */
1947 retval = rt2500pci_probe_hw_mode(rt2x00dev); 1956 retval = rt2500pci_probe_hw_mode(rt2x00dev);
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 3aae36bb0a9e..89fee311d8fd 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -283,7 +283,7 @@ static int rt2500usb_rfkill_poll(struct rt2x00_dev *rt2x00dev)
283 u16 reg; 283 u16 reg;
284 284
285 rt2500usb_register_read(rt2x00dev, MAC_CSR19, &reg); 285 rt2500usb_register_read(rt2x00dev, MAC_CSR19, &reg);
286 return rt2x00_get_field32(reg, MAC_CSR19_BIT7); 286 return rt2x00_get_field16(reg, MAC_CSR19_BIT7);
287} 287}
288 288
289#ifdef CONFIG_RT2X00_LIB_LEDS 289#ifdef CONFIG_RT2X00_LIB_LEDS
@@ -1768,6 +1768,7 @@ static int rt2500usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
1768static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev) 1768static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev)
1769{ 1769{
1770 int retval; 1770 int retval;
1771 u16 reg;
1771 1772
1772 /* 1773 /*
1773 * Allocate eeprom data. 1774 * Allocate eeprom data.
@@ -1781,6 +1782,14 @@ static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev)
1781 return retval; 1782 return retval;
1782 1783
1783 /* 1784 /*
1785 * Enable rfkill polling by setting GPIO direction of the
1786 * rfkill switch GPIO pin correctly.
1787 */
1788 rt2500usb_register_read(rt2x00dev, MAC_CSR19, &reg);
1789 rt2x00_set_field16(&reg, MAC_CSR19_BIT8, 0);
1790 rt2500usb_register_write(rt2x00dev, MAC_CSR19, reg);
1791
1792 /*
1784 * Initialize hw specifications. 1793 * Initialize hw specifications.
1785 */ 1794 */
1786 retval = rt2500usb_probe_hw_mode(rt2x00dev); 1795 retval = rt2500usb_probe_hw_mode(rt2x00dev);
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.h b/drivers/net/wireless/rt2x00/rt2500usb.h
index b493306a7eed..196bd5103e4f 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.h
+++ b/drivers/net/wireless/rt2x00/rt2500usb.h
@@ -189,14 +189,15 @@
189 * MAC_CSR19: GPIO control register. 189 * MAC_CSR19: GPIO control register.
190 */ 190 */
191#define MAC_CSR19 0x0426 191#define MAC_CSR19 0x0426
192#define MAC_CSR19_BIT0 FIELD32(0x0001) 192#define MAC_CSR19_BIT0 FIELD16(0x0001)
193#define MAC_CSR19_BIT1 FIELD32(0x0002) 193#define MAC_CSR19_BIT1 FIELD16(0x0002)
194#define MAC_CSR19_BIT2 FIELD32(0x0004) 194#define MAC_CSR19_BIT2 FIELD16(0x0004)
195#define MAC_CSR19_BIT3 FIELD32(0x0008) 195#define MAC_CSR19_BIT3 FIELD16(0x0008)
196#define MAC_CSR19_BIT4 FIELD32(0x0010) 196#define MAC_CSR19_BIT4 FIELD16(0x0010)
197#define MAC_CSR19_BIT5 FIELD32(0x0020) 197#define MAC_CSR19_BIT5 FIELD16(0x0020)
198#define MAC_CSR19_BIT6 FIELD32(0x0040) 198#define MAC_CSR19_BIT6 FIELD16(0x0040)
199#define MAC_CSR19_BIT7 FIELD32(0x0080) 199#define MAC_CSR19_BIT7 FIELD16(0x0080)
200#define MAC_CSR19_BIT8 FIELD16(0x0100)
200 201
201/* 202/*
202 * MAC_CSR20: LED control register. 203 * MAC_CSR20: LED control register.
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index cb8c2aca54e4..b93516d832fb 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -4089,6 +4089,7 @@ static int rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev)
4089 rt2800_register_write(rt2x00dev, LDO_CFG0, reg); 4089 rt2800_register_write(rt2x00dev, LDO_CFG0, reg);
4090 msleep(1); 4090 msleep(1);
4091 rt2800_register_read(rt2x00dev, LDO_CFG0, &reg); 4091 rt2800_register_read(rt2x00dev, LDO_CFG0, &reg);
4092 rt2x00_set_field32(&reg, LDO_CFG0_LDO_CORE_VLEVEL, 0);
4092 rt2x00_set_field32(&reg, LDO_CFG0_BGSEL, 1); 4093 rt2x00_set_field32(&reg, LDO_CFG0_BGSEL, 1);
4093 rt2800_register_write(rt2x00dev, LDO_CFG0, reg); 4094 rt2800_register_write(rt2x00dev, LDO_CFG0, reg);
4094 } 4095 }
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index 98aa426a3564..4765bbd654cd 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -983,6 +983,7 @@ static int rt2800pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
983static int rt2800pci_probe_hw(struct rt2x00_dev *rt2x00dev) 983static int rt2800pci_probe_hw(struct rt2x00_dev *rt2x00dev)
984{ 984{
985 int retval; 985 int retval;
986 u32 reg;
986 987
987 /* 988 /*
988 * Allocate eeprom data. 989 * Allocate eeprom data.
@@ -996,6 +997,14 @@ static int rt2800pci_probe_hw(struct rt2x00_dev *rt2x00dev)
996 return retval; 997 return retval;
997 998
998 /* 999 /*
1000 * Enable rfkill polling by setting GPIO direction of the
1001 * rfkill switch GPIO pin correctly.
1002 */
1003 rt2x00pci_register_read(rt2x00dev, GPIO_CTRL_CFG, &reg);
1004 rt2x00_set_field32(&reg, GPIO_CTRL_CFG_GPIOD_BIT2, 1);
1005 rt2x00pci_register_write(rt2x00dev, GPIO_CTRL_CFG, reg);
1006
1007 /*
999 * Initialize hw specifications. 1008 * Initialize hw specifications.
1000 */ 1009 */
1001 retval = rt2800_probe_hw_mode(rt2x00dev); 1010 retval = rt2800_probe_hw_mode(rt2x00dev);
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index 6cf336595e25..6b4226b71618 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -667,8 +667,16 @@ static void rt2800usb_fill_rxdone(struct queue_entry *entry,
667 skb_pull(entry->skb, RXINFO_DESC_SIZE); 667 skb_pull(entry->skb, RXINFO_DESC_SIZE);
668 668
669 /* 669 /*
670 * FIXME: we need to check for rx_pkt_len validity 670 * Check for rx_pkt_len validity. Return if invalid, leaving
671 * rxdesc->size zeroed out by the upper level.
671 */ 672 */
673 if (unlikely(rx_pkt_len == 0 ||
674 rx_pkt_len > entry->queue->data_size)) {
675 ERROR(entry->queue->rt2x00dev,
676 "Bad frame size %d, forcing to 0\n", rx_pkt_len);
677 return;
678 }
679
672 rxd = (__le32 *)(entry->skb->data + rx_pkt_len); 680 rxd = (__le32 *)(entry->skb->data + rx_pkt_len);
673 681
674 /* 682 /*
@@ -736,6 +744,7 @@ static int rt2800usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
736static int rt2800usb_probe_hw(struct rt2x00_dev *rt2x00dev) 744static int rt2800usb_probe_hw(struct rt2x00_dev *rt2x00dev)
737{ 745{
738 int retval; 746 int retval;
747 u32 reg;
739 748
740 /* 749 /*
741 * Allocate eeprom data. 750 * Allocate eeprom data.
@@ -749,6 +758,14 @@ static int rt2800usb_probe_hw(struct rt2x00_dev *rt2x00dev)
749 return retval; 758 return retval;
750 759
751 /* 760 /*
761 * Enable rfkill polling by setting GPIO direction of the
762 * rfkill switch GPIO pin correctly.
763 */
764 rt2x00usb_register_read(rt2x00dev, GPIO_CTRL_CFG, &reg);
765 rt2x00_set_field32(&reg, GPIO_CTRL_CFG_GPIOD_BIT2, 1);
766 rt2x00usb_register_write(rt2x00dev, GPIO_CTRL_CFG, reg);
767
768 /*
752 * Initialize hw specifications. 769 * Initialize hw specifications.
753 */ 770 */
754 retval = rt2800_probe_hw_mode(rt2x00dev); 771 retval = rt2800_probe_hw_mode(rt2x00dev);
@@ -1157,6 +1174,8 @@ static struct usb_device_id rt2800usb_device_table[] = {
1157 { USB_DEVICE(0x1690, 0x0744) }, 1174 { USB_DEVICE(0x1690, 0x0744) },
1158 { USB_DEVICE(0x1690, 0x0761) }, 1175 { USB_DEVICE(0x1690, 0x0761) },
1159 { USB_DEVICE(0x1690, 0x0764) }, 1176 { USB_DEVICE(0x1690, 0x0764) },
1177 /* ASUS */
1178 { USB_DEVICE(0x0b05, 0x179d) },
1160 /* Cisco */ 1179 /* Cisco */
1161 { USB_DEVICE(0x167b, 0x4001) }, 1180 { USB_DEVICE(0x167b, 0x4001) },
1162 /* EnGenius */ 1181 /* EnGenius */
@@ -1222,7 +1241,6 @@ static struct usb_device_id rt2800usb_device_table[] = {
1222 { USB_DEVICE(0x0b05, 0x1760) }, 1241 { USB_DEVICE(0x0b05, 0x1760) },
1223 { USB_DEVICE(0x0b05, 0x1761) }, 1242 { USB_DEVICE(0x0b05, 0x1761) },
1224 { USB_DEVICE(0x0b05, 0x1790) }, 1243 { USB_DEVICE(0x0b05, 0x1790) },
1225 { USB_DEVICE(0x0b05, 0x179d) },
1226 /* AzureWave */ 1244 /* AzureWave */
1227 { USB_DEVICE(0x13d3, 0x3262) }, 1245 { USB_DEVICE(0x13d3, 0x3262) },
1228 { USB_DEVICE(0x13d3, 0x3284) }, 1246 { USB_DEVICE(0x13d3, 0x3284) },
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index a6b88bd4a1a5..3f07e36f462b 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -629,7 +629,7 @@ void rt2x00lib_rxdone(struct queue_entry *entry, gfp_t gfp)
629 */ 629 */
630 if (unlikely(rxdesc.size == 0 || 630 if (unlikely(rxdesc.size == 0 ||
631 rxdesc.size > entry->queue->data_size)) { 631 rxdesc.size > entry->queue->data_size)) {
632 WARNING(rt2x00dev, "Wrong frame size %d max %d.\n", 632 ERROR(rt2x00dev, "Wrong frame size %d max %d.\n",
633 rxdesc.size, entry->queue->data_size); 633 rxdesc.size, entry->queue->data_size);
634 dev_kfree_skb(entry->skb); 634 dev_kfree_skb(entry->skb);
635 goto renew_skb; 635 goto renew_skb;
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 3f7bc5cadf9a..b8ec96163922 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2832,6 +2832,7 @@ static int rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
2832static int rt61pci_probe_hw(struct rt2x00_dev *rt2x00dev) 2832static int rt61pci_probe_hw(struct rt2x00_dev *rt2x00dev)
2833{ 2833{
2834 int retval; 2834 int retval;
2835 u32 reg;
2835 2836
2836 /* 2837 /*
2837 * Disable power saving. 2838 * Disable power saving.
@@ -2850,6 +2851,14 @@ static int rt61pci_probe_hw(struct rt2x00_dev *rt2x00dev)
2850 return retval; 2851 return retval;
2851 2852
2852 /* 2853 /*
2854 * Enable rfkill polling by setting GPIO direction of the
2855 * rfkill switch GPIO pin correctly.
2856 */
2857 rt2x00pci_register_read(rt2x00dev, MAC_CSR13, &reg);
2858 rt2x00_set_field32(&reg, MAC_CSR13_BIT13, 1);
2859 rt2x00pci_register_write(rt2x00dev, MAC_CSR13, reg);
2860
2861 /*
2853 * Initialize hw specifications. 2862 * Initialize hw specifications.
2854 */ 2863 */
2855 retval = rt61pci_probe_hw_mode(rt2x00dev); 2864 retval = rt61pci_probe_hw_mode(rt2x00dev);
diff --git a/drivers/net/wireless/rt2x00/rt61pci.h b/drivers/net/wireless/rt2x00/rt61pci.h
index e3cd6db76b0e..8f3da5a56766 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.h
+++ b/drivers/net/wireless/rt2x00/rt61pci.h
@@ -372,6 +372,7 @@ struct hw_pairwise_ta_entry {
372#define MAC_CSR13_BIT10 FIELD32(0x00000400) 372#define MAC_CSR13_BIT10 FIELD32(0x00000400)
373#define MAC_CSR13_BIT11 FIELD32(0x00000800) 373#define MAC_CSR13_BIT11 FIELD32(0x00000800)
374#define MAC_CSR13_BIT12 FIELD32(0x00001000) 374#define MAC_CSR13_BIT12 FIELD32(0x00001000)
375#define MAC_CSR13_BIT13 FIELD32(0x00002000)
375 376
376/* 377/*
377 * MAC_CSR14: LED control register. 378 * MAC_CSR14: LED control register.
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index ba6e434b859d..248436c13ce0 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2177,6 +2177,7 @@ static int rt73usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
2177static int rt73usb_probe_hw(struct rt2x00_dev *rt2x00dev) 2177static int rt73usb_probe_hw(struct rt2x00_dev *rt2x00dev)
2178{ 2178{
2179 int retval; 2179 int retval;
2180 u32 reg;
2180 2181
2181 /* 2182 /*
2182 * Allocate eeprom data. 2183 * Allocate eeprom data.
@@ -2190,6 +2191,14 @@ static int rt73usb_probe_hw(struct rt2x00_dev *rt2x00dev)
2190 return retval; 2191 return retval;
2191 2192
2192 /* 2193 /*
2194 * Enable rfkill polling by setting GPIO direction of the
2195 * rfkill switch GPIO pin correctly.
2196 */
2197 rt2x00usb_register_read(rt2x00dev, MAC_CSR13, &reg);
2198 rt2x00_set_field32(&reg, MAC_CSR13_BIT15, 0);
2199 rt2x00usb_register_write(rt2x00dev, MAC_CSR13, reg);
2200
2201 /*
2193 * Initialize hw specifications. 2202 * Initialize hw specifications.
2194 */ 2203 */
2195 retval = rt73usb_probe_hw_mode(rt2x00dev); 2204 retval = rt73usb_probe_hw_mode(rt2x00dev);
diff --git a/drivers/net/wireless/rt2x00/rt73usb.h b/drivers/net/wireless/rt2x00/rt73usb.h
index 9f6b470414d3..df1cc116b83b 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.h
+++ b/drivers/net/wireless/rt2x00/rt73usb.h
@@ -282,6 +282,9 @@ struct hw_pairwise_ta_entry {
282#define MAC_CSR13_BIT10 FIELD32(0x00000400) 282#define MAC_CSR13_BIT10 FIELD32(0x00000400)
283#define MAC_CSR13_BIT11 FIELD32(0x00000800) 283#define MAC_CSR13_BIT11 FIELD32(0x00000800)
284#define MAC_CSR13_BIT12 FIELD32(0x00001000) 284#define MAC_CSR13_BIT12 FIELD32(0x00001000)
285#define MAC_CSR13_BIT13 FIELD32(0x00002000)
286#define MAC_CSR13_BIT14 FIELD32(0x00004000)
287#define MAC_CSR13_BIT15 FIELD32(0x00008000)
285 288
286/* 289/*
287 * MAC_CSR14: LED control register. 290 * MAC_CSR14: LED control register.
diff --git a/drivers/net/wireless/rtl818x/rtl8187/dev.c b/drivers/net/wireless/rtl818x/rtl8187/dev.c
index 71a30b026089..533024095c43 100644
--- a/drivers/net/wireless/rtl818x/rtl8187/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c
@@ -44,7 +44,7 @@ MODULE_AUTHOR("Larry Finger <Larry.Finger@lwfinger.net>");
44MODULE_DESCRIPTION("RTL8187/RTL8187B USB wireless driver"); 44MODULE_DESCRIPTION("RTL8187/RTL8187B USB wireless driver");
45MODULE_LICENSE("GPL"); 45MODULE_LICENSE("GPL");
46 46
47static struct usb_device_id rtl8187_table[] __devinitdata = { 47static struct usb_device_id rtl8187_table[] = {
48 /* Asus */ 48 /* Asus */
49 {USB_DEVICE(0x0b05, 0x171d), .driver_info = DEVICE_RTL8187}, 49 {USB_DEVICE(0x0b05, 0x171d), .driver_info = DEVICE_RTL8187},
50 /* Belkin */ 50 /* Belkin */