--- /dev/null
+From a2d0909a687b4d250cc2b7481072e361678745ba Mon Sep 17 00:00:00 2001
+From: Johannes Berg <johannes.berg@intel.com>
+Date: Thu, 13 Jun 2013 16:06:08 +0200
+Subject: iwlwifi: bump required firmware API version for 3160/7260
+
+From: Johannes Berg <johannes.berg@intel.com>
+
+commit a2d0909a687b4d250cc2b7481072e361678745ba upstream.
+
+As the firmware API has changed significantly and we don't
+have support code for the old APIs, bump the version to be
+able to release the version 7 API firmware. Unfortunately
+this means that the driver in 3.9 and 3.10 can't work, but
+that's still better than crashing the device/driver there.
+
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/iwlwifi/iwl-7000.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+--- a/drivers/net/wireless/iwlwifi/iwl-7000.c
++++ b/drivers/net/wireless/iwlwifi/iwl-7000.c
+@@ -67,16 +67,16 @@
+ #include "iwl-agn-hw.h"
+
+ /* Highest firmware API version supported */
+-#define IWL7260_UCODE_API_MAX 6
+-#define IWL3160_UCODE_API_MAX 6
++#define IWL7260_UCODE_API_MAX 7
++#define IWL3160_UCODE_API_MAX 7
+
+ /* Oldest version we won't warn about */
+-#define IWL7260_UCODE_API_OK 6
+-#define IWL3160_UCODE_API_OK 6
++#define IWL7260_UCODE_API_OK 7
++#define IWL3160_UCODE_API_OK 7
+
+ /* Lowest firmware API version supported */
+-#define IWL7260_UCODE_API_MIN 6
+-#define IWL3160_UCODE_API_MIN 6
++#define IWL7260_UCODE_API_MIN 7
++#define IWL3160_UCODE_API_MIN 7
+
+ /* NVM versions */
+ #define IWL7260_NVM_VERSION 0x0a1d
--- /dev/null
+From dfcb4c3aacedee6838e436fb575b31e138505203 Mon Sep 17 00:00:00 2001
+From: Johannes Berg <johannes.berg@intel.com>
+Date: Wed, 15 May 2013 11:44:49 +0200
+Subject: iwlwifi: mvm: adjust firmware D3 configuration API
+
+From: Johannes Berg <johannes.berg@intel.com>
+
+commit dfcb4c3aacedee6838e436fb575b31e138505203 upstream.
+
+The D3 firmware API changed to include a new field, adjust
+the driver to it to avoid getting an NMI when configuring.
+
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/iwlwifi/mvm/fw-api-d3.h | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/iwlwifi/mvm/fw-api-d3.h
++++ b/drivers/net/wireless/iwlwifi/mvm/fw-api-d3.h
+@@ -75,13 +75,15 @@ enum iwl_d3_wakeup_flags {
+ * struct iwl_d3_manager_config - D3 manager configuration command
+ * @min_sleep_time: minimum sleep time (in usec)
+ * @wakeup_flags: wakeup flags, see &enum iwl_d3_wakeup_flags
++ * @wakeup_host_timer: force wakeup after this many seconds
+ *
+ * The structure is used for the D3_CONFIG_CMD command.
+ */
+ struct iwl_d3_manager_config {
+ __le32 min_sleep_time;
+ __le32 wakeup_flags;
+-} __packed; /* D3_MANAGER_CONFIG_CMD_S_VER_3 */
++ __le32 wakeup_host_timer;
++} __packed; /* D3_MANAGER_CONFIG_CMD_S_VER_4 */
+
+
+ /* TODO: OFFLOADS_QUERY_API_S_VER_1 */
--- /dev/null
+From 837fb69f10588caafc883c4473a864660e1403ce Mon Sep 17 00:00:00 2001
+From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+Date: Sun, 9 Jun 2013 13:00:12 +0300
+Subject: iwlwifi: mvm: don't set the MCAST queue in STA's queue list
+
+From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+
+commit 837fb69f10588caafc883c4473a864660e1403ce upstream.
+
+The MCAST queue should be enabled after DTIM only.
+According to fw API, the MCAST must not be attached to any
+station, but should appear in the mcast_qid of the AP's
+mac context only.
+
+Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c | 5 +----
+ drivers/net/wireless/iwlwifi/mvm/sta.c | 3 ---
+ 2 files changed, 1 insertion(+), 7 deletions(-)
+
+--- a/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c
++++ b/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c
+@@ -193,14 +193,11 @@ static void iwl_mvm_mac_iface_iterator(v
+ u32 iwl_mvm_mac_get_queues_mask(struct iwl_mvm *mvm,
+ struct ieee80211_vif *vif)
+ {
+- u32 qmask, ac;
++ u32 qmask = 0, ac;
+
+ if (vif->type == NL80211_IFTYPE_P2P_DEVICE)
+ return BIT(IWL_MVM_OFFCHANNEL_QUEUE);
+
+- qmask = (vif->cab_queue != IEEE80211_INVAL_HW_QUEUE) ?
+- BIT(vif->cab_queue) : 0;
+-
+ for (ac = 0; ac < IEEE80211_NUM_ACS; ac++)
+ if (vif->hw_queue[ac] != IEEE80211_INVAL_HW_QUEUE)
+ qmask |= BIT(vif->hw_queue[ac]);
+--- a/drivers/net/wireless/iwlwifi/mvm/sta.c
++++ b/drivers/net/wireless/iwlwifi/mvm/sta.c
+@@ -226,9 +226,6 @@ int iwl_mvm_add_sta(struct iwl_mvm *mvm,
+ if (vif->hw_queue[i] != IEEE80211_INVAL_HW_QUEUE)
+ mvm_sta->tfd_queue_msk |= BIT(vif->hw_queue[i]);
+
+- if (vif->cab_queue != IEEE80211_INVAL_HW_QUEUE)
+- mvm_sta->tfd_queue_msk |= BIT(vif->cab_queue);
+-
+ /* for HW restart - need to reset the seq_number etc... */
+ memset(mvm_sta->tid_data, 0, sizeof(mvm_sta->tid_data));
+
--- /dev/null
+From 9116a3683902583a302ac5dcb283416d504d9bb4 Mon Sep 17 00:00:00 2001
+From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+Date: Sun, 2 Jun 2013 19:54:01 +0300
+Subject: iwlwifi: mvm: fix MCAST in AP mode
+
+From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+
+commit 9116a3683902583a302ac5dcb283416d504d9bb4 upstream.
+
+In multicast, there is no retries nor RTS since there is no
+specific recipient that can ACK or send CTS. This means
+that we must not use the rate scale table for multicast
+frames.
+This true for any frame that doesn't have a valid
+ieee80211_sta pointer.
+
+Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/iwlwifi/mvm/tx.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/iwlwifi/mvm/tx.c
++++ b/drivers/net/wireless/iwlwifi/mvm/tx.c
+@@ -175,7 +175,7 @@ static void iwl_mvm_set_tx_cmd_rate(stru
+ * table is controlled by LINK_QUALITY commands
+ */
+
+- if (ieee80211_is_data(fc)) {
++ if (ieee80211_is_data(fc) && sta) {
+ tx_cmd->initial_rate_index = 0;
+ tx_cmd->tx_flags |= cpu_to_le32(TX_CMD_FLG_STA_RATE);
+ return;
--- /dev/null
+From 5af01772ee1d6e96849adf728ff837bd71b119c0 Mon Sep 17 00:00:00 2001
+From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+Date: Sun, 9 Jun 2013 12:59:24 +0300
+Subject: iwlwifi: mvm: properly tell the fw that a STA is awake
+
+From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+
+commit 5af01772ee1d6e96849adf728ff837bd71b119c0 upstream.
+
+The firmware API wasn't being used correctly, fix that.
+
+Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/iwlwifi/mvm/sta.c | 8 +-------
+ 1 file changed, 1 insertion(+), 7 deletions(-)
+
+--- a/drivers/net/wireless/iwlwifi/mvm/sta.c
++++ b/drivers/net/wireless/iwlwifi/mvm/sta.c
+@@ -1296,17 +1296,11 @@ void iwl_mvm_sta_modify_ps_wake(struct i
+ struct iwl_mvm_add_sta_cmd cmd = {
+ .add_modify = STA_MODE_MODIFY,
+ .sta_id = mvmsta->sta_id,
+- .modify_mask = STA_MODIFY_SLEEPING_STA_TX_COUNT,
+- .sleep_state_flags = cpu_to_le16(STA_SLEEP_STATE_AWAKE),
++ .station_flags_msk = cpu_to_le32(STA_FLG_PS),
+ .mac_id_n_color = cpu_to_le32(mvmsta->mac_id_n_color),
+ };
+ int ret;
+
+- /*
+- * Same modify mask for sleep_tx_count and sleep_state_flags but this
+- * should be fine since if we set the STA as "awake", then
+- * sleep_tx_count is not relevant.
+- */
+ ret = iwl_mvm_send_cmd_pdu(mvm, ADD_STA, CMD_ASYNC, sizeof(cmd), &cmd);
+ if (ret)
+ IWL_ERR(mvm, "Failed to send ADD_STA command (%d)\n", ret);
--- /dev/null
+From ebea2f32e814445f94f9e087b646f1cf4d55fa5a Mon Sep 17 00:00:00 2001
+From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+Date: Thu, 13 Jun 2013 10:07:47 +0300
+Subject: iwlwifi: mvm: take the seqno from packet if transmit failed
+
+From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+
+commit ebea2f32e814445f94f9e087b646f1cf4d55fa5a upstream.
+
+The fw is unreliable in all the cases in which the packet
+wasn't sent.
+
+Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/iwlwifi/mvm/tx.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/iwlwifi/mvm/tx.c
++++ b/drivers/net/wireless/iwlwifi/mvm/tx.c
+@@ -610,8 +610,8 @@ static void iwl_mvm_rx_tx_cmd_single(str
+ !(info->flags & IEEE80211_TX_STAT_ACK))
+ info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK;
+
+- /* W/A FW bug: seq_ctl is wrong when the queue is flushed */
+- if (status == TX_STATUS_FAIL_FIFO_FLUSHED) {
++ /* W/A FW bug: seq_ctl is wrong when the status isn't success */
++ if (status != TX_STATUS_SUCCESS) {
+ struct ieee80211_hdr *hdr = (void *)skb->data;
+ seq_ctl = le16_to_cpu(hdr->seq_ctrl);
+ }
--- /dev/null
+From b7327d89ae694a89f9934d428bde520b77b3131c Mon Sep 17 00:00:00 2001
+From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+Date: Mon, 24 Jun 2013 15:44:03 +0300
+Subject: iwlwifi: mvm: unregister leds when registration failed
+
+From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+
+commit b7327d89ae694a89f9934d428bde520b77b3131c upstream.
+
+This was missing and prevented any further attempts
+to load the module.
+
+Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/iwlwifi/mvm/mac80211.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
++++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+@@ -243,7 +243,11 @@ int iwl_mvm_mac_setup_register(struct iw
+ if (ret)
+ return ret;
+
+- return ieee80211_register_hw(mvm->hw);
++ ret = ieee80211_register_hw(mvm->hw);
++ if (ret)
++ iwl_mvm_leds_exit(mvm);
++
++ return ret;
+ }
+
+ static void iwl_mvm_mac_tx(struct ieee80211_hw *hw,
arm-at91-at91sam9x5-rtc-is-not-compatible-with-at91rm9200.patch
nfc-llcp-fix-non-blocking-sockets-connections.patch
iwlwifi-mvm-correctly-configure-mcast-in-ap-mode.patch
+iwlwifi-mvm-fix-mcast-in-ap-mode.patch
+iwlwifi-mvm-properly-tell-the-fw-that-a-sta-is-awake.patch
+iwlwifi-mvm-don-t-set-the-mcast-queue-in-sta-s-queue-list.patch
+iwlwifi-mvm-take-the-seqno-from-packet-if-transmit-failed.patch
+iwlwifi-mvm-unregister-leds-when-registration-failed.patch
+iwlwifi-bump-required-firmware-api-version-for-3160-7260.patch
+iwlwifi-mvm-adjust-firmware-d3-configuration-api.patch