aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-06-25 13:06:12 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-06-25 13:10:36 -0400
commit7b0cfee1a24efdfe0235bac62e53f686fe8a8e24 (patch)
treeeeeb8cc3bf7be5ec0e54b7c4f3808ef88ecca012 /drivers/net/wireless
parent9756fe38d10b2bf90c81dc4d2f17d5632e135364 (diff)
parent6b16351acbd415e66ba16bf7d473ece1574cf0bc (diff)
Merge tag 'v3.5-rc4' into drm-intel-next-queued
I want to merge the "no more fake agp on gen6+" patches into drm-intel-next (well, the last pieces). But a patch in 3.5-rc4 also adds a new use of dev->agp. Hence the backmarge to sort this out, for otherwise drm-intel-next merged into Linus' tree would conflict in the relevant code, things would compile but nicely OOPS at driver load :( Conflicts in this merge are just simple cases of "both branches changed/added lines at the same place". The only tricky part is to keep the order correct wrt the unwind code in case of errors in intel_ringbuffer.c (and the MI_DISPLAY_FLIP #defines in i915_reg.h together, obviously). Conflicts: drivers/gpu/drm/i915/i915_reg.h drivers/gpu/drm/i915/intel_ringbuffer.c Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c19
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_eeprom.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_eeprom.h3
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h178
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c7
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c16
-rw-r--r--drivers/net/wireless/b43/b43.h4
-rw-r--r--drivers/net/wireless/b43/main.c21
-rw-r--r--drivers/net/wireless/b43legacy/main.c2
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c4
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/usb.c5
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2100.c20
-rw-r--r--drivers/net/wireless/iwlwifi/Kconfig8
-rw-r--r--drivers/net/wireless/iwlwifi/Makefile1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-2000.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-6000.c29
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-sta.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-drv.c23
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-eeprom.c18
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-mac80211.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-phy-db.c288
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-phy-db.h129
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-prph.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c22
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans-pcie.c9
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c22
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c13
-rw-r--r--drivers/net/wireless/mwifiex/fw.h6
-rw-r--r--drivers/net/wireless/mwifiex/uap_cmd.c10
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h3
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c1
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c13
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187/leds.c2
-rw-r--r--drivers/net/wireless/ti/wl1251/sdio.c2
-rw-r--r--drivers/net/wireless/ti/wl1251/spi.c3
-rw-r--r--drivers/net/wireless/ti/wlcore/acx.c2
-rw-r--r--drivers/net/wireless/ti/wlcore/acx.h4
-rw-r--r--drivers/net/wireless/ti/wlcore/rx.c2
41 files changed, 303 insertions, 606 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 0ba81a66061f..fbaa30930076 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2415,6 +2415,22 @@ ath5k_tx_complete_poll_work(struct work_struct *work)
2415* Initialization routines * 2415* Initialization routines *
2416\*************************/ 2416\*************************/
2417 2417
2418static const struct ieee80211_iface_limit if_limits[] = {
2419 { .max = 2048, .types = BIT(NL80211_IFTYPE_STATION) },
2420 { .max = 4, .types =
2421#ifdef CONFIG_MAC80211_MESH
2422 BIT(NL80211_IFTYPE_MESH_POINT) |
2423#endif
2424 BIT(NL80211_IFTYPE_AP) },
2425};
2426
2427static const struct ieee80211_iface_combination if_comb = {
2428 .limits = if_limits,
2429 .n_limits = ARRAY_SIZE(if_limits),
2430 .max_interfaces = 2048,
2431 .num_different_channels = 1,
2432};
2433
2418int __devinit 2434int __devinit
2419ath5k_init_ah(struct ath5k_hw *ah, const struct ath_bus_ops *bus_ops) 2435ath5k_init_ah(struct ath5k_hw *ah, const struct ath_bus_ops *bus_ops)
2420{ 2436{
@@ -2436,6 +2452,9 @@ ath5k_init_ah(struct ath5k_hw *ah, const struct ath_bus_ops *bus_ops)
2436 BIT(NL80211_IFTYPE_ADHOC) | 2452 BIT(NL80211_IFTYPE_ADHOC) |
2437 BIT(NL80211_IFTYPE_MESH_POINT); 2453 BIT(NL80211_IFTYPE_MESH_POINT);
2438 2454
2455 hw->wiphy->iface_combinations = &if_comb;
2456 hw->wiphy->n_iface_combinations = 1;
2457
2439 /* SW support for IBSS_RSN is provided by mac80211 */ 2458 /* SW support for IBSS_RSN is provided by mac80211 */
2440 hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; 2459 hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
2441 2460
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index ac53d901801d..dfb0441f406c 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -3809,7 +3809,7 @@ static bool is_pmu_set(struct ath_hw *ah, u32 pmu_reg, int pmu_set)
3809 return true; 3809 return true;
3810} 3810}
3811 3811
3812static void ar9003_hw_internal_regulator_apply(struct ath_hw *ah) 3812void ar9003_hw_internal_regulator_apply(struct ath_hw *ah)
3813{ 3813{
3814 int internal_regulator = 3814 int internal_regulator =
3815 ath9k_hw_ar9300_get_eeprom(ah, EEP_INTERNAL_REGULATOR); 3815 ath9k_hw_ar9300_get_eeprom(ah, EEP_INTERNAL_REGULATOR);
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
index 2505ac44f0c1..8396d150ce01 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
@@ -334,4 +334,7 @@ u8 *ar9003_get_spur_chan_ptr(struct ath_hw *ah, bool is_2ghz);
334 334
335unsigned int ar9003_get_paprd_scale_factor(struct ath_hw *ah, 335unsigned int ar9003_get_paprd_scale_factor(struct ath_hw *ah,
336 struct ath9k_channel *chan); 336 struct ath9k_channel *chan);
337
338void ar9003_hw_internal_regulator_apply(struct ath_hw *ah);
339
337#endif 340#endif
diff --git a/drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h b/drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h
index f11d9b2677fd..1bd3a3d22101 100644
--- a/drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h
@@ -1,5 +1,6 @@
1/* 1/*
2 * Copyright (c) 2011 Atheros Communications Inc. 2 * Copyright (c) 2010-2011 Atheros Communications Inc.
3 * Copyright (c) 2011-2012 Qualcomm Atheros Inc.
3 * 4 *
4 * Permission to use, copy, modify, and/or distribute this software for any 5 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above 6 * purpose with or without fee is hereby granted, provided that the above
@@ -18,7 +19,7 @@
18#define INITVALS_9330_1P1_H 19#define INITVALS_9330_1P1_H
19 20
20static const u32 ar9331_1p1_baseband_postamble[][5] = { 21static const u32 ar9331_1p1_baseband_postamble[][5] = {
21 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ 22 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
22 {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8005, 0xd00a8005}, 23 {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8005, 0xd00a8005},
23 {0x00009820, 0x206a002e, 0x206a002e, 0x206a002e, 0x206a002e}, 24 {0x00009820, 0x206a002e, 0x206a002e, 0x206a002e, 0x206a002e},
24 {0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0}, 25 {0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0},
@@ -27,10 +28,10 @@ static const u32 ar9331_1p1_baseband_postamble[][5] = {
27 {0x00009830, 0x0000059c, 0x0000059c, 0x0000059c, 0x0000059c}, 28 {0x00009830, 0x0000059c, 0x0000059c, 0x0000059c, 0x0000059c},
28 {0x00009c00, 0x00000044, 0x00000044, 0x00000044, 0x00000044}, 29 {0x00009c00, 0x00000044, 0x00000044, 0x00000044, 0x00000044},
29 {0x00009e00, 0x0372161e, 0x0372161e, 0x037216a4, 0x037216a4}, 30 {0x00009e00, 0x0372161e, 0x0372161e, 0x037216a4, 0x037216a4},
30 {0x00009e04, 0x00182020, 0x00182020, 0x00182020, 0x00182020}, 31 {0x00009e04, 0x00202020, 0x00202020, 0x00202020, 0x00202020},
31 {0x00009e0c, 0x6c4000e2, 0x6d4000e2, 0x6d4000e2, 0x6c4000e2}, 32 {0x00009e0c, 0x6c4000e2, 0x6d4000e2, 0x6d4000e2, 0x6c4000e2},
32 {0x00009e10, 0x7ec80d2e, 0x7ec80d2e, 0x7ec80d2e, 0x7ec80d2e}, 33 {0x00009e10, 0x7ec80d2e, 0x7ec80d2e, 0x7ec80d2e, 0x7ec80d2e},
33 {0x00009e14, 0x31395d5e, 0x3139605e, 0x3139605e, 0x31395d5e}, 34 {0x00009e14, 0x31365d5e, 0x3136605e, 0x3136605e, 0x31365d5e},
34 {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 35 {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
35 {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c}, 36 {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
36 {0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce}, 37 {0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce},
@@ -55,7 +56,7 @@ static const u32 ar9331_1p1_baseband_postamble[][5] = {
55 {0x0000a288, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 56 {0x0000a288, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
56 {0x0000a28c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 57 {0x0000a28c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
57 {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18}, 58 {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
58 {0x0000a2d0, 0x00071981, 0x00071981, 0x00071981, 0x00071981}, 59 {0x0000a2d0, 0x00071982, 0x00071982, 0x00071982, 0x00071982},
59 {0x0000a2d8, 0xf999a83a, 0xf999a83a, 0xf999a83a, 0xf999a83a}, 60 {0x0000a2d8, 0xf999a83a, 0xf999a83a, 0xf999a83a, 0xf999a83a},
60 {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 61 {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
61 {0x0000ae04, 0x00802020, 0x00802020, 0x00802020, 0x00802020}, 62 {0x0000ae04, 0x00802020, 0x00802020, 0x00802020, 0x00802020},
@@ -63,7 +64,7 @@ static const u32 ar9331_1p1_baseband_postamble[][5] = {
63}; 64};
64 65
65static const u32 ar9331_modes_lowest_ob_db_tx_gain_1p1[][5] = { 66static const u32 ar9331_modes_lowest_ob_db_tx_gain_1p1[][5] = {
66 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ 67 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
67 {0x0000a2d8, 0x7999a83a, 0x7999a83a, 0x7999a83a, 0x7999a83a}, 68 {0x0000a2d8, 0x7999a83a, 0x7999a83a, 0x7999a83a, 0x7999a83a},
68 {0x0000a2dc, 0xffff2a52, 0xffff2a52, 0xffff2a52, 0xffff2a52}, 69 {0x0000a2dc, 0xffff2a52, 0xffff2a52, 0xffff2a52, 0xffff2a52},
69 {0x0000a2e0, 0xffffcc84, 0xffffcc84, 0xffffcc84, 0xffffcc84}, 70 {0x0000a2e0, 0xffffcc84, 0xffffcc84, 0xffffcc84, 0xffffcc84},
@@ -155,7 +156,7 @@ static const u32 ar9331_modes_lowest_ob_db_tx_gain_1p1[][5] = {
155}; 156};
156 157
157static const u32 ar9331_modes_high_ob_db_tx_gain_1p1[][5] = { 158static const u32 ar9331_modes_high_ob_db_tx_gain_1p1[][5] = {
158 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ 159 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
159 {0x0000a2d8, 0x7999a83a, 0x7999a83a, 0x7999a83a, 0x7999a83a}, 160 {0x0000a2d8, 0x7999a83a, 0x7999a83a, 0x7999a83a, 0x7999a83a},
160 {0x0000a2dc, 0xffaa9a52, 0xffaa9a52, 0xffaa9a52, 0xffaa9a52}, 161 {0x0000a2dc, 0xffaa9a52, 0xffaa9a52, 0xffaa9a52, 0xffaa9a52},
161 {0x0000a2e0, 0xffb31c84, 0xffb31c84, 0xffb31c84, 0xffb31c84}, 162 {0x0000a2e0, 0xffb31c84, 0xffb31c84, 0xffb31c84, 0xffb31c84},
@@ -245,7 +246,7 @@ static const u32 ar9331_modes_high_ob_db_tx_gain_1p1[][5] = {
245}; 246};
246 247
247static const u32 ar9331_modes_low_ob_db_tx_gain_1p1[][5] = { 248static const u32 ar9331_modes_low_ob_db_tx_gain_1p1[][5] = {
248 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ 249 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
249 {0x0000a2d8, 0x7999a83a, 0x7999a83a, 0x7999a83a, 0x7999a83a}, 250 {0x0000a2d8, 0x7999a83a, 0x7999a83a, 0x7999a83a, 0x7999a83a},
250 {0x0000a2dc, 0xffff2a52, 0xffff2a52, 0xffff2a52, 0xffff2a52}, 251 {0x0000a2dc, 0xffff2a52, 0xffff2a52, 0xffff2a52, 0xffff2a52},
251 {0x0000a2e0, 0xffffcc84, 0xffffcc84, 0xffffcc84, 0xffffcc84}, 252 {0x0000a2e0, 0xffffcc84, 0xffffcc84, 0xffffcc84, 0xffffcc84},
@@ -377,14 +378,14 @@ static const u32 ar9331_1p1_radio_core[][2] = {
377 {0x000160b4, 0x92480040}, 378 {0x000160b4, 0x92480040},
378 {0x000160c0, 0x006db6db}, 379 {0x000160c0, 0x006db6db},
379 {0x000160c4, 0x0186db60}, 380 {0x000160c4, 0x0186db60},
380 {0x000160c8, 0x6db6db6c}, 381 {0x000160c8, 0x6db4db6c},
381 {0x000160cc, 0x6de6c300}, 382 {0x000160cc, 0x6de6c300},
382 {0x000160d0, 0x14500820}, 383 {0x000160d0, 0x14500820},
383 {0x00016100, 0x04cb0001}, 384 {0x00016100, 0x04cb0001},
384 {0x00016104, 0xfff80015}, 385 {0x00016104, 0xfff80015},
385 {0x00016108, 0x00080010}, 386 {0x00016108, 0x00080010},
386 {0x0001610c, 0x00170000}, 387 {0x0001610c, 0x00170000},
387 {0x00016140, 0x10804000}, 388 {0x00016140, 0x10800000},
388 {0x00016144, 0x01884080}, 389 {0x00016144, 0x01884080},
389 {0x00016148, 0x000080c0}, 390 {0x00016148, 0x000080c0},
390 {0x00016280, 0x01000015}, 391 {0x00016280, 0x01000015},
@@ -417,7 +418,7 @@ static const u32 ar9331_1p1_radio_core[][2] = {
417}; 418};
418 419
419static const u32 ar9331_1p1_soc_postamble[][5] = { 420static const u32 ar9331_1p1_soc_postamble[][5] = {
420 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ 421 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
421 {0x00007010, 0x00000022, 0x00000022, 0x00000022, 0x00000022}, 422 {0x00007010, 0x00000022, 0x00000022, 0x00000022, 0x00000022},
422}; 423};
423 424
@@ -691,7 +692,7 @@ static const u32 ar9331_1p1_baseband_core[][2] = {
691}; 692};
692 693
693static const u32 ar9331_modes_high_power_tx_gain_1p1[][5] = { 694static const u32 ar9331_modes_high_power_tx_gain_1p1[][5] = {
694 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ 695 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
695 {0x0000a2d8, 0x7999a83a, 0x7999a83a, 0x7999a83a, 0x7999a83a}, 696 {0x0000a2d8, 0x7999a83a, 0x7999a83a, 0x7999a83a, 0x7999a83a},
696 {0x0000a2dc, 0xffff2a52, 0xffff2a52, 0xffff2a52, 0xffff2a52}, 697 {0x0000a2dc, 0xffff2a52, 0xffff2a52, 0xffff2a52, 0xffff2a52},
697 {0x0000a2e0, 0xffffcc84, 0xffffcc84, 0xffffcc84, 0xffffcc84}, 698 {0x0000a2e0, 0xffffcc84, 0xffffcc84, 0xffffcc84, 0xffffcc84},
@@ -783,7 +784,7 @@ static const u32 ar9331_modes_high_power_tx_gain_1p1[][5] = {
783}; 784};
784 785
785static const u32 ar9331_1p1_mac_postamble[][5] = { 786static const u32 ar9331_1p1_mac_postamble[][5] = {
786 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ 787 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
787 {0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160}, 788 {0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160},
788 {0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c}, 789 {0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c},
789 {0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38}, 790 {0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38},
@@ -973,26 +974,27 @@ static const u32 ar9331_1p1_mac_core[][2] = {
973 974
974static const u32 ar9331_common_rx_gain_1p1[][2] = { 975static const u32 ar9331_common_rx_gain_1p1[][2] = {
975 /* Addr allmodes */ 976 /* Addr allmodes */
976 {0x0000a000, 0x00010000}, 977 {0x00009e18, 0x05000000},
977 {0x0000a004, 0x00030002}, 978 {0x0000a000, 0x00060005},
978 {0x0000a008, 0x00050004}, 979 {0x0000a004, 0x00810080},
979 {0x0000a00c, 0x00810080}, 980 {0x0000a008, 0x00830082},
980 {0x0000a010, 0x00830082}, 981 {0x0000a00c, 0x00850084},
981 {0x0000a014, 0x01810180}, 982 {0x0000a010, 0x01820181},
982 {0x0000a018, 0x01830182}, 983 {0x0000a014, 0x01840183},
983 {0x0000a01c, 0x01850184}, 984 {0x0000a018, 0x01880185},
984 {0x0000a020, 0x01890188}, 985 {0x0000a01c, 0x018a0189},
985 {0x0000a024, 0x018b018a}, 986 {0x0000a020, 0x02850284},
986 {0x0000a028, 0x018d018c}, 987 {0x0000a024, 0x02890288},
987 {0x0000a02c, 0x01910190}, 988 {0x0000a028, 0x028b028a},
988 {0x0000a030, 0x01930192}, 989 {0x0000a02c, 0x03850384},
989 {0x0000a034, 0x01950194}, 990 {0x0000a030, 0x03890388},
990 {0x0000a038, 0x038a0196}, 991 {0x0000a034, 0x038b038a},
991 {0x0000a03c, 0x038c038b}, 992 {0x0000a038, 0x038d038c},
992 {0x0000a040, 0x0390038d}, 993 {0x0000a03c, 0x03910390},
993 {0x0000a044, 0x03920391}, 994 {0x0000a040, 0x03930392},
994 {0x0000a048, 0x03940393}, 995 {0x0000a044, 0x03950394},
995 {0x0000a04c, 0x03960395}, 996 {0x0000a048, 0x00000396},
997 {0x0000a04c, 0x00000000},
996 {0x0000a050, 0x00000000}, 998 {0x0000a050, 0x00000000},
997 {0x0000a054, 0x00000000}, 999 {0x0000a054, 0x00000000},
998 {0x0000a058, 0x00000000}, 1000 {0x0000a058, 0x00000000},
@@ -1005,15 +1007,15 @@ static const u32 ar9331_common_rx_gain_1p1[][2] = {
1005 {0x0000a074, 0x00000000}, 1007 {0x0000a074, 0x00000000},
1006 {0x0000a078, 0x00000000}, 1008 {0x0000a078, 0x00000000},
1007 {0x0000a07c, 0x00000000}, 1009 {0x0000a07c, 0x00000000},
1008 {0x0000a080, 0x22222229}, 1010 {0x0000a080, 0x28282828},
1009 {0x0000a084, 0x1d1d1d1d}, 1011 {0x0000a084, 0x28282828},
1010 {0x0000a088, 0x1d1d1d1d}, 1012 {0x0000a088, 0x28282828},
1011 {0x0000a08c, 0x1d1d1d1d}, 1013 {0x0000a08c, 0x28282828},
1012 {0x0000a090, 0x171d1d1d}, 1014 {0x0000a090, 0x28282828},
1013 {0x0000a094, 0x11111717}, 1015 {0x0000a094, 0x24242428},
1014 {0x0000a098, 0x00030311}, 1016 {0x0000a098, 0x171e1e1e},
1015 {0x0000a09c, 0x00000000}, 1017 {0x0000a09c, 0x02020b0b},
1016 {0x0000a0a0, 0x00000000}, 1018 {0x0000a0a0, 0x02020202},
1017 {0x0000a0a4, 0x00000000}, 1019 {0x0000a0a4, 0x00000000},
1018 {0x0000a0a8, 0x00000000}, 1020 {0x0000a0a8, 0x00000000},
1019 {0x0000a0ac, 0x00000000}, 1021 {0x0000a0ac, 0x00000000},
@@ -1021,27 +1023,27 @@ static const u32 ar9331_common_rx_gain_1p1[][2] = {
1021 {0x0000a0b4, 0x00000000}, 1023 {0x0000a0b4, 0x00000000},
1022 {0x0000a0b8, 0x00000000}, 1024 {0x0000a0b8, 0x00000000},
1023 {0x0000a0bc, 0x00000000}, 1025 {0x0000a0bc, 0x00000000},
1024 {0x0000a0c0, 0x001f0000}, 1026 {0x0000a0c0, 0x22072208},
1025 {0x0000a0c4, 0x01000101}, 1027 {0x0000a0c4, 0x22052206},
1026 {0x0000a0c8, 0x011e011f}, 1028 {0x0000a0c8, 0x22032204},
1027 {0x0000a0cc, 0x011c011d}, 1029 {0x0000a0cc, 0x22012202},
1028 {0x0000a0d0, 0x02030204}, 1030 {0x0000a0d0, 0x221f2200},
1029 {0x0000a0d4, 0x02010202}, 1031 {0x0000a0d4, 0x221d221e},
1030 {0x0000a0d8, 0x021f0200}, 1032 {0x0000a0d8, 0x33023303},
1031 {0x0000a0dc, 0x0302021e}, 1033 {0x0000a0dc, 0x33003301},
1032 {0x0000a0e0, 0x03000301}, 1034 {0x0000a0e0, 0x331e331f},
1033 {0x0000a0e4, 0x031e031f}, 1035 {0x0000a0e4, 0x4402331d},
1034 {0x0000a0e8, 0x0402031d}, 1036 {0x0000a0e8, 0x44004401},
1035 {0x0000a0ec, 0x04000401}, 1037 {0x0000a0ec, 0x441e441f},
1036 {0x0000a0f0, 0x041e041f}, 1038 {0x0000a0f0, 0x55025503},
1037 {0x0000a0f4, 0x0502041d}, 1039 {0x0000a0f4, 0x55005501},
1038 {0x0000a0f8, 0x05000501}, 1040 {0x0000a0f8, 0x551e551f},
1039 {0x0000a0fc, 0x051e051f}, 1041 {0x0000a0fc, 0x6602551d},
1040 {0x0000a100, 0x06010602}, 1042 {0x0000a100, 0x66006601},
1041 {0x0000a104, 0x061f0600}, 1043 {0x0000a104, 0x661e661f},
1042 {0x0000a108, 0x061d061e}, 1044 {0x0000a108, 0x7703661d},
1043 {0x0000a10c, 0x07020703}, 1045 {0x0000a10c, 0x77017702},
1044 {0x0000a110, 0x07000701}, 1046 {0x0000a110, 0x00007700},
1045 {0x0000a114, 0x00000000}, 1047 {0x0000a114, 0x00000000},
1046 {0x0000a118, 0x00000000}, 1048 {0x0000a118, 0x00000000},
1047 {0x0000a11c, 0x00000000}, 1049 {0x0000a11c, 0x00000000},
@@ -1054,26 +1056,26 @@ static const u32 ar9331_common_rx_gain_1p1[][2] = {
1054 {0x0000a138, 0x00000000}, 1056 {0x0000a138, 0x00000000},
1055 {0x0000a13c, 0x00000000}, 1057 {0x0000a13c, 0x00000000},
1056 {0x0000a140, 0x001f0000}, 1058 {0x0000a140, 0x001f0000},
1057 {0x0000a144, 0x01000101}, 1059 {0x0000a144, 0x111f1100},
1058 {0x0000a148, 0x011e011f}, 1060 {0x0000a148, 0x111d111e},
1059 {0x0000a14c, 0x011c011d}, 1061 {0x0000a14c, 0x111b111c},
1060 {0x0000a150, 0x02030204}, 1062 {0x0000a150, 0x22032204},
1061 {0x0000a154, 0x02010202}, 1063 {0x0000a154, 0x22012202},
1062 {0x0000a158, 0x021f0200}, 1064 {0x0000a158, 0x221f2200},
1063 {0x0000a15c, 0x0302021e}, 1065 {0x0000a15c, 0x221d221e},
1064 {0x0000a160, 0x03000301}, 1066 {0x0000a160, 0x33013302},
1065 {0x0000a164, 0x031e031f}, 1067 {0x0000a164, 0x331f3300},
1066 {0x0000a168, 0x0402031d}, 1068 {0x0000a168, 0x4402331e},
1067 {0x0000a16c, 0x04000401}, 1069 {0x0000a16c, 0x44004401},
1068 {0x0000a170, 0x041e041f}, 1070 {0x0000a170, 0x441e441f},
1069 {0x0000a174, 0x0502041d}, 1071 {0x0000a174, 0x55015502},
1070 {0x0000a178, 0x05000501}, 1072 {0x0000a178, 0x551f5500},
1071 {0x0000a17c, 0x051e051f}, 1073 {0x0000a17c, 0x6602551e},
1072 {0x0000a180, 0x06010602}, 1074 {0x0000a180, 0x66006601},
1073 {0x0000a184, 0x061f0600}, 1075 {0x0000a184, 0x661e661f},
1074 {0x0000a188, 0x061d061e}, 1076 {0x0000a188, 0x7703661d},
1075 {0x0000a18c, 0x07020703}, 1077 {0x0000a18c, 0x77017702},
1076 {0x0000a190, 0x07000701}, 1078 {0x0000a190, 0x00007700},
1077 {0x0000a194, 0x00000000}, 1079 {0x0000a194, 0x00000000},
1078 {0x0000a198, 0x00000000}, 1080 {0x0000a198, 0x00000000},
1079 {0x0000a19c, 0x00000000}, 1081 {0x0000a19c, 0x00000000},
@@ -1100,14 +1102,14 @@ static const u32 ar9331_common_rx_gain_1p1[][2] = {
1100 {0x0000a1f0, 0x00000396}, 1102 {0x0000a1f0, 0x00000396},
1101 {0x0000a1f4, 0x00000396}, 1103 {0x0000a1f4, 0x00000396},
1102 {0x0000a1f8, 0x00000396}, 1104 {0x0000a1f8, 0x00000396},
1103 {0x0000a1fc, 0x00000196}, 1105 {0x0000a1fc, 0x00000296},
1104}; 1106};
1105 1107
1106static const u32 ar9331_common_tx_gain_offset1_1[][1] = { 1108static const u32 ar9331_common_tx_gain_offset1_1[][1] = {
1107 {0}, 1109 {0x00000000},
1108 {3}, 1110 {0x00000003},
1109 {0}, 1111 {0x00000000},
1110 {0}, 1112 {0x00000000},
1111}; 1113};
1112 1114
1113static const u32 ar9331_1p1_chansel_xtal_25M[] = { 1115static const u32 ar9331_1p1_chansel_xtal_25M[] = {
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index abe05ec85d50..7db1890448f2 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1468,6 +1468,9 @@ static bool ath9k_hw_chip_reset(struct ath_hw *ah,
1468 return false; 1468 return false;
1469 1469
1470 ah->chip_fullsleep = false; 1470 ah->chip_fullsleep = false;
1471
1472 if (AR_SREV_9330(ah))
1473 ar9003_hw_internal_regulator_apply(ah);
1471 ath9k_hw_init_pll(ah, chan); 1474 ath9k_hw_init_pll(ah, chan);
1472 ath9k_hw_set_rfmode(ah, chan); 1475 ath9k_hw_set_rfmode(ah, chan);
1473 1476
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index dfa78e8b6470..4de4473776ac 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -239,7 +239,7 @@ static bool ath_prepare_reset(struct ath_softc *sc, bool retry_tx, bool flush)
239{ 239{
240 struct ath_hw *ah = sc->sc_ah; 240 struct ath_hw *ah = sc->sc_ah;
241 struct ath_common *common = ath9k_hw_common(ah); 241 struct ath_common *common = ath9k_hw_common(ah);
242 bool ret; 242 bool ret = true;
243 243
244 ieee80211_stop_queues(sc->hw); 244 ieee80211_stop_queues(sc->hw);
245 245
@@ -250,11 +250,12 @@ static bool ath_prepare_reset(struct ath_softc *sc, bool retry_tx, bool flush)
250 ath9k_debug_samp_bb_mac(sc); 250 ath9k_debug_samp_bb_mac(sc);
251 ath9k_hw_disable_interrupts(ah); 251 ath9k_hw_disable_interrupts(ah);
252 252
253 ret = ath_drain_all_txq(sc, retry_tx);
254
255 if (!ath_stoprecv(sc)) 253 if (!ath_stoprecv(sc))
256 ret = false; 254 ret = false;
257 255
256 if (!ath_drain_all_txq(sc, retry_tx))
257 ret = false;
258
258 if (!flush) { 259 if (!flush) {
259 if (ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) 260 if (ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)
260 ath_rx_tasklet(sc, 1, true); 261 ath_rx_tasklet(sc, 1, true);
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 23eaa1b26ebe..d59dd01d6cde 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -64,7 +64,8 @@ static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid,
64static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc, 64static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc,
65 struct ath_txq *txq, 65 struct ath_txq *txq,
66 struct ath_atx_tid *tid, 66 struct ath_atx_tid *tid,
67 struct sk_buff *skb); 67 struct sk_buff *skb,
68 bool dequeue);
68 69
69enum { 70enum {
70 MCS_HT20, 71 MCS_HT20,
@@ -811,7 +812,7 @@ static enum ATH_AGGR_STATUS ath_tx_form_aggr(struct ath_softc *sc,
811 fi = get_frame_info(skb); 812 fi = get_frame_info(skb);
812 bf = fi->bf; 813 bf = fi->bf;
813 if (!fi->bf) 814 if (!fi->bf)
814 bf = ath_tx_setup_buffer(sc, txq, tid, skb); 815 bf = ath_tx_setup_buffer(sc, txq, tid, skb, true);
815 816
816 if (!bf) 817 if (!bf)
817 continue; 818 continue;
@@ -1726,7 +1727,7 @@ static void ath_tx_send_ampdu(struct ath_softc *sc, struct ath_atx_tid *tid,
1726 return; 1727 return;
1727 } 1728 }
1728 1729
1729 bf = ath_tx_setup_buffer(sc, txctl->txq, tid, skb); 1730 bf = ath_tx_setup_buffer(sc, txctl->txq, tid, skb, false);
1730 if (!bf) 1731 if (!bf)
1731 return; 1732 return;
1732 1733
@@ -1753,7 +1754,7 @@ static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq,
1753 1754
1754 bf = fi->bf; 1755 bf = fi->bf;
1755 if (!bf) 1756 if (!bf)
1756 bf = ath_tx_setup_buffer(sc, txq, tid, skb); 1757 bf = ath_tx_setup_buffer(sc, txq, tid, skb, false);
1757 1758
1758 if (!bf) 1759 if (!bf)
1759 return; 1760 return;
@@ -1814,7 +1815,8 @@ u8 ath_txchainmask_reduction(struct ath_softc *sc, u8 chainmask, u32 rate)
1814static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc, 1815static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc,
1815 struct ath_txq *txq, 1816 struct ath_txq *txq,
1816 struct ath_atx_tid *tid, 1817 struct ath_atx_tid *tid,
1817 struct sk_buff *skb) 1818 struct sk_buff *skb,
1819 bool dequeue)
1818{ 1820{
1819 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 1821 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
1820 struct ath_frame_info *fi = get_frame_info(skb); 1822 struct ath_frame_info *fi = get_frame_info(skb);
@@ -1863,6 +1865,8 @@ static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc,
1863 return bf; 1865 return bf;
1864 1866
1865error: 1867error:
1868 if (dequeue)
1869 __skb_unlink(skb, &tid->buf_q);
1866 dev_kfree_skb_any(skb); 1870 dev_kfree_skb_any(skb);
1867 return NULL; 1871 return NULL;
1868} 1872}
@@ -1893,7 +1897,7 @@ static void ath_tx_start_dma(struct ath_softc *sc, struct sk_buff *skb,
1893 */ 1897 */
1894 ath_tx_send_ampdu(sc, tid, skb, txctl); 1898 ath_tx_send_ampdu(sc, tid, skb, txctl);
1895 } else { 1899 } else {
1896 bf = ath_tx_setup_buffer(sc, txctl->txq, tid, skb); 1900 bf = ath_tx_setup_buffer(sc, txctl->txq, tid, skb, false);
1897 if (!bf) 1901 if (!bf)
1898 return; 1902 return;
1899 1903
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index 67c13af6f206..c06b6cb5c91e 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -877,6 +877,10 @@ struct b43_wl {
877 * from the mac80211 subsystem. */ 877 * from the mac80211 subsystem. */
878 u16 mac80211_initially_registered_queues; 878 u16 mac80211_initially_registered_queues;
879 879
880 /* Set this if we call ieee80211_register_hw() and check if we call
881 * ieee80211_unregister_hw(). */
882 bool hw_registred;
883
880 /* We can only have one operating interface (802.11 core) 884 /* We can only have one operating interface (802.11 core)
881 * at a time. General information about this interface follows. 885 * at a time. General information about this interface follows.
882 */ 886 */
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 5a39b226b2e3..1b988f26bdf1 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -2437,6 +2437,7 @@ start_ieee80211:
2437 err = ieee80211_register_hw(wl->hw); 2437 err = ieee80211_register_hw(wl->hw);
2438 if (err) 2438 if (err)
2439 goto err_one_core_detach; 2439 goto err_one_core_detach;
2440 wl->hw_registred = true;
2440 b43_leds_register(wl->current_dev); 2441 b43_leds_register(wl->current_dev);
2441 goto out; 2442 goto out;
2442 2443
@@ -3766,7 +3767,7 @@ static int b43_switch_band(struct b43_wl *wl, struct ieee80211_channel *chan)
3766 if (prev_status >= B43_STAT_STARTED) { 3767 if (prev_status >= B43_STAT_STARTED) {
3767 err = b43_wireless_core_start(up_dev); 3768 err = b43_wireless_core_start(up_dev);
3768 if (err) { 3769 if (err) {
3769 b43err(wl, "Fatal: Coult not start device for " 3770 b43err(wl, "Fatal: Could not start device for "
3770 "selected %s-GHz band\n", 3771 "selected %s-GHz band\n",
3771 band_to_string(chan->band)); 3772 band_to_string(chan->band));
3772 b43_wireless_core_exit(up_dev); 3773 b43_wireless_core_exit(up_dev);
@@ -5299,6 +5300,7 @@ static struct b43_wl *b43_wireless_init(struct b43_bus_dev *dev)
5299 5300
5300 hw->queues = modparam_qos ? B43_QOS_QUEUE_NUM : 1; 5301 hw->queues = modparam_qos ? B43_QOS_QUEUE_NUM : 1;
5301 wl->mac80211_initially_registered_queues = hw->queues; 5302 wl->mac80211_initially_registered_queues = hw->queues;
5303 wl->hw_registred = false;
5302 hw->max_rates = 2; 5304 hw->max_rates = 2;
5303 SET_IEEE80211_DEV(hw, dev->dev); 5305 SET_IEEE80211_DEV(hw, dev->dev);
5304 if (is_valid_ether_addr(sprom->et1mac)) 5306 if (is_valid_ether_addr(sprom->et1mac))
@@ -5370,12 +5372,15 @@ static void b43_bcma_remove(struct bcma_device *core)
5370 * as the ieee80211 unreg will destroy the workqueue. */ 5372 * as the ieee80211 unreg will destroy the workqueue. */
5371 cancel_work_sync(&wldev->restart_work); 5373 cancel_work_sync(&wldev->restart_work);
5372 5374
5373 /* Restore the queues count before unregistering, because firmware detect 5375 B43_WARN_ON(!wl);
5374 * might have modified it. Restoring is important, so the networking 5376 if (wl->current_dev == wldev && wl->hw_registred) {
5375 * stack can properly free resources. */ 5377 /* Restore the queues count before unregistering, because firmware detect
5376 wl->hw->queues = wl->mac80211_initially_registered_queues; 5378 * might have modified it. Restoring is important, so the networking
5377 b43_leds_stop(wldev); 5379 * stack can properly free resources. */
5378 ieee80211_unregister_hw(wl->hw); 5380 wl->hw->queues = wl->mac80211_initially_registered_queues;
5381 b43_leds_stop(wldev);
5382 ieee80211_unregister_hw(wl->hw);
5383 }
5379 5384
5380 b43_one_core_detach(wldev->dev); 5385 b43_one_core_detach(wldev->dev);
5381 5386
@@ -5446,7 +5451,7 @@ static void b43_ssb_remove(struct ssb_device *sdev)
5446 cancel_work_sync(&wldev->restart_work); 5451 cancel_work_sync(&wldev->restart_work);
5447 5452
5448 B43_WARN_ON(!wl); 5453 B43_WARN_ON(!wl);
5449 if (wl->current_dev == wldev) { 5454 if (wl->current_dev == wldev && wl->hw_registred) {
5450 /* Restore the queues count before unregistering, because firmware detect 5455 /* Restore the queues count before unregistering, because firmware detect
5451 * might have modified it. Restoring is important, so the networking 5456 * might have modified it. Restoring is important, so the networking
5452 * stack can properly free resources. */ 5457 * stack can properly free resources. */
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index cd9c9bc186d9..eae691e2f7dd 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -2633,7 +2633,7 @@ static int b43legacy_switch_phymode(struct b43legacy_wl *wl,
2633 if (prev_status >= B43legacy_STAT_STARTED) { 2633 if (prev_status >= B43legacy_STAT_STARTED) {
2634 err = b43legacy_wireless_core_start(up_dev); 2634 err = b43legacy_wireless_core_start(up_dev);
2635 if (err) { 2635 if (err) {
2636 b43legacyerr(wl, "Fatal: Coult not start device for " 2636 b43legacyerr(wl, "Fatal: Could not start device for "
2637 "newly selected %s-PHY mode\n", 2637 "newly selected %s-PHY mode\n",
2638 phymode_to_string(new_mode)); 2638 phymode_to_string(new_mode));
2639 b43legacy_wireless_core_exit(up_dev); 2639 b43legacy_wireless_core_exit(up_dev);
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
index e2480d196276..8e7e6928c936 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
@@ -89,9 +89,9 @@ int brcmf_sdio_intr_register(struct brcmf_sdio_dev *sdiodev)
89 data |= 1 << SDIO_FUNC_1 | 1 << SDIO_FUNC_2 | 1; 89 data |= 1 << SDIO_FUNC_1 | 1 << SDIO_FUNC_2 | 1;
90 brcmf_sdio_regwb(sdiodev, SDIO_CCCR_IENx, data, &ret); 90 brcmf_sdio_regwb(sdiodev, SDIO_CCCR_IENx, data, &ret);
91 91
92 /* redirect, configure ane enable io for interrupt signal */ 92 /* redirect, configure and enable io for interrupt signal */
93 data = SDIO_SEPINT_MASK | SDIO_SEPINT_OE; 93 data = SDIO_SEPINT_MASK | SDIO_SEPINT_OE;
94 if (sdiodev->irq_flags | IRQF_TRIGGER_HIGH) 94 if (sdiodev->irq_flags & IRQF_TRIGGER_HIGH)
95 data |= SDIO_SEPINT_ACT_HI; 95 data |= SDIO_SEPINT_ACT_HI;
96 brcmf_sdio_regwb(sdiodev, SDIO_CCCR_BRCM_SEPINT, data, &ret); 96 brcmf_sdio_regwb(sdiodev, SDIO_CCCR_BRCM_SEPINT, data, &ret);
97 97
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/brcm80211/brcmfmac/usb.c
index c5a34ffe6459..a299d42da8e7 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c
@@ -28,6 +28,7 @@
28#include <linux/uaccess.h> 28#include <linux/uaccess.h>
29#include <linux/firmware.h> 29#include <linux/firmware.h>
30#include <linux/usb.h> 30#include <linux/usb.h>
31#include <linux/vmalloc.h>
31#include <net/cfg80211.h> 32#include <net/cfg80211.h>
32 33
33#include <defs.h> 34#include <defs.h>
@@ -1239,7 +1240,7 @@ static int brcmf_usb_get_fw(struct brcmf_usbdev_info *devinfo)
1239 return -EINVAL; 1240 return -EINVAL;
1240 } 1241 }
1241 1242
1242 devinfo->image = kmalloc(fw->size, GFP_ATOMIC); /* plus nvram */ 1243 devinfo->image = vmalloc(fw->size); /* plus nvram */
1243 if (!devinfo->image) 1244 if (!devinfo->image)
1244 return -ENOMEM; 1245 return -ENOMEM;
1245 1246
@@ -1603,7 +1604,7 @@ static struct usb_driver brcmf_usbdrvr = {
1603void brcmf_usb_exit(void) 1604void brcmf_usb_exit(void)
1604{ 1605{
1605 usb_deregister(&brcmf_usbdrvr); 1606 usb_deregister(&brcmf_usbdrvr);
1606 kfree(g_image.data); 1607 vfree(g_image.data);
1607 g_image.data = NULL; 1608 g_image.data = NULL;
1608 g_image.len = 0; 1609 g_image.len = 0;
1609} 1610}
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 9cfae0c08707..95aa8e1683ec 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -1903,14 +1903,6 @@ static void ipw2100_down(struct ipw2100_priv *priv)
1903 netif_stop_queue(priv->net_dev); 1903 netif_stop_queue(priv->net_dev);
1904} 1904}
1905 1905
1906/* Called by register_netdev() */
1907static int ipw2100_net_init(struct net_device *dev)
1908{
1909 struct ipw2100_priv *priv = libipw_priv(dev);
1910
1911 return ipw2100_up(priv, 1);
1912}
1913
1914static int ipw2100_wdev_init(struct net_device *dev) 1906static int ipw2100_wdev_init(struct net_device *dev)
1915{ 1907{
1916 struct ipw2100_priv *priv = libipw_priv(dev); 1908 struct ipw2100_priv *priv = libipw_priv(dev);
@@ -6087,7 +6079,6 @@ static const struct net_device_ops ipw2100_netdev_ops = {
6087 .ndo_stop = ipw2100_close, 6079 .ndo_stop = ipw2100_close,
6088 .ndo_start_xmit = libipw_xmit, 6080 .ndo_start_xmit = libipw_xmit,
6089 .ndo_change_mtu = libipw_change_mtu, 6081 .ndo_change_mtu = libipw_change_mtu,
6090 .ndo_init = ipw2100_net_init,
6091 .ndo_tx_timeout = ipw2100_tx_timeout, 6082 .ndo_tx_timeout = ipw2100_tx_timeout,
6092 .ndo_set_mac_address = ipw2100_set_address, 6083 .ndo_set_mac_address = ipw2100_set_address,
6093 .ndo_validate_addr = eth_validate_addr, 6084 .ndo_validate_addr = eth_validate_addr,
@@ -6329,6 +6320,10 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
6329 printk(KERN_INFO DRV_NAME 6320 printk(KERN_INFO DRV_NAME
6330 ": Detected Intel PRO/Wireless 2100 Network Connection\n"); 6321 ": Detected Intel PRO/Wireless 2100 Network Connection\n");
6331 6322
6323 err = ipw2100_up(priv, 1);
6324 if (err)
6325 goto fail;
6326
6332 err = ipw2100_wdev_init(dev); 6327 err = ipw2100_wdev_init(dev);
6333 if (err) 6328 if (err)
6334 goto fail; 6329 goto fail;
@@ -6338,12 +6333,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
6338 * network device we would call ipw2100_up. This introduced a race 6333 * network device we would call ipw2100_up. This introduced a race
6339 * condition with newer hotplug configurations (network was coming 6334 * condition with newer hotplug configurations (network was coming
6340 * up and making calls before the device was initialized). 6335 * up and making calls before the device was initialized).
6341 * 6336 */
6342 * If we called ipw2100_up before we registered the device, then the
6343 * device name wasn't registered. So, we instead use the net_dev->init
6344 * member to call a function that then just turns and calls ipw2100_up.
6345 * net_dev->init is called after name allocation but before the
6346 * notifier chain is called */
6347 err = register_netdev(dev); 6337 err = register_netdev(dev);
6348 if (err) { 6338 if (err) {
6349 printk(KERN_WARNING DRV_NAME 6339 printk(KERN_WARNING DRV_NAME
diff --git a/drivers/net/wireless/iwlwifi/Kconfig b/drivers/net/wireless/iwlwifi/Kconfig
index db6c6e528022..2463c0626438 100644
--- a/drivers/net/wireless/iwlwifi/Kconfig
+++ b/drivers/net/wireless/iwlwifi/Kconfig
@@ -137,11 +137,3 @@ config IWLWIFI_EXPERIMENTAL_MFP
137 even if the microcode doesn't advertise it. 137 even if the microcode doesn't advertise it.
138 138
139 Say Y only if you want to experiment with MFP. 139 Say Y only if you want to experiment with MFP.
140
141config IWLWIFI_UCODE16
142 bool "support uCode 16.0"
143 depends on IWLWIFI
144 help
145 This option enables support for uCode version 16.0.
146
147 Say Y if you want to use 16.0 microcode.
diff --git a/drivers/net/wireless/iwlwifi/Makefile b/drivers/net/wireless/iwlwifi/Makefile
index 406f297a9a56..d615eacbf050 100644
--- a/drivers/net/wireless/iwlwifi/Makefile
+++ b/drivers/net/wireless/iwlwifi/Makefile
@@ -18,7 +18,6 @@ iwlwifi-objs += iwl-notif-wait.o
18iwlwifi-objs += iwl-trans-pcie.o iwl-trans-pcie-rx.o iwl-trans-pcie-tx.o 18iwlwifi-objs += iwl-trans-pcie.o iwl-trans-pcie-rx.o iwl-trans-pcie-tx.o
19 19
20 20
21iwlwifi-$(CONFIG_IWLWIFI_UCODE16) += iwl-phy-db.o
22iwlwifi-$(CONFIG_IWLWIFI_DEBUGFS) += iwl-debugfs.o 21iwlwifi-$(CONFIG_IWLWIFI_DEBUGFS) += iwl-debugfs.o
23iwlwifi-$(CONFIG_IWLWIFI_DEVICE_TRACING) += iwl-devtrace.o 22iwlwifi-$(CONFIG_IWLWIFI_DEVICE_TRACING) += iwl-devtrace.o
24iwlwifi-$(CONFIG_IWLWIFI_DEVICE_TESTMODE) += iwl-testmode.o 23iwlwifi-$(CONFIG_IWLWIFI_DEVICE_TESTMODE) += iwl-testmode.o
diff --git a/drivers/net/wireless/iwlwifi/iwl-2000.c b/drivers/net/wireless/iwlwifi/iwl-2000.c
index 7f793417c787..8133105ac645 100644
--- a/drivers/net/wireless/iwlwifi/iwl-2000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-2000.c
@@ -79,7 +79,7 @@ static const struct iwl_base_params iwl2000_base_params = {
79 .chain_noise_scale = 1000, 79 .chain_noise_scale = 1000,
80 .wd_timeout = IWL_DEF_WD_TIMEOUT, 80 .wd_timeout = IWL_DEF_WD_TIMEOUT,
81 .max_event_log_size = 512, 81 .max_event_log_size = 512,
82 .shadow_reg_enable = true, 82 .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
83 .hd_v2 = true, 83 .hd_v2 = true,
84}; 84};
85 85
@@ -97,7 +97,7 @@ static const struct iwl_base_params iwl2030_base_params = {
97 .chain_noise_scale = 1000, 97 .chain_noise_scale = 1000,
98 .wd_timeout = IWL_LONG_WD_TIMEOUT, 98 .wd_timeout = IWL_LONG_WD_TIMEOUT,
99 .max_event_log_size = 512, 99 .max_event_log_size = 512,
100 .shadow_reg_enable = true, 100 .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
101 .hd_v2 = true, 101 .hd_v2 = true,
102}; 102};
103 103
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index 381b02cf339c..e5e8ada4aaf6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -35,17 +35,20 @@
35#define IWL6000_UCODE_API_MAX 6 35#define IWL6000_UCODE_API_MAX 6
36#define IWL6050_UCODE_API_MAX 5 36#define IWL6050_UCODE_API_MAX 5
37#define IWL6000G2_UCODE_API_MAX 6 37#define IWL6000G2_UCODE_API_MAX 6
38#define IWL6035_UCODE_API_MAX 6
38 39
39/* Oldest version we won't warn about */ 40/* Oldest version we won't warn about */
40#define IWL6000_UCODE_API_OK 4 41#define IWL6000_UCODE_API_OK 4
41#define IWL6000G2_UCODE_API_OK 5 42#define IWL6000G2_UCODE_API_OK 5
42#define IWL6050_UCODE_API_OK 5 43#define IWL6050_UCODE_API_OK 5
43#define IWL6000G2B_UCODE_API_OK 6 44#define IWL6000G2B_UCODE_API_OK 6
45#define IWL6035_UCODE_API_OK 6
44 46
45/* Lowest firmware API version supported */ 47/* Lowest firmware API version supported */
46#define IWL6000_UCODE_API_MIN 4 48#define IWL6000_UCODE_API_MIN 4
47#define IWL6050_UCODE_API_MIN 4 49#define IWL6050_UCODE_API_MIN 4
48#define IWL6000G2_UCODE_API_MIN 4 50#define IWL6000G2_UCODE_API_MIN 5
51#define IWL6035_UCODE_API_MIN 6
49 52
50/* EEPROM versions */ 53/* EEPROM versions */
51#define EEPROM_6000_TX_POWER_VERSION (4) 54#define EEPROM_6000_TX_POWER_VERSION (4)
@@ -86,7 +89,7 @@ static const struct iwl_base_params iwl6000_base_params = {
86 .chain_noise_scale = 1000, 89 .chain_noise_scale = 1000,
87 .wd_timeout = IWL_DEF_WD_TIMEOUT, 90 .wd_timeout = IWL_DEF_WD_TIMEOUT,
88 .max_event_log_size = 512, 91 .max_event_log_size = 512,
89 .shadow_reg_enable = true, 92 .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
90}; 93};
91 94
92static const struct iwl_base_params iwl6050_base_params = { 95static const struct iwl_base_params iwl6050_base_params = {
@@ -102,7 +105,7 @@ static const struct iwl_base_params iwl6050_base_params = {
102 .chain_noise_scale = 1500, 105 .chain_noise_scale = 1500,
103 .wd_timeout = IWL_DEF_WD_TIMEOUT, 106 .wd_timeout = IWL_DEF_WD_TIMEOUT,
104 .max_event_log_size = 1024, 107 .max_event_log_size = 1024,
105 .shadow_reg_enable = true, 108 .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
106}; 109};
107 110
108static const struct iwl_base_params iwl6000_g2_base_params = { 111static const struct iwl_base_params iwl6000_g2_base_params = {
@@ -118,7 +121,7 @@ static const struct iwl_base_params iwl6000_g2_base_params = {
118 .chain_noise_scale = 1000, 121 .chain_noise_scale = 1000,
119 .wd_timeout = IWL_LONG_WD_TIMEOUT, 122 .wd_timeout = IWL_LONG_WD_TIMEOUT,
120 .max_event_log_size = 512, 123 .max_event_log_size = 512,
121 .shadow_reg_enable = true, 124 .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
122}; 125};
123 126
124static const struct iwl_ht_params iwl6000_ht_params = { 127static const struct iwl_ht_params iwl6000_ht_params = {
@@ -227,9 +230,25 @@ const struct iwl_cfg iwl6030_2bg_cfg = {
227 IWL_DEVICE_6030, 230 IWL_DEVICE_6030,
228}; 231};
229 232
233#define IWL_DEVICE_6035 \
234 .fw_name_pre = IWL6030_FW_PRE, \
235 .ucode_api_max = IWL6035_UCODE_API_MAX, \
236 .ucode_api_ok = IWL6035_UCODE_API_OK, \
237 .ucode_api_min = IWL6035_UCODE_API_MIN, \
238 .device_family = IWL_DEVICE_FAMILY_6030, \
239 .max_inst_size = IWL60_RTC_INST_SIZE, \
240 .max_data_size = IWL60_RTC_DATA_SIZE, \
241 .eeprom_ver = EEPROM_6030_EEPROM_VERSION, \
242 .eeprom_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
243 .base_params = &iwl6000_g2_base_params, \
244 .bt_params = &iwl6000_bt_params, \
245 .need_temp_offset_calib = true, \
246 .led_mode = IWL_LED_RF_STATE, \
247 .adv_pm = true
248
230const struct iwl_cfg iwl6035_2agn_cfg = { 249const struct iwl_cfg iwl6035_2agn_cfg = {
231 .name = "Intel(R) Centrino(R) Advanced-N 6235 AGN", 250 .name = "Intel(R) Centrino(R) Advanced-N 6235 AGN",
232 IWL_DEVICE_6030, 251 IWL_DEVICE_6035,
233 .ht_params = &iwl6000_ht_params, 252 .ht_params = &iwl6000_ht_params,
234}; 253};
235 254
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 51e1a69ffdda..8cebd7c363fc 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -884,6 +884,7 @@ static void rs_bt_update_lq(struct iwl_priv *priv, struct iwl_rxon_context *ctx,
884 if ((priv->bt_traffic_load != priv->last_bt_traffic_load) || 884 if ((priv->bt_traffic_load != priv->last_bt_traffic_load) ||
885 (priv->bt_full_concurrent != full_concurrent)) { 885 (priv->bt_full_concurrent != full_concurrent)) {
886 priv->bt_full_concurrent = full_concurrent; 886 priv->bt_full_concurrent = full_concurrent;
887 priv->last_bt_traffic_load = priv->bt_traffic_load;
887 888
888 /* Update uCode's rate table. */ 889 /* Update uCode's rate table. */
889 tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); 890 tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
index b31584e87bc7..eb6a8eaf42fc 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
@@ -772,7 +772,7 @@ void iwl_restore_stations(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
772 ~IWL_STA_DRIVER_ACTIVE; 772 ~IWL_STA_DRIVER_ACTIVE;
773 priv->stations[i].used &= 773 priv->stations[i].used &=
774 ~IWL_STA_UCODE_INPROGRESS; 774 ~IWL_STA_UCODE_INPROGRESS;
775 spin_unlock_bh(&priv->sta_lock); 775 continue;
776 } 776 }
777 /* 777 /*
778 * Rate scaling has already been initialized, send 778 * Rate scaling has already been initialized, send
@@ -1267,7 +1267,7 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv,
1267 key_flags |= STA_KEY_MULTICAST_MSK; 1267 key_flags |= STA_KEY_MULTICAST_MSK;
1268 1268
1269 sta_cmd.key.key_flags = key_flags; 1269 sta_cmd.key.key_flags = key_flags;
1270 sta_cmd.key.key_offset = WEP_INVALID_OFFSET; 1270 sta_cmd.key.key_offset = keyconf->hw_key_idx;
1271 sta_cmd.sta.modify_mask = STA_MODIFY_KEY_MASK; 1271 sta_cmd.sta.modify_mask = STA_MODIFY_KEY_MASK;
1272 sta_cmd.mode = STA_CONTROL_MODIFY_MSK; 1272 sta_cmd.mode = STA_CONTROL_MODIFY_MSK;
1273 1273
diff --git a/drivers/net/wireless/iwlwifi/iwl-drv.c b/drivers/net/wireless/iwlwifi/iwl-drv.c
index 3c72bad0ae56..fac67a526a30 100644
--- a/drivers/net/wireless/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/iwlwifi/iwl-drv.c
@@ -657,17 +657,17 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,
657 return -EINVAL; 657 return -EINVAL;
658} 658}
659 659
660static int alloc_pci_desc(struct iwl_drv *drv, 660static int iwl_alloc_ucode(struct iwl_drv *drv,
661 struct iwl_firmware_pieces *pieces, 661 struct iwl_firmware_pieces *pieces,
662 enum iwl_ucode_type type) 662 enum iwl_ucode_type type)
663{ 663{
664 int i; 664 int i;
665 for (i = 0; 665 for (i = 0;
666 i < IWL_UCODE_SECTION_MAX && get_sec_size(pieces, type, i); 666 i < IWL_UCODE_SECTION_MAX && get_sec_size(pieces, type, i);
667 i++) 667 i++)
668 if (iwl_alloc_fw_desc(drv, &(drv->fw.img[type].sec[i]), 668 if (iwl_alloc_fw_desc(drv, &(drv->fw.img[type].sec[i]),
669 get_sec(pieces, type, i))) 669 get_sec(pieces, type, i)))
670 return -1; 670 return -ENOMEM;
671 return 0; 671 return 0;
672} 672}
673 673
@@ -825,8 +825,8 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
825 * 1) unmodified from disk 825 * 1) unmodified from disk
826 * 2) backup cache for save/restore during power-downs */ 826 * 2) backup cache for save/restore during power-downs */
827 for (i = 0; i < IWL_UCODE_TYPE_MAX; i++) 827 for (i = 0; i < IWL_UCODE_TYPE_MAX; i++)
828 if (alloc_pci_desc(drv, &pieces, i)) 828 if (iwl_alloc_ucode(drv, &pieces, i))
829 goto err_pci_alloc; 829 goto out_free_fw;
830 830
831 /* Now that we can no longer fail, copy information */ 831 /* Now that we can no longer fail, copy information */
832 832
@@ -861,13 +861,18 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
861 861
862 /* We have our copies now, allow OS release its copies */ 862 /* We have our copies now, allow OS release its copies */
863 release_firmware(ucode_raw); 863 release_firmware(ucode_raw);
864 complete(&drv->request_firmware_complete);
865 864
866 drv->op_mode = iwl_dvm_ops.start(drv->trans, drv->cfg, &drv->fw); 865 drv->op_mode = iwl_dvm_ops.start(drv->trans, drv->cfg, &drv->fw);
867 866
868 if (!drv->op_mode) 867 if (!drv->op_mode)
869 goto out_unbind; 868 goto out_unbind;
870 869
870 /*
871 * Complete the firmware request last so that
872 * a driver unbind (stop) doesn't run while we
873 * are doing the start() above.
874 */
875 complete(&drv->request_firmware_complete);
871 return; 876 return;
872 877
873 try_again: 878 try_again:
@@ -877,7 +882,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
877 goto out_unbind; 882 goto out_unbind;
878 return; 883 return;
879 884
880 err_pci_alloc: 885 out_free_fw:
881 IWL_ERR(drv, "failed to allocate pci memory\n"); 886 IWL_ERR(drv, "failed to allocate pci memory\n");
882 iwl_dealloc_ucode(drv); 887 iwl_dealloc_ucode(drv);
883 release_firmware(ucode_raw); 888 release_firmware(ucode_raw);
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
index 50c58911e718..b8e2b223ac36 100644
--- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c
+++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
@@ -568,28 +568,28 @@ static int iwl_find_otp_image(struct iwl_trans *trans,
568 * iwl_get_max_txpower_avg - get the highest tx power from all chains. 568 * iwl_get_max_txpower_avg - get the highest tx power from all chains.
569 * find the highest tx power from all chains for the channel 569 * find the highest tx power from all chains for the channel
570 */ 570 */
571static s8 iwl_get_max_txpower_avg(const struct iwl_cfg *cfg, 571static s8 iwl_get_max_txpower_avg(struct iwl_priv *priv,
572 struct iwl_eeprom_enhanced_txpwr *enhanced_txpower, 572 struct iwl_eeprom_enhanced_txpwr *enhanced_txpower,
573 int element, s8 *max_txpower_in_half_dbm) 573 int element, s8 *max_txpower_in_half_dbm)
574{ 574{
575 s8 max_txpower_avg = 0; /* (dBm) */ 575 s8 max_txpower_avg = 0; /* (dBm) */
576 576
577 /* Take the highest tx power from any valid chains */ 577 /* Take the highest tx power from any valid chains */
578 if ((cfg->valid_tx_ant & ANT_A) && 578 if ((priv->hw_params.valid_tx_ant & ANT_A) &&
579 (enhanced_txpower[element].chain_a_max > max_txpower_avg)) 579 (enhanced_txpower[element].chain_a_max > max_txpower_avg))
580 max_txpower_avg = enhanced_txpower[element].chain_a_max; 580 max_txpower_avg = enhanced_txpower[element].chain_a_max;
581 if ((cfg->valid_tx_ant & ANT_B) && 581 if ((priv->hw_params.valid_tx_ant & ANT_B) &&
582 (enhanced_txpower[element].chain_b_max > max_txpower_avg)) 582 (enhanced_txpower[element].chain_b_max > max_txpower_avg))
583 max_txpower_avg = enhanced_txpower[element].chain_b_max; 583 max_txpower_avg = enhanced_txpower[element].chain_b_max;
584 if ((cfg->valid_tx_ant & ANT_C) && 584 if ((priv->hw_params.valid_tx_ant & ANT_C) &&
585 (enhanced_txpower[element].chain_c_max > max_txpower_avg)) 585 (enhanced_txpower[element].chain_c_max > max_txpower_avg))
586 max_txpower_avg = enhanced_txpower[element].chain_c_max; 586 max_txpower_avg = enhanced_txpower[element].chain_c_max;
587 if (((cfg->valid_tx_ant == ANT_AB) | 587 if (((priv->hw_params.valid_tx_ant == ANT_AB) |
588 (cfg->valid_tx_ant == ANT_BC) | 588 (priv->hw_params.valid_tx_ant == ANT_BC) |
589 (cfg->valid_tx_ant == ANT_AC)) && 589 (priv->hw_params.valid_tx_ant == ANT_AC)) &&
590 (enhanced_txpower[element].mimo2_max > max_txpower_avg)) 590 (enhanced_txpower[element].mimo2_max > max_txpower_avg))
591 max_txpower_avg = enhanced_txpower[element].mimo2_max; 591 max_txpower_avg = enhanced_txpower[element].mimo2_max;
592 if ((cfg->valid_tx_ant == ANT_ABC) && 592 if ((priv->hw_params.valid_tx_ant == ANT_ABC) &&
593 (enhanced_txpower[element].mimo3_max > max_txpower_avg)) 593 (enhanced_txpower[element].mimo3_max > max_txpower_avg))
594 max_txpower_avg = enhanced_txpower[element].mimo3_max; 594 max_txpower_avg = enhanced_txpower[element].mimo3_max;
595 595
@@ -691,7 +691,7 @@ static void iwl_eeprom_enhanced_txpower(struct iwl_priv *priv)
691 ((txp->delta_20_in_40 & 0xf0) >> 4), 691 ((txp->delta_20_in_40 & 0xf0) >> 4),
692 (txp->delta_20_in_40 & 0x0f)); 692 (txp->delta_20_in_40 & 0x0f));
693 693
694 max_txp_avg = iwl_get_max_txpower_avg(priv->cfg, txp_array, idx, 694 max_txp_avg = iwl_get_max_txpower_avg(priv, txp_array, idx,
695 &max_txp_avg_halfdbm); 695 &max_txp_avg_halfdbm);
696 696
697 /* 697 /*
diff --git a/drivers/net/wireless/iwlwifi/iwl-mac80211.c b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
index ab2f4d7500a4..3ee23134c02b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-mac80211.c
+++ b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
@@ -199,6 +199,7 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
199 WIPHY_FLAG_DISABLE_BEACON_HINTS | 199 WIPHY_FLAG_DISABLE_BEACON_HINTS |
200 WIPHY_FLAG_IBSS_RSN; 200 WIPHY_FLAG_IBSS_RSN;
201 201
202#ifdef CONFIG_PM_SLEEP
202 if (priv->fw->img[IWL_UCODE_WOWLAN].sec[0].len && 203 if (priv->fw->img[IWL_UCODE_WOWLAN].sec[0].len &&
203 priv->trans->ops->wowlan_suspend && 204 priv->trans->ops->wowlan_suspend &&
204 device_can_wakeup(priv->trans->dev)) { 205 device_can_wakeup(priv->trans->dev)) {
@@ -217,6 +218,7 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
217 hw->wiphy->wowlan.pattern_max_len = 218 hw->wiphy->wowlan.pattern_max_len =
218 IWLAGN_WOWLAN_MAX_PATTERN_LEN; 219 IWLAGN_WOWLAN_MAX_PATTERN_LEN;
219 } 220 }
221#endif
220 222
221 if (iwlwifi_mod_params.power_save) 223 if (iwlwifi_mod_params.power_save)
222 hw->wiphy->flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT; 224 hw->wiphy->flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT;
@@ -249,6 +251,7 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
249 ret = ieee80211_register_hw(priv->hw); 251 ret = ieee80211_register_hw(priv->hw);
250 if (ret) { 252 if (ret) {
251 IWL_ERR(priv, "Failed to register hw (error %d)\n", ret); 253 IWL_ERR(priv, "Failed to register hw (error %d)\n", ret);
254 iwl_leds_exit(priv);
252 return ret; 255 return ret;
253 } 256 }
254 priv->mac80211_registered = 1; 257 priv->mac80211_registered = 1;
diff --git a/drivers/net/wireless/iwlwifi/iwl-phy-db.c b/drivers/net/wireless/iwlwifi/iwl-phy-db.c
deleted file mode 100644
index f166955340fe..000000000000
--- a/drivers/net/wireless/iwlwifi/iwl-phy-db.c
+++ /dev/null
@@ -1,288 +0,0 @@
1/******************************************************************************
2 *
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
5 *
6 * GPL LICENSE SUMMARY
7 *
8 * Copyright(c) 2007 - 2012 Intel Corporation. All rights reserved.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of version 2 of the GNU General Public License as
12 * published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
22 * USA
23 *
24 * The full GNU General Public License is included in this distribution
25 * in the file called LICENSE.GPL.
26 *
27 * Contact Information:
28 * Intel Linux Wireless <ilw@linux.intel.com>
29 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
30 *
31 * BSD LICENSE
32 *
33 * Copyright(c) 2005 - 2012 Intel Corporation. All rights reserved.
34 * All rights reserved.
35 *
36 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions
38 * are met:
39 *
40 * * Redistributions of source code must retain the above copyright
41 * notice, this list of conditions and the following disclaimer.
42 * * Redistributions in binary form must reproduce the above copyright
43 * notice, this list of conditions and the following disclaimer in
44 * the documentation and/or other materials provided with the
45 * distribution.
46 * * Neither the name Intel Corporation nor the names of its
47 * contributors may be used to endorse or promote products derived
48 * from this software without specific prior written permission.
49 *
50 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
51 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
52 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
53 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
54 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
55 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
56 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
57 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
58 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
59 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
60 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61 *
62 *****************************************************************************/
63
64#include <linux/slab.h>
65#include <linux/string.h>
66
67#include "iwl-debug.h"
68#include "iwl-dev.h"
69
70#include "iwl-phy-db.h"
71
72#define CHANNEL_NUM_SIZE 4 /* num of channels in calib_ch size */
73
74struct iwl_phy_db *iwl_phy_db_init(struct device *dev)
75{
76 struct iwl_phy_db *phy_db = kzalloc(sizeof(struct iwl_phy_db),
77 GFP_KERNEL);
78
79 if (!phy_db)
80 return phy_db;
81
82 phy_db->dev = dev;
83
84 /* TODO: add default values of the phy db. */
85 return phy_db;
86}
87
88/*
89 * get phy db section: returns a pointer to a phy db section specified by
90 * type and channel group id.
91 */
92static struct iwl_phy_db_entry *
93iwl_phy_db_get_section(struct iwl_phy_db *phy_db,
94 enum iwl_phy_db_section_type type,
95 u16 chg_id)
96{
97 if (!phy_db || type < 0 || type >= IWL_PHY_DB_MAX)
98 return NULL;
99
100 switch (type) {
101 case IWL_PHY_DB_CFG:
102 return &phy_db->cfg;
103 case IWL_PHY_DB_CALIB_NCH:
104 return &phy_db->calib_nch;
105 case IWL_PHY_DB_CALIB_CH:
106 return &phy_db->calib_ch;
107 case IWL_PHY_DB_CALIB_CHG_PAPD:
108 if (chg_id < 0 || chg_id >= IWL_NUM_PAPD_CH_GROUPS)
109 return NULL;
110 return &phy_db->calib_ch_group_papd[chg_id];
111 case IWL_PHY_DB_CALIB_CHG_TXP:
112 if (chg_id < 0 || chg_id >= IWL_NUM_TXP_CH_GROUPS)
113 return NULL;
114 return &phy_db->calib_ch_group_txp[chg_id];
115 default:
116 return NULL;
117 }
118 return NULL;
119}
120
121static void iwl_phy_db_free_section(struct iwl_phy_db *phy_db,
122 enum iwl_phy_db_section_type type,
123 u16 chg_id)
124{
125 struct iwl_phy_db_entry *entry =
126 iwl_phy_db_get_section(phy_db, type, chg_id);
127 if (!entry)
128 return;
129
130 kfree(entry->data);
131 entry->data = NULL;
132 entry->size = 0;
133}
134
135void iwl_phy_db_free(struct iwl_phy_db *phy_db)
136{
137 int i;
138
139 if (!phy_db)
140 return;
141
142 iwl_phy_db_free_section(phy_db, IWL_PHY_DB_CFG, 0);
143 iwl_phy_db_free_section(phy_db, IWL_PHY_DB_CALIB_NCH, 0);
144 iwl_phy_db_free_section(phy_db, IWL_PHY_DB_CALIB_CH, 0);
145 for (i = 0; i < IWL_NUM_PAPD_CH_GROUPS; i++)
146 iwl_phy_db_free_section(phy_db, IWL_PHY_DB_CALIB_CHG_PAPD, i);
147 for (i = 0; i < IWL_NUM_TXP_CH_GROUPS; i++)
148 iwl_phy_db_free_section(phy_db, IWL_PHY_DB_CALIB_CHG_TXP, i);
149
150 kfree(phy_db);
151}
152
153int iwl_phy_db_set_section(struct iwl_phy_db *phy_db,
154 enum iwl_phy_db_section_type type, u8 *data,
155 u16 size, gfp_t alloc_ctx)
156{
157 struct iwl_phy_db_entry *entry;
158 u16 chg_id = 0;
159
160 if (!phy_db)
161 return -EINVAL;
162
163 if (type == IWL_PHY_DB_CALIB_CHG_PAPD ||
164 type == IWL_PHY_DB_CALIB_CHG_TXP)
165 chg_id = le16_to_cpup((__le16 *)data);
166
167 entry = iwl_phy_db_get_section(phy_db, type, chg_id);
168 if (!entry)
169 return -EINVAL;
170
171 kfree(entry->data);
172 entry->data = kmemdup(data, size, alloc_ctx);
173 if (!entry->data) {
174 entry->size = 0;
175 return -ENOMEM;
176 }
177
178 entry->size = size;
179
180 if (type == IWL_PHY_DB_CALIB_CH) {
181 phy_db->channel_num = le32_to_cpup((__le32 *)data);
182 phy_db->channel_size =
183 (size - CHANNEL_NUM_SIZE) / phy_db->channel_num;
184 }
185
186 return 0;
187}
188
189static int is_valid_channel(u16 ch_id)
190{
191 if (ch_id <= 14 ||
192 (36 <= ch_id && ch_id <= 64 && ch_id % 4 == 0) ||
193 (100 <= ch_id && ch_id <= 140 && ch_id % 4 == 0) ||
194 (145 <= ch_id && ch_id <= 165 && ch_id % 4 == 1))
195 return 1;
196 return 0;
197}
198
199static u8 ch_id_to_ch_index(u16 ch_id)
200{
201 if (WARN_ON(!is_valid_channel(ch_id)))
202 return 0xff;
203
204 if (ch_id <= 14)
205 return ch_id - 1;
206 if (ch_id <= 64)
207 return (ch_id + 20) / 4;
208 if (ch_id <= 140)
209 return (ch_id - 12) / 4;
210 return (ch_id - 13) / 4;
211}
212
213
214static u16 channel_id_to_papd(u16 ch_id)
215{
216 if (WARN_ON(!is_valid_channel(ch_id)))
217 return 0xff;
218
219 if (1 <= ch_id && ch_id <= 14)
220 return 0;
221 if (36 <= ch_id && ch_id <= 64)
222 return 1;
223 if (100 <= ch_id && ch_id <= 140)
224 return 2;
225 return 3;
226}
227
228static u16 channel_id_to_txp(struct iwl_phy_db *phy_db, u16 ch_id)
229{
230 struct iwl_phy_db_chg_txp *txp_chg;
231 int i;
232 u8 ch_index = ch_id_to_ch_index(ch_id);
233 if (ch_index == 0xff)
234 return 0xff;
235
236 for (i = 0; i < IWL_NUM_TXP_CH_GROUPS; i++) {
237 txp_chg = (void *)phy_db->calib_ch_group_txp[i].data;
238 if (!txp_chg)
239 return 0xff;
240 /*
241 * Looking for the first channel group that its max channel is
242 * higher then wanted channel.
243 */
244 if (le16_to_cpu(txp_chg->max_channel_idx) >= ch_index)
245 return i;
246 }
247 return 0xff;
248}
249
250int iwl_phy_db_get_section_data(struct iwl_phy_db *phy_db,
251 enum iwl_phy_db_section_type type, u8 **data,
252 u16 *size, u16 ch_id)
253{
254 struct iwl_phy_db_entry *entry;
255 u32 channel_num;
256 u32 channel_size;
257 u16 ch_group_id = 0;
258 u16 index;
259
260 if (!phy_db)
261 return -EINVAL;
262
263 /* find wanted channel group */
264 if (type == IWL_PHY_DB_CALIB_CHG_PAPD)
265 ch_group_id = channel_id_to_papd(ch_id);
266 else if (type == IWL_PHY_DB_CALIB_CHG_TXP)
267 ch_group_id = channel_id_to_txp(phy_db, ch_id);
268
269 entry = iwl_phy_db_get_section(phy_db, type, ch_group_id);
270 if (!entry)
271 return -EINVAL;
272
273 if (type == IWL_PHY_DB_CALIB_CH) {
274 index = ch_id_to_ch_index(ch_id);
275 channel_num = phy_db->channel_num;
276 channel_size = phy_db->channel_size;
277 if (index >= channel_num) {
278 IWL_ERR(phy_db, "Wrong channel number %d", ch_id);
279 return -EINVAL;
280 }
281 *data = entry->data + CHANNEL_NUM_SIZE + index * channel_size;
282 *size = channel_size;
283 } else {
284 *data = entry->data;
285 *size = entry->size;
286 }
287 return 0;
288}
diff --git a/drivers/net/wireless/iwlwifi/iwl-phy-db.h b/drivers/net/wireless/iwlwifi/iwl-phy-db.h
deleted file mode 100644
index c34c6a9303ab..000000000000
--- a/drivers/net/wireless/iwlwifi/iwl-phy-db.h
+++ /dev/null
@@ -1,129 +0,0 @@
1/******************************************************************************
2 *
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
5 *
6 * GPL LICENSE SUMMARY
7 *
8 * Copyright(c) 2007 - 2012 Intel Corporation. All rights reserved.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of version 2 of the GNU General Public License as
12 * published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
22 * USA
23 *
24 * The full GNU General Public License is included in this distribution
25 * in the file called LICENSE.GPL.
26 *
27 * Contact Information:
28 * Intel Linux Wireless <ilw@linux.intel.com>
29 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
30 *
31 * BSD LICENSE
32 *
33 * Copyright(c) 2005 - 2012 Intel Corporation. All rights reserved.
34 * All rights reserved.
35 *
36 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions
38 * are met:
39 *
40 * * Redistributions of source code must retain the above copyright
41 * notice, this list of conditions and the following disclaimer.
42 * * Redistributions in binary form must reproduce the above copyright
43 * notice, this list of conditions and the following disclaimer in
44 * the documentation and/or other materials provided with the
45 * distribution.
46 * * Neither the name Intel Corporation nor the names of its
47 * contributors may be used to endorse or promote products derived
48 * from this software without specific prior written permission.
49 *
50 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
51 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
52 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
53 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
54 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
55 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
56 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
57 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
58 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
59 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
60 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61 *
62 *****************************************************************************/
63
64#ifndef __IWL_PHYDB_H__
65#define __IWL_PHYDB_H__
66
67#include <linux/types.h>
68
69#define IWL_NUM_PAPD_CH_GROUPS 4
70#define IWL_NUM_TXP_CH_GROUPS 8
71
72struct iwl_phy_db_entry {
73 u16 size;
74 u8 *data;
75};
76
77struct iwl_shared;
78
79/**
80 * struct iwl_phy_db - stores phy configuration and calibration data.
81 *
82 * @cfg: phy configuration.
83 * @calib_nch: non channel specific calibration data.
84 * @calib_ch: channel specific calibration data.
85 * @calib_ch_group_papd: calibration data related to papd channel group.
86 * @calib_ch_group_txp: calibration data related to tx power chanel group.
87 */
88struct iwl_phy_db {
89 struct iwl_phy_db_entry cfg;
90 struct iwl_phy_db_entry calib_nch;
91 struct iwl_phy_db_entry calib_ch;
92 struct iwl_phy_db_entry calib_ch_group_papd[IWL_NUM_PAPD_CH_GROUPS];
93 struct iwl_phy_db_entry calib_ch_group_txp[IWL_NUM_TXP_CH_GROUPS];
94
95 u32 channel_num;
96 u32 channel_size;
97
98 /* for an access to the logger */
99 struct device *dev;
100};
101
102enum iwl_phy_db_section_type {
103 IWL_PHY_DB_CFG = 1,
104 IWL_PHY_DB_CALIB_NCH,
105 IWL_PHY_DB_CALIB_CH,
106 IWL_PHY_DB_CALIB_CHG_PAPD,
107 IWL_PHY_DB_CALIB_CHG_TXP,
108 IWL_PHY_DB_MAX
109};
110
111/* for parsing of tx power channel group data that comes from the firmware*/
112struct iwl_phy_db_chg_txp {
113 __le32 space;
114 __le16 max_channel_idx;
115} __packed;
116
117struct iwl_phy_db *iwl_phy_db_init(struct device *dev);
118
119void iwl_phy_db_free(struct iwl_phy_db *phy_db);
120
121int iwl_phy_db_set_section(struct iwl_phy_db *phy_db,
122 enum iwl_phy_db_section_type type, u8 *data,
123 u16 size, gfp_t alloc_ctx);
124
125int iwl_phy_db_get_section_data(struct iwl_phy_db *phy_db,
126 enum iwl_phy_db_section_type type, u8 **data,
127 u16 *size, u16 ch_id);
128
129#endif /* __IWL_PHYDB_H__ */
diff --git a/drivers/net/wireless/iwlwifi/iwl-prph.h b/drivers/net/wireless/iwlwifi/iwl-prph.h
index 3b1069290fa9..dfd54662e3e6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-prph.h
+++ b/drivers/net/wireless/iwlwifi/iwl-prph.h
@@ -224,6 +224,7 @@
224#define SCD_TXFACT (SCD_BASE + 0x10) 224#define SCD_TXFACT (SCD_BASE + 0x10)
225#define SCD_ACTIVE (SCD_BASE + 0x14) 225#define SCD_ACTIVE (SCD_BASE + 0x14)
226#define SCD_QUEUECHAIN_SEL (SCD_BASE + 0xe8) 226#define SCD_QUEUECHAIN_SEL (SCD_BASE + 0xe8)
227#define SCD_CHAINEXT_EN (SCD_BASE + 0x244)
227#define SCD_AGGR_SEL (SCD_BASE + 0x248) 228#define SCD_AGGR_SEL (SCD_BASE + 0x248)
228#define SCD_INTERRUPT_MASK (SCD_BASE + 0x108) 229#define SCD_INTERRUPT_MASK (SCD_BASE + 0x108)
229 230
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h
index 6213c05a4b52..e959207c630a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h
@@ -347,7 +347,7 @@ void iwl_trans_tx_queue_set_status(struct iwl_trans *trans,
347void iwl_trans_pcie_tx_agg_setup(struct iwl_trans *trans, int queue, int fifo, 347void iwl_trans_pcie_tx_agg_setup(struct iwl_trans *trans, int queue, int fifo,
348 int sta_id, int tid, int frame_limit, u16 ssn); 348 int sta_id, int tid, int frame_limit, u16 ssn);
349void iwlagn_txq_free_tfd(struct iwl_trans *trans, struct iwl_tx_queue *txq, 349void iwlagn_txq_free_tfd(struct iwl_trans *trans, struct iwl_tx_queue *txq,
350 int index, enum dma_data_direction dma_dir); 350 enum dma_data_direction dma_dir);
351int iwl_tx_queue_reclaim(struct iwl_trans *trans, int txq_id, int index, 351int iwl_tx_queue_reclaim(struct iwl_trans *trans, int txq_id, int index,
352 struct sk_buff_head *skbs); 352 struct sk_buff_head *skbs);
353int iwl_queue_space(const struct iwl_queue *q); 353int iwl_queue_space(const struct iwl_queue *q);
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c
index 21a8a672fbb2..a8750238ee09 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c
@@ -204,33 +204,39 @@ static void iwlagn_unmap_tfd(struct iwl_trans *trans, struct iwl_cmd_meta *meta,
204 for (i = 1; i < num_tbs; i++) 204 for (i = 1; i < num_tbs; i++)
205 dma_unmap_single(trans->dev, iwl_tfd_tb_get_addr(tfd, i), 205 dma_unmap_single(trans->dev, iwl_tfd_tb_get_addr(tfd, i),
206 iwl_tfd_tb_get_len(tfd, i), dma_dir); 206 iwl_tfd_tb_get_len(tfd, i), dma_dir);
207
208 tfd->num_tbs = 0;
207} 209}
208 210
209/** 211/**
210 * iwlagn_txq_free_tfd - Free all chunks referenced by TFD [txq->q.read_ptr] 212 * iwlagn_txq_free_tfd - Free all chunks referenced by TFD [txq->q.read_ptr]
211 * @trans - transport private data 213 * @trans - transport private data
212 * @txq - tx queue 214 * @txq - tx queue
213 * @index - the index of the TFD to be freed 215 * @dma_dir - the direction of the DMA mapping
214 *@dma_dir - the direction of the DMA mapping
215 * 216 *
216 * Does NOT advance any TFD circular buffer read/write indexes 217 * Does NOT advance any TFD circular buffer read/write indexes
217 * Does NOT free the TFD itself (which is within circular buffer) 218 * Does NOT free the TFD itself (which is within circular buffer)
218 */ 219 */
219void iwlagn_txq_free_tfd(struct iwl_trans *trans, struct iwl_tx_queue *txq, 220void iwlagn_txq_free_tfd(struct iwl_trans *trans, struct iwl_tx_queue *txq,
220 int index, enum dma_data_direction dma_dir) 221 enum dma_data_direction dma_dir)
221{ 222{
222 struct iwl_tfd *tfd_tmp = txq->tfds; 223 struct iwl_tfd *tfd_tmp = txq->tfds;
223 224
225 /* rd_ptr is bounded by n_bd and idx is bounded by n_window */
226 int rd_ptr = txq->q.read_ptr;
227 int idx = get_cmd_index(&txq->q, rd_ptr);
228
224 lockdep_assert_held(&txq->lock); 229 lockdep_assert_held(&txq->lock);
225 230
226 iwlagn_unmap_tfd(trans, &txq->entries[index].meta, 231 /* We have only q->n_window txq->entries, but we use q->n_bd tfds */
227 &tfd_tmp[index], dma_dir); 232 iwlagn_unmap_tfd(trans, &txq->entries[idx].meta,
233 &tfd_tmp[rd_ptr], dma_dir);
228 234
229 /* free SKB */ 235 /* free SKB */
230 if (txq->entries) { 236 if (txq->entries) {
231 struct sk_buff *skb; 237 struct sk_buff *skb;
232 238
233 skb = txq->entries[index].skb; 239 skb = txq->entries[idx].skb;
234 240
235 /* Can be called from irqs-disabled context 241 /* Can be called from irqs-disabled context
236 * If skb is not NULL, it means that the whole queue is being 242 * If skb is not NULL, it means that the whole queue is being
@@ -238,7 +244,7 @@ void iwlagn_txq_free_tfd(struct iwl_trans *trans, struct iwl_tx_queue *txq,
238 */ 244 */
239 if (skb) { 245 if (skb) {
240 iwl_op_mode_free_skb(trans->op_mode, skb); 246 iwl_op_mode_free_skb(trans->op_mode, skb);
241 txq->entries[index].skb = NULL; 247 txq->entries[idx].skb = NULL;
242 } 248 }
243 } 249 }
244} 250}
@@ -973,7 +979,7 @@ int iwl_tx_queue_reclaim(struct iwl_trans *trans, int txq_id, int index,
973 979
974 iwlagn_txq_inval_byte_cnt_tbl(trans, txq); 980 iwlagn_txq_inval_byte_cnt_tbl(trans, txq);
975 981
976 iwlagn_txq_free_tfd(trans, txq, txq->q.read_ptr, DMA_TO_DEVICE); 982 iwlagn_txq_free_tfd(trans, txq, DMA_TO_DEVICE);
977 freed++; 983 freed++;
978 } 984 }
979 985
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
index 2e57161854b9..79c6b91417f9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
@@ -435,9 +435,7 @@ static void iwl_tx_queue_unmap(struct iwl_trans *trans, int txq_id)
435 435
436 spin_lock_bh(&txq->lock); 436 spin_lock_bh(&txq->lock);
437 while (q->write_ptr != q->read_ptr) { 437 while (q->write_ptr != q->read_ptr) {
438 /* The read_ptr needs to bound by q->n_window */ 438 iwlagn_txq_free_tfd(trans, txq, dma_dir);
439 iwlagn_txq_free_tfd(trans, txq, get_cmd_index(q, q->read_ptr),
440 dma_dir);
441 q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd); 439 q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd);
442 } 440 }
443 spin_unlock_bh(&txq->lock); 441 spin_unlock_bh(&txq->lock);
@@ -1060,6 +1058,11 @@ static void iwl_tx_start(struct iwl_trans *trans)
1060 iwl_write_prph(trans, SCD_DRAM_BASE_ADDR, 1058 iwl_write_prph(trans, SCD_DRAM_BASE_ADDR,
1061 trans_pcie->scd_bc_tbls.dma >> 10); 1059 trans_pcie->scd_bc_tbls.dma >> 10);
1062 1060
1061 /* The chain extension of the SCD doesn't work well. This feature is
1062 * enabled by default by the HW, so we need to disable it manually.
1063 */
1064 iwl_write_prph(trans, SCD_CHAINEXT_EN, 0);
1065
1063 /* Enable DMA channel */ 1066 /* Enable DMA channel */
1064 for (chan = 0; chan < FH_TCSR_CHNL_NUM ; chan++) 1067 for (chan = 0; chan < FH_TCSR_CHNL_NUM ; chan++)
1065 iwl_write_direct32(trans, FH_TCSR_CHNL_TX_CONFIG_REG(chan), 1068 iwl_write_direct32(trans, FH_TCSR_CHNL_TX_CONFIG_REG(chan),
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index fb787df01666..a0b7cfd34685 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -1555,6 +1555,7 @@ static int hwsim_tx_info_frame_received_nl(struct sk_buff *skb_2,
1555 hdr = (struct ieee80211_hdr *) skb->data; 1555 hdr = (struct ieee80211_hdr *) skb->data;
1556 mac80211_hwsim_monitor_ack(data2->hw, hdr->addr2); 1556 mac80211_hwsim_monitor_ack(data2->hw, hdr->addr2);
1557 } 1557 }
1558 txi->flags |= IEEE80211_TX_STAT_ACK;
1558 } 1559 }
1559 ieee80211_tx_status_irqsafe(data2->hw, skb); 1560 ieee80211_tx_status_irqsafe(data2->hw, skb);
1560 return 0; 1561 return 0;
@@ -1721,6 +1722,24 @@ static void hwsim_exit_netlink(void)
1721 "unregister family %i\n", ret); 1722 "unregister family %i\n", ret);
1722} 1723}
1723 1724
1725static const struct ieee80211_iface_limit hwsim_if_limits[] = {
1726 { .max = 1, .types = BIT(NL80211_IFTYPE_ADHOC) },
1727 { .max = 2048, .types = BIT(NL80211_IFTYPE_STATION) |
1728 BIT(NL80211_IFTYPE_P2P_CLIENT) |
1729#ifdef CONFIG_MAC80211_MESH
1730 BIT(NL80211_IFTYPE_MESH_POINT) |
1731#endif
1732 BIT(NL80211_IFTYPE_AP) |
1733 BIT(NL80211_IFTYPE_P2P_GO) },
1734};
1735
1736static const struct ieee80211_iface_combination hwsim_if_comb = {
1737 .limits = hwsim_if_limits,
1738 .n_limits = ARRAY_SIZE(hwsim_if_limits),
1739 .max_interfaces = 2048,
1740 .num_different_channels = 1,
1741};
1742
1724static int __init init_mac80211_hwsim(void) 1743static int __init init_mac80211_hwsim(void)
1725{ 1744{
1726 int i, err = 0; 1745 int i, err = 0;
@@ -1782,6 +1801,9 @@ static int __init init_mac80211_hwsim(void)
1782 hw->wiphy->n_addresses = 2; 1801 hw->wiphy->n_addresses = 2;
1783 hw->wiphy->addresses = data->addresses; 1802 hw->wiphy->addresses = data->addresses;
1784 1803
1804 hw->wiphy->iface_combinations = &hwsim_if_comb;
1805 hw->wiphy->n_iface_combinations = 1;
1806
1785 if (fake_hw_scan) { 1807 if (fake_hw_scan) {
1786 hw->wiphy->max_scan_ssids = 255; 1808 hw->wiphy->max_scan_ssids = 255;
1787 hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN; 1809 hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN;
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 87671446e24b..015fec3371a0 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -948,6 +948,19 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy,
948 bss_cfg->ssid.ssid_len = params->ssid_len; 948 bss_cfg->ssid.ssid_len = params->ssid_len;
949 } 949 }
950 950
951 switch (params->hidden_ssid) {
952 case NL80211_HIDDEN_SSID_NOT_IN_USE:
953 bss_cfg->bcast_ssid_ctl = 1;
954 break;
955 case NL80211_HIDDEN_SSID_ZERO_LEN:
956 bss_cfg->bcast_ssid_ctl = 0;
957 break;
958 case NL80211_HIDDEN_SSID_ZERO_CONTENTS:
959 /* firmware doesn't support this type of hidden SSID */
960 default:
961 return -EINVAL;
962 }
963
951 if (mwifiex_set_secure_params(priv, bss_cfg, params)) { 964 if (mwifiex_set_secure_params(priv, bss_cfg, params)) {
952 kfree(bss_cfg); 965 kfree(bss_cfg);
953 wiphy_err(wiphy, "Failed to parse secuirty parameters!\n"); 966 wiphy_err(wiphy, "Failed to parse secuirty parameters!\n");
diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h
index 9f674bbebe65..561452a5c818 100644
--- a/drivers/net/wireless/mwifiex/fw.h
+++ b/drivers/net/wireless/mwifiex/fw.h
@@ -122,6 +122,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {
122#define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 42) 122#define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 42)
123#define TLV_TYPE_UAP_BEACON_PERIOD (PROPRIETARY_TLV_BASE_ID + 44) 123#define TLV_TYPE_UAP_BEACON_PERIOD (PROPRIETARY_TLV_BASE_ID + 44)
124#define TLV_TYPE_UAP_DTIM_PERIOD (PROPRIETARY_TLV_BASE_ID + 45) 124#define TLV_TYPE_UAP_DTIM_PERIOD (PROPRIETARY_TLV_BASE_ID + 45)
125#define TLV_TYPE_UAP_BCAST_SSID (PROPRIETARY_TLV_BASE_ID + 48)
125#define TLV_TYPE_UAP_RTS_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 51) 126#define TLV_TYPE_UAP_RTS_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 51)
126#define TLV_TYPE_UAP_WPA_PASSPHRASE (PROPRIETARY_TLV_BASE_ID + 60) 127#define TLV_TYPE_UAP_WPA_PASSPHRASE (PROPRIETARY_TLV_BASE_ID + 60)
127#define TLV_TYPE_UAP_ENCRY_PROTOCOL (PROPRIETARY_TLV_BASE_ID + 64) 128#define TLV_TYPE_UAP_ENCRY_PROTOCOL (PROPRIETARY_TLV_BASE_ID + 64)
@@ -1209,6 +1210,11 @@ struct host_cmd_tlv_ssid {
1209 u8 ssid[0]; 1210 u8 ssid[0];
1210} __packed; 1211} __packed;
1211 1212
1213struct host_cmd_tlv_bcast_ssid {
1214 struct host_cmd_tlv tlv;
1215 u8 bcast_ctl;
1216} __packed;
1217
1212struct host_cmd_tlv_beacon_period { 1218struct host_cmd_tlv_beacon_period {
1213 struct host_cmd_tlv tlv; 1219 struct host_cmd_tlv tlv;
1214 __le16 period; 1220 __le16 period;
diff --git a/drivers/net/wireless/mwifiex/uap_cmd.c b/drivers/net/wireless/mwifiex/uap_cmd.c
index 76dfbc42a732..8173ab66066d 100644
--- a/drivers/net/wireless/mwifiex/uap_cmd.c
+++ b/drivers/net/wireless/mwifiex/uap_cmd.c
@@ -132,6 +132,7 @@ mwifiex_uap_bss_param_prepare(u8 *tlv, void *cmd_buf, u16 *param_size)
132 struct host_cmd_tlv_dtim_period *dtim_period; 132 struct host_cmd_tlv_dtim_period *dtim_period;
133 struct host_cmd_tlv_beacon_period *beacon_period; 133 struct host_cmd_tlv_beacon_period *beacon_period;
134 struct host_cmd_tlv_ssid *ssid; 134 struct host_cmd_tlv_ssid *ssid;
135 struct host_cmd_tlv_bcast_ssid *bcast_ssid;
135 struct host_cmd_tlv_channel_band *chan_band; 136 struct host_cmd_tlv_channel_band *chan_band;
136 struct host_cmd_tlv_frag_threshold *frag_threshold; 137 struct host_cmd_tlv_frag_threshold *frag_threshold;
137 struct host_cmd_tlv_rts_threshold *rts_threshold; 138 struct host_cmd_tlv_rts_threshold *rts_threshold;
@@ -153,6 +154,14 @@ mwifiex_uap_bss_param_prepare(u8 *tlv, void *cmd_buf, u16 *param_size)
153 cmd_size += sizeof(struct host_cmd_tlv) + 154 cmd_size += sizeof(struct host_cmd_tlv) +
154 bss_cfg->ssid.ssid_len; 155 bss_cfg->ssid.ssid_len;
155 tlv += sizeof(struct host_cmd_tlv) + bss_cfg->ssid.ssid_len; 156 tlv += sizeof(struct host_cmd_tlv) + bss_cfg->ssid.ssid_len;
157
158 bcast_ssid = (struct host_cmd_tlv_bcast_ssid *)tlv;
159 bcast_ssid->tlv.type = cpu_to_le16(TLV_TYPE_UAP_BCAST_SSID);
160 bcast_ssid->tlv.len =
161 cpu_to_le16(sizeof(bcast_ssid->bcast_ctl));
162 bcast_ssid->bcast_ctl = bss_cfg->bcast_ssid_ctl;
163 cmd_size += sizeof(struct host_cmd_tlv_bcast_ssid);
164 tlv += sizeof(struct host_cmd_tlv_bcast_ssid);
156 } 165 }
157 if (bss_cfg->channel && bss_cfg->channel <= MAX_CHANNEL_BAND_BG) { 166 if (bss_cfg->channel && bss_cfg->channel <= MAX_CHANNEL_BAND_BG) {
158 chan_band = (struct host_cmd_tlv_channel_band *)tlv; 167 chan_band = (struct host_cmd_tlv_channel_band *)tlv;
@@ -416,6 +425,7 @@ int mwifiex_uap_set_channel(struct mwifiex_private *priv, int channel)
416 if (!bss_cfg) 425 if (!bss_cfg)
417 return -ENOMEM; 426 return -ENOMEM;
418 427
428 mwifiex_set_sys_config_invalid_data(bss_cfg);
419 bss_cfg->band_cfg = BAND_CONFIG_MANUAL; 429 bss_cfg->band_cfg = BAND_CONFIG_MANUAL;
420 bss_cfg->channel = channel; 430 bss_cfg->channel = channel;
421 431
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index ca36cccaba31..8f754025b06e 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -396,8 +396,7 @@ struct rt2x00_intf {
396 * for hardware which doesn't support hardware 396 * for hardware which doesn't support hardware
397 * sequence counting. 397 * sequence counting.
398 */ 398 */
399 spinlock_t seqlock; 399 atomic_t seqno;
400 u16 seqno;
401}; 400};
402 401
403static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif) 402static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif)
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index b49773ef72f2..dd24b2663b5e 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -277,7 +277,6 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
277 else 277 else
278 rt2x00dev->intf_sta_count++; 278 rt2x00dev->intf_sta_count++;
279 279
280 spin_lock_init(&intf->seqlock);
281 mutex_init(&intf->beacon_skb_mutex); 280 mutex_init(&intf->beacon_skb_mutex);
282 intf->beacon = entry; 281 intf->beacon = entry;
283 282
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 4c662eccf53c..2fd830103415 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -207,6 +207,7 @@ static void rt2x00queue_create_tx_descriptor_seq(struct rt2x00_dev *rt2x00dev,
207 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); 207 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
208 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 208 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
209 struct rt2x00_intf *intf = vif_to_intf(tx_info->control.vif); 209 struct rt2x00_intf *intf = vif_to_intf(tx_info->control.vif);
210 u16 seqno;
210 211
211 if (!(tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ)) 212 if (!(tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ))
212 return; 213 return;
@@ -238,15 +239,13 @@ static void rt2x00queue_create_tx_descriptor_seq(struct rt2x00_dev *rt2x00dev,
238 * sequence counting per-frame, since those will override the 239 * sequence counting per-frame, since those will override the
239 * sequence counter given by mac80211. 240 * sequence counter given by mac80211.
240 */ 241 */
241 spin_lock(&intf->seqlock);
242
243 if (test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags)) 242 if (test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags))
244 intf->seqno += 0x10; 243 seqno = atomic_add_return(0x10, &intf->seqno);
245 hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); 244 else
246 hdr->seq_ctrl |= cpu_to_le16(intf->seqno); 245 seqno = atomic_read(&intf->seqno);
247
248 spin_unlock(&intf->seqlock);
249 246
247 hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
248 hdr->seq_ctrl |= cpu_to_le16(seqno);
250} 249}
251 250
252static void rt2x00queue_create_tx_descriptor_plcp(struct rt2x00_dev *rt2x00dev, 251static void rt2x00queue_create_tx_descriptor_plcp(struct rt2x00_dev *rt2x00dev,
diff --git a/drivers/net/wireless/rtl818x/rtl8187/leds.c b/drivers/net/wireless/rtl818x/rtl8187/leds.c
index 2e0de2f5f0f9..c2d5b495c179 100644
--- a/drivers/net/wireless/rtl818x/rtl8187/leds.c
+++ b/drivers/net/wireless/rtl818x/rtl8187/leds.c
@@ -117,7 +117,7 @@ static void rtl8187_led_brightness_set(struct led_classdev *led_dev,
117 radio_on = true; 117 radio_on = true;
118 } else if (radio_on) { 118 } else if (radio_on) {
119 radio_on = false; 119 radio_on = false;
120 cancel_delayed_work_sync(&priv->led_on); 120 cancel_delayed_work(&priv->led_on);
121 ieee80211_queue_delayed_work(hw, &priv->led_off, 0); 121 ieee80211_queue_delayed_work(hw, &priv->led_off, 0);
122 } 122 }
123 } else if (radio_on) { 123 } else if (radio_on) {
diff --git a/drivers/net/wireless/ti/wl1251/sdio.c b/drivers/net/wireless/ti/wl1251/sdio.c
index 1b851f650e07..e2750a12c6f1 100644
--- a/drivers/net/wireless/ti/wl1251/sdio.c
+++ b/drivers/net/wireless/ti/wl1251/sdio.c
@@ -260,6 +260,7 @@ static int wl1251_sdio_probe(struct sdio_func *func,
260 } 260 }
261 261
262 if (wl->irq) { 262 if (wl->irq) {
263 irq_set_status_flags(wl->irq, IRQ_NOAUTOEN);
263 ret = request_irq(wl->irq, wl1251_line_irq, 0, "wl1251", wl); 264 ret = request_irq(wl->irq, wl1251_line_irq, 0, "wl1251", wl);
264 if (ret < 0) { 265 if (ret < 0) {
265 wl1251_error("request_irq() failed: %d", ret); 266 wl1251_error("request_irq() failed: %d", ret);
@@ -267,7 +268,6 @@ static int wl1251_sdio_probe(struct sdio_func *func,
267 } 268 }
268 269
269 irq_set_irq_type(wl->irq, IRQ_TYPE_EDGE_RISING); 270 irq_set_irq_type(wl->irq, IRQ_TYPE_EDGE_RISING);
270 disable_irq(wl->irq);
271 271
272 wl1251_sdio_ops.enable_irq = wl1251_enable_line_irq; 272 wl1251_sdio_ops.enable_irq = wl1251_enable_line_irq;
273 wl1251_sdio_ops.disable_irq = wl1251_disable_line_irq; 273 wl1251_sdio_ops.disable_irq = wl1251_disable_line_irq;
diff --git a/drivers/net/wireless/ti/wl1251/spi.c b/drivers/net/wireless/ti/wl1251/spi.c
index 6248c354fc5c..87f6305bda2c 100644
--- a/drivers/net/wireless/ti/wl1251/spi.c
+++ b/drivers/net/wireless/ti/wl1251/spi.c
@@ -281,6 +281,7 @@ static int __devinit wl1251_spi_probe(struct spi_device *spi)
281 281
282 wl->use_eeprom = pdata->use_eeprom; 282 wl->use_eeprom = pdata->use_eeprom;
283 283
284 irq_set_status_flags(wl->irq, IRQ_NOAUTOEN);
284 ret = request_irq(wl->irq, wl1251_irq, 0, DRIVER_NAME, wl); 285 ret = request_irq(wl->irq, wl1251_irq, 0, DRIVER_NAME, wl);
285 if (ret < 0) { 286 if (ret < 0) {
286 wl1251_error("request_irq() failed: %d", ret); 287 wl1251_error("request_irq() failed: %d", ret);
@@ -289,8 +290,6 @@ static int __devinit wl1251_spi_probe(struct spi_device *spi)
289 290
290 irq_set_irq_type(wl->irq, IRQ_TYPE_EDGE_RISING); 291 irq_set_irq_type(wl->irq, IRQ_TYPE_EDGE_RISING);
291 292
292 disable_irq(wl->irq);
293
294 ret = wl1251_init_ieee80211(wl); 293 ret = wl1251_init_ieee80211(wl);
295 if (ret) 294 if (ret)
296 goto out_irq; 295 goto out_irq;
diff --git a/drivers/net/wireless/ti/wlcore/acx.c b/drivers/net/wireless/ti/wlcore/acx.c
index 509aa881d790..f3d6fa508269 100644
--- a/drivers/net/wireless/ti/wlcore/acx.c
+++ b/drivers/net/wireless/ti/wlcore/acx.c
@@ -1715,6 +1715,7 @@ out:
1715 1715
1716} 1716}
1717 1717
1718#ifdef CONFIG_PM
1718/* Set the global behaviour of RX filters - On/Off + default action */ 1719/* Set the global behaviour of RX filters - On/Off + default action */
1719int wl1271_acx_default_rx_filter_enable(struct wl1271 *wl, bool enable, 1720int wl1271_acx_default_rx_filter_enable(struct wl1271 *wl, bool enable,
1720 enum rx_filter_action action) 1721 enum rx_filter_action action)
@@ -1794,3 +1795,4 @@ out:
1794 kfree(acx); 1795 kfree(acx);
1795 return ret; 1796 return ret;
1796} 1797}
1798#endif /* CONFIG_PM */
diff --git a/drivers/net/wireless/ti/wlcore/acx.h b/drivers/net/wireless/ti/wlcore/acx.h
index 8106b2ebfe60..e6a74869a5ff 100644
--- a/drivers/net/wireless/ti/wlcore/acx.h
+++ b/drivers/net/wireless/ti/wlcore/acx.h
@@ -1330,9 +1330,11 @@ int wl1271_acx_set_inconnection_sta(struct wl1271 *wl, u8 *addr);
1330int wl1271_acx_fm_coex(struct wl1271 *wl); 1330int wl1271_acx_fm_coex(struct wl1271 *wl);
1331int wl12xx_acx_set_rate_mgmt_params(struct wl1271 *wl); 1331int wl12xx_acx_set_rate_mgmt_params(struct wl1271 *wl);
1332int wl12xx_acx_config_hangover(struct wl1271 *wl); 1332int wl12xx_acx_config_hangover(struct wl1271 *wl);
1333
1334#ifdef CONFIG_PM
1333int wl1271_acx_default_rx_filter_enable(struct wl1271 *wl, bool enable, 1335int wl1271_acx_default_rx_filter_enable(struct wl1271 *wl, bool enable,
1334 enum rx_filter_action action); 1336 enum rx_filter_action action);
1335int wl1271_acx_set_rx_filter(struct wl1271 *wl, u8 index, bool enable, 1337int wl1271_acx_set_rx_filter(struct wl1271 *wl, u8 index, bool enable,
1336 struct wl12xx_rx_filter *filter); 1338 struct wl12xx_rx_filter *filter);
1337 1339#endif /* CONFIG_PM */
1338#endif /* __WL1271_ACX_H__ */ 1340#endif /* __WL1271_ACX_H__ */
diff --git a/drivers/net/wireless/ti/wlcore/rx.c b/drivers/net/wireless/ti/wlcore/rx.c
index 1f1d9488dfb6..d6a3c6b07827 100644
--- a/drivers/net/wireless/ti/wlcore/rx.c
+++ b/drivers/net/wireless/ti/wlcore/rx.c
@@ -279,6 +279,7 @@ void wl12xx_rx(struct wl1271 *wl, struct wl_fw_status *status)
279 wl12xx_rearm_rx_streaming(wl, active_hlids); 279 wl12xx_rearm_rx_streaming(wl, active_hlids);
280} 280}
281 281
282#ifdef CONFIG_PM
282int wl1271_rx_filter_enable(struct wl1271 *wl, 283int wl1271_rx_filter_enable(struct wl1271 *wl,
283 int index, bool enable, 284 int index, bool enable,
284 struct wl12xx_rx_filter *filter) 285 struct wl12xx_rx_filter *filter)
@@ -314,3 +315,4 @@ void wl1271_rx_filter_clear_all(struct wl1271 *wl)
314 wl1271_rx_filter_enable(wl, i, 0, NULL); 315 wl1271_rx_filter_enable(wl, i, 0, NULL);
315 } 316 }
316} 317}
318#endif /* CONFIG_PM */