--- /dev/null
+From bfd37bb5f681961e255fd2f346c20fdae2ef3f27 Mon Sep 17 00:00:00 2001
+From: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Date: Tue, 5 Jun 2012 12:31:32 +0100
+Subject: ASoC: wm8994: Apply volume updates with clocks enabled
+
+From: Mark Brown <broonie@opensource.wolfsonmicro.com>
+
+commit bfd37bb5f681961e255fd2f346c20fdae2ef3f27 upstream.
+
+Volume updates may not be acted upon if there is no clock applied when
+the volume update is written. Ensure this doesn't happen by writing out
+registers with volume updates after we enable each of the clocks.
+
+There are more registers updated than before as previously we were
+relying on wm_hubs to set those for controls it manages.
+
+Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/codecs/wm8994.c | 93 ++++++++++++++++++++++++++++------------------
+ 1 file changed, 58 insertions(+), 35 deletions(-)
+
+--- a/sound/soc/codecs/wm8994.c
++++ b/sound/soc/codecs/wm8994.c
+@@ -46,6 +46,39 @@
+ #define WM8994_NUM_DRC 3
+ #define WM8994_NUM_EQ 3
+
++static struct {
++ unsigned int reg;
++ unsigned int mask;
++} wm8994_vu_bits[] = {
++ { WM8994_LEFT_LINE_INPUT_1_2_VOLUME, WM8994_IN1_VU },
++ { WM8994_RIGHT_LINE_INPUT_1_2_VOLUME, WM8994_IN1_VU },
++ { WM8994_LEFT_LINE_INPUT_3_4_VOLUME, WM8994_IN2_VU },
++ { WM8994_RIGHT_LINE_INPUT_3_4_VOLUME, WM8994_IN2_VU },
++ { WM8994_SPEAKER_VOLUME_LEFT, WM8994_SPKOUT_VU },
++ { WM8994_SPEAKER_VOLUME_RIGHT, WM8994_SPKOUT_VU },
++ { WM8994_LEFT_OUTPUT_VOLUME, WM8994_HPOUT1_VU },
++ { WM8994_RIGHT_OUTPUT_VOLUME, WM8994_HPOUT1_VU },
++ { WM8994_LEFT_OPGA_VOLUME, WM8994_MIXOUT_VU },
++ { WM8994_RIGHT_OPGA_VOLUME, WM8994_MIXOUT_VU },
++
++ { WM8994_AIF1_DAC1_LEFT_VOLUME, WM8994_AIF1DAC1_VU },
++ { WM8994_AIF1_DAC1_RIGHT_VOLUME, WM8994_AIF1DAC1_VU },
++ { WM8994_AIF1_DAC2_LEFT_VOLUME, WM8994_AIF1DAC2_VU },
++ { WM8994_AIF1_DAC2_RIGHT_VOLUME, WM8994_AIF1DAC2_VU },
++ { WM8994_AIF2_DAC_LEFT_VOLUME, WM8994_AIF2DAC_VU },
++ { WM8994_AIF2_DAC_RIGHT_VOLUME, WM8994_AIF2DAC_VU },
++ { WM8994_AIF1_ADC1_LEFT_VOLUME, WM8994_AIF1ADC1_VU },
++ { WM8994_AIF1_ADC1_RIGHT_VOLUME, WM8994_AIF1ADC1_VU },
++ { WM8994_AIF1_ADC2_LEFT_VOLUME, WM8994_AIF1ADC2_VU },
++ { WM8994_AIF1_ADC2_RIGHT_VOLUME, WM8994_AIF1ADC2_VU },
++ { WM8994_AIF2_ADC_LEFT_VOLUME, WM8994_AIF2ADC_VU },
++ { WM8994_AIF2_ADC_RIGHT_VOLUME, WM8994_AIF1ADC2_VU },
++ { WM8994_DAC1_LEFT_VOLUME, WM8994_DAC1_VU },
++ { WM8994_DAC1_RIGHT_VOLUME, WM8994_DAC1_VU },
++ { WM8994_DAC2_LEFT_VOLUME, WM8994_DAC2_VU },
++ { WM8994_DAC2_RIGHT_VOLUME, WM8994_DAC2_VU },
++};
++
+ static int wm8994_drc_base[] = {
+ WM8994_AIF1_DRC1_1,
+ WM8994_AIF1_DRC2_1,
+@@ -1006,6 +1039,7 @@ static int aif1clk_ev(struct snd_soc_dap
+ struct snd_soc_codec *codec = w->codec;
+ struct wm8994 *control = codec->control_data;
+ int mask = WM8994_AIF1DAC1L_ENA | WM8994_AIF1DAC1R_ENA;
++ int i;
+ int dac;
+ int adc;
+ int val;
+@@ -1064,6 +1098,13 @@ static int aif1clk_ev(struct snd_soc_dap
+ WM8994_AIF1DAC2L_ENA);
+ break;
+
++ case SND_SOC_DAPM_POST_PMU:
++ for (i = 0; i < ARRAY_SIZE(wm8994_vu_bits); i++)
++ snd_soc_write(codec, wm8994_vu_bits[i].reg,
++ snd_soc_read(codec,
++ wm8994_vu_bits[i].reg));
++ break;
++
+ case SND_SOC_DAPM_PRE_PMD:
+ case SND_SOC_DAPM_POST_PMD:
+ snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5,
+@@ -1089,6 +1130,7 @@ static int aif2clk_ev(struct snd_soc_dap
+ struct snd_kcontrol *kcontrol, int event)
+ {
+ struct snd_soc_codec *codec = w->codec;
++ int i;
+ int dac;
+ int adc;
+ int val;
+@@ -1139,6 +1181,13 @@ static int aif2clk_ev(struct snd_soc_dap
+ WM8994_AIF2DACR_ENA);
+ break;
+
++ case SND_SOC_DAPM_POST_PMU:
++ for (i = 0; i < ARRAY_SIZE(wm8994_vu_bits); i++)
++ snd_soc_write(codec, wm8994_vu_bits[i].reg,
++ snd_soc_read(codec,
++ wm8994_vu_bits[i].reg));
++ break;
++
+ case SND_SOC_DAPM_PRE_PMD:
+ case SND_SOC_DAPM_POST_PMD:
+ snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5,
+@@ -1587,9 +1636,11 @@ SND_SOC_DAPM_POST("Late Disable PGA", la
+
+ static const struct snd_soc_dapm_widget wm8994_lateclk_widgets[] = {
+ SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8994_AIF1_CLOCKING_1, 0, 0, aif1clk_ev,
+- SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD),
++ SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
++ SND_SOC_DAPM_PRE_PMD),
+ SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8994_AIF2_CLOCKING_1, 0, 0, aif2clk_ev,
+- SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD),
++ SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
++ SND_SOC_DAPM_PRE_PMD),
+ SND_SOC_DAPM_PGA("Direct Voice", SND_SOC_NOPM, 0, 0, NULL, 0),
+ SND_SOC_DAPM_MIXER("SPKL", WM8994_POWER_MANAGEMENT_3, 8, 0,
+ left_speaker_mixer, ARRAY_SIZE(left_speaker_mixer)),
+@@ -3943,39 +3994,11 @@ static int wm8994_codec_probe(struct snd
+
+ pm_runtime_put(codec->dev);
+
+- /* Latch volume updates (right only; we always do left then right). */
+- snd_soc_update_bits(codec, WM8994_AIF1_DAC1_LEFT_VOLUME,
+- WM8994_AIF1DAC1_VU, WM8994_AIF1DAC1_VU);
+- snd_soc_update_bits(codec, WM8994_AIF1_DAC1_RIGHT_VOLUME,
+- WM8994_AIF1DAC1_VU, WM8994_AIF1DAC1_VU);
+- snd_soc_update_bits(codec, WM8994_AIF1_DAC2_LEFT_VOLUME,
+- WM8994_AIF1DAC2_VU, WM8994_AIF1DAC2_VU);
+- snd_soc_update_bits(codec, WM8994_AIF1_DAC2_RIGHT_VOLUME,
+- WM8994_AIF1DAC2_VU, WM8994_AIF1DAC2_VU);
+- snd_soc_update_bits(codec, WM8994_AIF2_DAC_LEFT_VOLUME,
+- WM8994_AIF2DAC_VU, WM8994_AIF2DAC_VU);
+- snd_soc_update_bits(codec, WM8994_AIF2_DAC_RIGHT_VOLUME,
+- WM8994_AIF2DAC_VU, WM8994_AIF2DAC_VU);
+- snd_soc_update_bits(codec, WM8994_AIF1_ADC1_LEFT_VOLUME,
+- WM8994_AIF1ADC1_VU, WM8994_AIF1ADC1_VU);
+- snd_soc_update_bits(codec, WM8994_AIF1_ADC1_RIGHT_VOLUME,
+- WM8994_AIF1ADC1_VU, WM8994_AIF1ADC1_VU);
+- snd_soc_update_bits(codec, WM8994_AIF1_ADC2_LEFT_VOLUME,
+- WM8994_AIF1ADC2_VU, WM8994_AIF1ADC2_VU);
+- snd_soc_update_bits(codec, WM8994_AIF1_ADC2_RIGHT_VOLUME,
+- WM8994_AIF1ADC2_VU, WM8994_AIF1ADC2_VU);
+- snd_soc_update_bits(codec, WM8994_AIF2_ADC_LEFT_VOLUME,
+- WM8994_AIF2ADC_VU, WM8994_AIF1ADC2_VU);
+- snd_soc_update_bits(codec, WM8994_AIF2_ADC_RIGHT_VOLUME,
+- WM8994_AIF2ADC_VU, WM8994_AIF1ADC2_VU);
+- snd_soc_update_bits(codec, WM8994_DAC1_LEFT_VOLUME,
+- WM8994_DAC1_VU, WM8994_DAC1_VU);
+- snd_soc_update_bits(codec, WM8994_DAC1_RIGHT_VOLUME,
+- WM8994_DAC1_VU, WM8994_DAC1_VU);
+- snd_soc_update_bits(codec, WM8994_DAC2_LEFT_VOLUME,
+- WM8994_DAC2_VU, WM8994_DAC2_VU);
+- snd_soc_update_bits(codec, WM8994_DAC2_RIGHT_VOLUME,
+- WM8994_DAC2_VU, WM8994_DAC2_VU);
++ /* Latch volume update bits */
++ for (i = 0; i < ARRAY_SIZE(wm8994_vu_bits); i++)
++ snd_soc_update_bits(codec, wm8994_vu_bits[i].reg,
++ wm8994_vu_bits[i].mask,
++ wm8994_vu_bits[i].mask);
+
+ /* Set the low bit of the 3D stereo depth so TLV matches */
+ snd_soc_update_bits(codec, WM8994_AIF1_DAC1_FILTERS_2,
--- /dev/null
+From c8fdc1b56611faa7b38eab6b99da5e20113661ff Mon Sep 17 00:00:00 2001
+From: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Date: Tue, 5 Jun 2012 12:25:19 +0100
+Subject: ASoC: wm8994: Ensure all AIFnCLK events are run from the _late variants
+
+From: Mark Brown <broonie@opensource.wolfsonmicro.com>
+
+commit c8fdc1b56611faa7b38eab6b99da5e20113661ff upstream.
+
+Ensure that all the actions get taken at appropriate times by calling the
+_PRE and _POST events for the aifNclk_ev functions explicitly.
+
+Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/codecs/wm8994.c | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+--- a/sound/soc/codecs/wm8994.c
++++ b/sound/soc/codecs/wm8994.c
+@@ -1207,17 +1207,19 @@ static int late_enable_ev(struct snd_soc
+ switch (event) {
+ case SND_SOC_DAPM_PRE_PMU:
+ if (wm8994->aif1clk_enable) {
+- aif1clk_ev(w, kcontrol, event);
++ aif1clk_ev(w, kcontrol, SND_SOC_DAPM_PRE_PMU);
+ snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1,
+ WM8994_AIF1CLK_ENA_MASK,
+ WM8994_AIF1CLK_ENA);
++ aif1clk_ev(w, kcontrol, SND_SOC_DAPM_POST_PMU);
+ wm8994->aif1clk_enable = 0;
+ }
+ if (wm8994->aif2clk_enable) {
+- aif2clk_ev(w, kcontrol, event);
++ aif2clk_ev(w, kcontrol, SND_SOC_DAPM_PRE_PMU);
+ snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1,
+ WM8994_AIF2CLK_ENA_MASK,
+ WM8994_AIF2CLK_ENA);
++ aif2clk_ev(w, kcontrol, SND_SOC_DAPM_POST_PMU);
+ wm8994->aif2clk_enable = 0;
+ }
+ break;
+@@ -1238,15 +1240,17 @@ static int late_disable_ev(struct snd_so
+ switch (event) {
+ case SND_SOC_DAPM_POST_PMD:
+ if (wm8994->aif1clk_disable) {
++ aif1clk_ev(w, kcontrol, SND_SOC_DAPM_PRE_PMD);
+ snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1,
+ WM8994_AIF1CLK_ENA_MASK, 0);
+- aif1clk_ev(w, kcontrol, event);
++ aif1clk_ev(w, kcontrol, SND_SOC_DAPM_POST_PMD);
+ wm8994->aif1clk_disable = 0;
+ }
+ if (wm8994->aif2clk_disable) {
++ aif2clk_ev(w, kcontrol, SND_SOC_DAPM_PRE_PMD);
+ snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1,
+ WM8994_AIF2CLK_ENA_MASK, 0);
+- aif2clk_ev(w, kcontrol, event);
++ aif2clk_ev(w, kcontrol, SND_SOC_DAPM_POST_PMD);
+ wm8994->aif2clk_disable = 0;
+ }
+ break;
--- /dev/null
+From d012d04e4d6312ea157b6cf19e9689af934f5aa7 Mon Sep 17 00:00:00 2001
+From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+Date: Wed, 6 Jun 2012 13:55:02 +0200
+Subject: iwlwifi: disable the buggy chain extension feature in HW
+
+From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+
+commit d012d04e4d6312ea157b6cf19e9689af934f5aa7 upstream.
+
+This feature has been reported to be buggy and enabled by
+default. We therefore need to disable it manually.
+
+Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/iwlwifi/iwl-prph.h | 1 +
+ drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 5 +++++
+ 2 files changed, 6 insertions(+)
+
+--- a/drivers/net/wireless/iwlwifi/iwl-prph.h
++++ b/drivers/net/wireless/iwlwifi/iwl-prph.h
+@@ -224,6 +224,7 @@
+ #define SCD_TXFACT (SCD_BASE + 0x10)
+ #define SCD_ACTIVE (SCD_BASE + 0x14)
+ #define SCD_QUEUECHAIN_SEL (SCD_BASE + 0xe8)
++#define SCD_CHAINEXT_EN (SCD_BASE + 0x244)
+ #define SCD_AGGR_SEL (SCD_BASE + 0x248)
+ #define SCD_INTERRUPT_MASK (SCD_BASE + 0x108)
+
+--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
++++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
+@@ -1128,6 +1128,11 @@ static void iwl_tx_start(struct iwl_tran
+ iwl_write_prph(trans, SCD_DRAM_BASE_ADDR,
+ trans_pcie->scd_bc_tbls.dma >> 10);
+
++ /* The chain extension of the SCD doesn't work well. This feature is
++ * enabled by default by the HW, so we need to disable it manually.
++ */
++ iwl_write_prph(trans, SCD_CHAINEXT_EN, 0);
++
+ /* Enable DMA channel */
+ for (chan = 0; chan < FH_TCSR_CHNL_NUM ; chan++)
+ iwl_write_direct32(trans, FH_TCSR_CHNL_TX_CONFIG_REG(chan),
--- /dev/null
+From fcb6ff5e2cb83e1de10631f6621f45ca3401bf61 Mon Sep 17 00:00:00 2001
+From: Johannes Berg <johannes.berg@intel.com>
+Date: Mon, 4 Jun 2012 13:43:11 +0200
+Subject: iwlwifi: disable WoWLAN if !CONFIG_PM_SLEEP
+
+From: Johannes Berg <johannes.berg@intel.com>
+
+commit fcb6ff5e2cb83e1de10631f6621f45ca3401bf61 upstream.
+
+If CONFIG_PM_SLEEP is disabled, then iwlwifi doesn't
+support suspend/resume handlers and thus mac80211
+(correctly) refuses advertising WoWLAN. Disable
+WoWLAN in the driver in this case.
+
+Reported-by: Sebastian Kemper <sebastian_ml@gmx.net>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/iwlwifi/iwl-mac80211.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/net/wireless/iwlwifi/iwl-mac80211.c
++++ b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
+@@ -196,6 +196,7 @@ int iwlagn_mac_setup_register(struct iwl
+ WIPHY_FLAG_DISABLE_BEACON_HINTS |
+ WIPHY_FLAG_IBSS_RSN;
+
++#ifdef CONFIG_PM_SLEEP
+ if (priv->fw->img[IWL_UCODE_WOWLAN].sec[0].len &&
+ trans(priv)->ops->wowlan_suspend &&
+ device_can_wakeup(trans(priv)->dev)) {
+@@ -214,6 +215,7 @@ int iwlagn_mac_setup_register(struct iwl
+ hw->wiphy->wowlan.pattern_max_len =
+ IWLAGN_WOWLAN_MAX_PATTERN_LEN;
+ }
++#endif
+
+ if (iwlagn_mod_params.power_save)
+ hw->wiphy->flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT;
--- /dev/null
+From d6ee27eb13beab94056e0de52d81220058ca2297 Mon Sep 17 00:00:00 2001
+From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+Date: Wed, 6 Jun 2012 09:13:36 +0200
+Subject: iwlwifi: don't mess up the SCD when removing a key
+
+From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+
+commit d6ee27eb13beab94056e0de52d81220058ca2297 upstream.
+
+When we remove a key, we put a key index which was supposed
+to tell the fw that we are actually removing the key. But
+instead the fw took that index as a valid index and messed
+up the SRAM of the device.
+
+This memory corruption on the device mangled the data of
+the SCD. The impact on the user is that SCD queue 2 got
+stuck after having removed keys.
+The message is the log that was printed is:
+
+Queue 2 stuck for 10000ms
+
+This doesn't seem to fix the higher queues that get stuck
+from time to time.
+
+Reviewed-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
+Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/iwlwifi/iwl-agn-sta.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
++++ b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
+@@ -1222,7 +1222,7 @@ int iwl_remove_dynamic_key(struct iwl_pr
+ key_flags |= STA_KEY_MULTICAST_MSK;
+
+ sta_cmd.key.key_flags = key_flags;
+- sta_cmd.key.key_offset = WEP_INVALID_OFFSET;
++ sta_cmd.key.key_offset = keyconf->hw_key_idx;
+ sta_cmd.sta.modify_mask = STA_MODIFY_KEY_MASK;
+ sta_cmd.mode = STA_CONTROL_MODIFY_MSK;
+
--- /dev/null
+From 0e1fa7ef25004b9c1a14147bce61c15c2f1c6744 Mon Sep 17 00:00:00 2001
+From: Johannes Berg <johannes.berg@intel.com>
+Date: Tue, 5 Jun 2012 09:38:35 +0200
+Subject: iwlwifi: unregister LEDs if mac80211 registration fails
+
+From: Johannes Berg <johannes.berg@intel.com>
+
+commit 0e1fa7ef25004b9c1a14147bce61c15c2f1c6744 upstream.
+
+Otherwise the LEDs stick around and cause issues the
+next time around since they're still there but not
+really hooked up.
+
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/iwlwifi/iwl-mac80211.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/wireless/iwlwifi/iwl-mac80211.c
++++ b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
+@@ -245,6 +245,7 @@ int iwlagn_mac_setup_register(struct iwl
+ ret = ieee80211_register_hw(priv->hw);
+ if (ret) {
+ IWL_ERR(priv, "Failed to register hw (error %d)\n", ret);
++ iwl_leds_exit(priv);
+ return ret;
+ }
+ priv->mac80211_registered = 1;
--- /dev/null
+From d2c8b15d0cb486f4938ba7f2af349d9d1220cb10 Mon Sep 17 00:00:00 2001
+From: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
+Date: Tue, 5 Jun 2012 20:24:37 +0200
+Subject: iwlwifi: use correct supported firmware for 6035 and 6000g2
+
+From: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
+
+commit d2c8b15d0cb486f4938ba7f2af349d9d1220cb10 upstream.
+
+My patch
+
+ iwlwifi: use correct released ucode version
+
+did not correctly report supported firmware
+for the 6035 device. This patch fixes it. The
+minimum supported firmware version for 6035
+is v6.
+
+Also correct the minimum supported firmware
+version for the 6000g2 series of devices.
+
+Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
+Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/iwlwifi/iwl-6000.c | 23 +++++++++++++++++++++--
+ 1 file changed, 21 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
++++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
+@@ -49,17 +49,20 @@
+ #define IWL6000_UCODE_API_MAX 6
+ #define IWL6050_UCODE_API_MAX 5
+ #define IWL6000G2_UCODE_API_MAX 6
++#define IWL6035_UCODE_API_MAX 6
+
+ /* Oldest version we won't warn about */
+ #define IWL6000_UCODE_API_OK 4
+ #define IWL6000G2_UCODE_API_OK 5
+ #define IWL6050_UCODE_API_OK 5
+ #define IWL6000G2B_UCODE_API_OK 6
++#define IWL6035_UCODE_API_OK 6
+
+ /* Lowest firmware API version supported */
+ #define IWL6000_UCODE_API_MIN 4
+ #define IWL6050_UCODE_API_MIN 4
+-#define IWL6000G2_UCODE_API_MIN 4
++#define IWL6000G2_UCODE_API_MIN 5
++#define IWL6035_UCODE_API_MIN 6
+
+ #define IWL6000_FW_PRE "iwlwifi-6000-"
+ #define IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE __stringify(api) ".ucode"
+@@ -425,9 +428,25 @@ const struct iwl_cfg iwl6030_2bg_cfg = {
+ IWL_DEVICE_6030,
+ };
+
++#define IWL_DEVICE_6035 \
++ .fw_name_pre = IWL6030_FW_PRE, \
++ .ucode_api_max = IWL6035_UCODE_API_MAX, \
++ .ucode_api_ok = IWL6035_UCODE_API_OK, \
++ .ucode_api_min = IWL6035_UCODE_API_MIN, \
++ .device_family = IWL_DEVICE_FAMILY_6030, \
++ .max_inst_size = IWL60_RTC_INST_SIZE, \
++ .max_data_size = IWL60_RTC_DATA_SIZE, \
++ .eeprom_ver = EEPROM_6030_EEPROM_VERSION, \
++ .eeprom_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
++ .base_params = &iwl6000_g2_base_params, \
++ .bt_params = &iwl6000_bt_params, \
++ .need_temp_offset_calib = true, \
++ .led_mode = IWL_LED_RF_STATE, \
++ .adv_pm = true
++
+ const struct iwl_cfg iwl6035_2agn_cfg = {
+ .name = "Intel(R) Centrino(R) Advanced-N 6235 AGN",
+- IWL_DEVICE_6030,
++ IWL_DEVICE_6035,
+ .ht_params = &iwl6000_ht_params,
+ };
+
--- /dev/null
+From 71ecfa1893034eeb1c93e02e22ee2ad26d080858 Mon Sep 17 00:00:00 2001
+From: Johannes Berg <johannes.berg@intel.com>
+Date: Thu, 31 May 2012 15:09:27 +0200
+Subject: mac80211: clean up remain-on-channel on interface stop
+
+From: Johannes Berg <johannes.berg@intel.com>
+
+commit 71ecfa1893034eeb1c93e02e22ee2ad26d080858 upstream.
+
+When any interface goes down, it could be the one that we
+were doing a remain-on-channel with. We therefore need to
+cancel the remain-on-channel and flush the related work
+structs so they don't run after the interface has been
+removed or even destroyed.
+
+It's also possible in this case that an off-channel SKB
+was never transmitted, so free it if this is the case.
+Note that this can also happen if the driver finishes
+the off-channel period without ever starting it.
+
+Reported-by: Nirav Shah <nirav.j2.shah@intel.com>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/mac80211/iface.c | 12 ++++++++++++
+ net/mac80211/offchannel.c | 16 ++++++++++++++++
+ 2 files changed, 28 insertions(+)
+
+--- a/net/mac80211/iface.c
++++ b/net/mac80211/iface.c
+@@ -514,6 +514,18 @@ static void ieee80211_do_stop(struct iee
+ ieee80211_configure_filter(local);
+ break;
+ default:
++ mutex_lock(&local->mtx);
++ if (local->hw_roc_dev == sdata->dev &&
++ local->hw_roc_channel) {
++ /* ignore return value since this is racy */
++ drv_cancel_remain_on_channel(local);
++ ieee80211_queue_work(&local->hw, &local->hw_roc_done);
++ }
++ mutex_unlock(&local->mtx);
++
++ flush_work(&local->hw_roc_start);
++ flush_work(&local->hw_roc_done);
++
+ flush_work(&sdata->work);
+ /*
+ * When we get here, the interface is marked down.
+--- a/net/mac80211/offchannel.c
++++ b/net/mac80211/offchannel.c
+@@ -234,6 +234,22 @@ static void ieee80211_hw_roc_done(struct
+ return;
+ }
+
++ /* was never transmitted */
++ if (local->hw_roc_skb) {
++ u64 cookie;
++
++ cookie = local->hw_roc_cookie ^ 2;
++
++ cfg80211_mgmt_tx_status(local->hw_roc_dev, cookie,
++ local->hw_roc_skb->data,
++ local->hw_roc_skb->len, false,
++ GFP_KERNEL);
++
++ kfree_skb(local->hw_roc_skb);
++ local->hw_roc_skb = NULL;
++ local->hw_roc_skb_for_status = NULL;
++ }
++
+ if (!local->hw_roc_for_tx)
+ cfg80211_remain_on_channel_expired(local->hw_roc_dev,
+ local->hw_roc_cookie,
--- /dev/null
+From bd34ab62a3297bd7685da11b0cbe05ae4cd8b02c Mon Sep 17 00:00:00 2001
+From: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
+Date: Wed, 30 May 2012 11:39:33 +0200
+Subject: mac80211: fix error in station state transitions during reconfig
+
+From: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
+
+commit bd34ab62a3297bd7685da11b0cbe05ae4cd8b02c upstream.
+
+As part of hardware reconfig mac80211 tries
+to restore the station state to its values
+before the hardware reconfig, but it only
+goes to the last-state - 1. Fix this
+off-by-one error.
+
+Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
+Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/mac80211/util.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/net/mac80211/util.c
++++ b/net/mac80211/util.c
+@@ -1224,7 +1224,7 @@ int ieee80211_reconfig(struct ieee80211_
+ enum ieee80211_sta_state state;
+
+ for (state = IEEE80211_STA_NOTEXIST;
+- state < sta->sta_state - 1; state++)
++ state < sta->sta_state; state++)
+ WARN_ON(drv_sta_state(local, sta->sdata, sta,
+ state, state + 1));
+ }
--- /dev/null
+From 794454ce72a298de6f4536ade597bdcc7dcde7c7 Mon Sep 17 00:00:00 2001
+From: Arik Nemtsov <arik@wizery.com>
+Date: Sun, 3 Jun 2012 23:32:32 +0300
+Subject: mac80211: fix non RCU-safe sta_list manipulation
+
+From: Arik Nemtsov <arik@wizery.com>
+
+commit 794454ce72a298de6f4536ade597bdcc7dcde7c7 upstream.
+
+sta_info_cleanup locks the sta_list using rcu_read_lock however
+the delete operation isn't rcu safe. A race between sta_info_cleanup
+timer being called and a STA being removed can occur which leads
+to a panic while traversing sta_list. Fix this by switching to the
+RCU-safe versions.
+
+Reported-by: Eyal Shapira <eyal@wizery.com>
+Signed-off-by: Arik Nemtsov <arik@wizery.com>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/mac80211/sta_info.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/net/mac80211/sta_info.c
++++ b/net/mac80211/sta_info.c
+@@ -378,7 +378,7 @@ static int sta_info_insert_finish(struct
+ /* make the station visible */
+ sta_info_hash_add(local, sta);
+
+- list_add(&sta->list, &local->sta_list);
++ list_add_rcu(&sta->list, &local->sta_list);
+
+ set_sta_flag(sta, WLAN_STA_INSERTED);
+
+@@ -688,7 +688,7 @@ int __must_check __sta_info_destroy(stru
+ if (ret)
+ return ret;
+
+- list_del(&sta->list);
++ list_del_rcu(&sta->list);
+
+ mutex_lock(&local->key_mtx);
+ for (i = 0; i < NUM_DEFAULT_KEYS; i++)
crypto-aesni-intel-fix-unaligned-cbc-decrypt-for-x86-32.patch
drm-ttm-fix-buffer-object-metadata-accounting-regression-v2.patch
btrfs-fall-back-to-non-inline-if-we-don-t-have-enough-space.patch
+iwlwifi-disable-wowlan-if-config_pm_sleep.patch
+iwlwifi-unregister-leds-if-mac80211-registration-fails.patch
+iwlwifi-use-correct-supported-firmware-for-6035-and-6000g2.patch
+iwlwifi-don-t-mess-up-the-scd-when-removing-a-key.patch
+iwlwifi-disable-the-buggy-chain-extension-feature-in-hw.patch
+mac80211-fix-error-in-station-state-transitions-during-reconfig.patch
+mac80211-clean-up-remain-on-channel-on-interface-stop.patch
+mac80211-fix-non-rcu-safe-sta_list-manipulation.patch
+asoc-wm8994-ensure-all-aifnclk-events-are-run-from-the-_late-variants.patch
+asoc-wm8994-apply-volume-updates-with-clocks-enabled.patch