aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/d3.c59
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/fw-api.h1
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/ops.c1
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/sta.h4
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/tx.c4
5 files changed, 43 insertions, 26 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/d3.c b/drivers/net/wireless/iwlwifi/mvm/d3.c
index 417639f77b01..123a44f031a7 100644
--- a/drivers/net/wireless/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/iwlwifi/mvm/d3.c
@@ -793,6 +793,31 @@ static int iwl_mvm_d3_reprogram(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
793 return 0; 793 return 0;
794} 794}
795 795
796static int iwl_mvm_get_last_nonqos_seq(struct iwl_mvm *mvm,
797 struct ieee80211_vif *vif)
798{
799 struct iwl_host_cmd cmd = {
800 .id = NON_QOS_TX_COUNTER_CMD,
801 .flags = CMD_SYNC | CMD_WANT_SKB,
802 };
803 int err;
804 u32 size;
805
806 err = iwl_mvm_send_cmd(mvm, &cmd);
807 if (err)
808 return err;
809
810 size = le32_to_cpu(cmd.resp_pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK;
811 size -= sizeof(cmd.resp_pkt->hdr);
812 if (size != sizeof(__le32))
813 err = -EINVAL;
814 else
815 err = le32_to_cpup((__le32 *)cmd.resp_pkt->data);
816
817 iwl_free_resp(&cmd);
818 return err;
819}
820
796static int __iwl_mvm_suspend(struct ieee80211_hw *hw, 821static int __iwl_mvm_suspend(struct ieee80211_hw *hw,
797 struct cfg80211_wowlan *wowlan, 822 struct cfg80211_wowlan *wowlan,
798 bool test) 823 bool test)
@@ -829,7 +854,6 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw,
829 }; 854 };
830 int ret, i; 855 int ret, i;
831 int len __maybe_unused; 856 int len __maybe_unused;
832 u16 seq;
833 u8 old_aux_sta_id, old_ap_sta_id = IWL_MVM_STATION_COUNT; 857 u8 old_aux_sta_id, old_ap_sta_id = IWL_MVM_STATION_COUNT;
834 858
835 if (!wowlan) { 859 if (!wowlan) {
@@ -872,26 +896,15 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw,
872 896
873 mvm_ap_sta = (struct iwl_mvm_sta *)ap_sta->drv_priv; 897 mvm_ap_sta = (struct iwl_mvm_sta *)ap_sta->drv_priv;
874 898
875 /*
876 * The D3 firmware still hardcodes the AP station ID for the
877 * BSS we're associated with as 0. Store the real STA ID here
878 * and assign 0. When we leave this function, we'll restore
879 * the original value for the resume code.
880 */
881 old_ap_sta_id = mvm_ap_sta->sta_id;
882 mvm_ap_sta->sta_id = 0;
883 mvmvif->ap_sta_id = 0;
884
885 /* TODO: wowlan_config_cmd.wowlan_ba_teardown_tids */ 899 /* TODO: wowlan_config_cmd.wowlan_ba_teardown_tids */
886 900
887 wowlan_config_cmd.is_11n_connection = ap_sta->ht_cap.ht_supported; 901 wowlan_config_cmd.is_11n_connection = ap_sta->ht_cap.ht_supported;
888 902
889 /* 903 /* Query the last used seqno and set it */
890 * We know the last used seqno, and the uCode expects to know that 904 ret = iwl_mvm_get_last_nonqos_seq(mvm, vif);
891 * one, it will increment before TX. 905 if (ret < 0)
892 */ 906 goto out_noreset;
893 seq = mvm_ap_sta->last_seq_ctl & IEEE80211_SCTL_SEQ; 907 wowlan_config_cmd.non_qos_seq = cpu_to_le16(ret);
894 wowlan_config_cmd.non_qos_seq = cpu_to_le16(seq);
895 908
896 /* 909 /*
897 * For QoS counters, we store the one to use next, so subtract 0x10 910 * For QoS counters, we store the one to use next, so subtract 0x10
@@ -899,7 +912,7 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw,
899 * increment after using the value (i.e. store the next value to use). 912 * increment after using the value (i.e. store the next value to use).
900 */ 913 */
901 for (i = 0; i < IWL_MAX_TID_COUNT; i++) { 914 for (i = 0; i < IWL_MAX_TID_COUNT; i++) {
902 seq = mvm_ap_sta->tid_data[i].seq_number; 915 u16 seq = mvm_ap_sta->tid_data[i].seq_number;
903 seq -= 0x10; 916 seq -= 0x10;
904 wowlan_config_cmd.qos_seq[i] = cpu_to_le16(seq); 917 wowlan_config_cmd.qos_seq[i] = cpu_to_le16(seq);
905 } 918 }
@@ -945,6 +958,16 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw,
945 iwl_trans_stop_device(mvm->trans); 958 iwl_trans_stop_device(mvm->trans);
946 959
947 /* 960 /*
961 * The D3 firmware still hardcodes the AP station ID for the
962 * BSS we're associated with as 0. Store the real STA ID here
963 * and assign 0. When we leave this function, we'll restore
964 * the original value for the resume code.
965 */
966 old_ap_sta_id = mvm_ap_sta->sta_id;
967 mvm_ap_sta->sta_id = 0;
968 mvmvif->ap_sta_id = 0;
969
970 /*
948 * Set the HW restart bit -- this is mostly true as we're 971 * Set the HW restart bit -- this is mostly true as we're
949 * going to load new firmware and reprogram that, though 972 * going to load new firmware and reprogram that, though
950 * the reprogramming is going to be manual to avoid adding 973 * the reprogramming is going to be manual to avoid adding
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api.h b/drivers/net/wireless/iwlwifi/mvm/fw-api.h
index 66264cc5a016..7dfa31affaee 100644
--- a/drivers/net/wireless/iwlwifi/mvm/fw-api.h
+++ b/drivers/net/wireless/iwlwifi/mvm/fw-api.h
@@ -114,6 +114,7 @@ enum {
114 TIME_EVENT_NOTIFICATION = 0x2a, 114 TIME_EVENT_NOTIFICATION = 0x2a,
115 BINDING_CONTEXT_CMD = 0x2b, 115 BINDING_CONTEXT_CMD = 0x2b,
116 TIME_QUOTA_CMD = 0x2c, 116 TIME_QUOTA_CMD = 0x2c,
117 NON_QOS_TX_COUNTER_CMD = 0x2d,
117 118
118 LQ_CMD = 0x4e, 119 LQ_CMD = 0x4e,
119 120
diff --git a/drivers/net/wireless/iwlwifi/mvm/ops.c b/drivers/net/wireless/iwlwifi/mvm/ops.c
index 2fcc8ef88a68..950e809621e7 100644
--- a/drivers/net/wireless/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/iwlwifi/mvm/ops.c
@@ -249,6 +249,7 @@ static const char *iwl_mvm_cmd_strings[REPLY_MAX] = {
249 CMD(TIME_EVENT_NOTIFICATION), 249 CMD(TIME_EVENT_NOTIFICATION),
250 CMD(BINDING_CONTEXT_CMD), 250 CMD(BINDING_CONTEXT_CMD),
251 CMD(TIME_QUOTA_CMD), 251 CMD(TIME_QUOTA_CMD),
252 CMD(NON_QOS_TX_COUNTER_CMD),
252 CMD(RADIO_VERSION_NOTIFICATION), 253 CMD(RADIO_VERSION_NOTIFICATION),
253 CMD(SCAN_REQUEST_CMD), 254 CMD(SCAN_REQUEST_CMD),
254 CMD(SCAN_ABORT_CMD), 255 CMD(SCAN_ABORT_CMD),
diff --git a/drivers/net/wireless/iwlwifi/mvm/sta.h b/drivers/net/wireless/iwlwifi/mvm/sta.h
index 94b265eb32b8..4dfc359a4bdd 100644
--- a/drivers/net/wireless/iwlwifi/mvm/sta.h
+++ b/drivers/net/wireless/iwlwifi/mvm/sta.h
@@ -293,10 +293,6 @@ struct iwl_mvm_sta {
293 struct iwl_lq_sta lq_sta; 293 struct iwl_lq_sta lq_sta;
294 struct ieee80211_vif *vif; 294 struct ieee80211_vif *vif;
295 295
296#ifdef CONFIG_PM_SLEEP
297 u16 last_seq_ctl;
298#endif
299
300 /* Temporary, until the new TLC will control the Tx protection */ 296 /* Temporary, until the new TLC will control the Tx protection */
301 s8 tx_protection; 297 s8 tx_protection;
302 bool tt_tx_protection; 298 bool tt_tx_protection;
diff --git a/drivers/net/wireless/iwlwifi/mvm/tx.c b/drivers/net/wireless/iwlwifi/mvm/tx.c
index e05440d90319..1ef70d0bd9e2 100644
--- a/drivers/net/wireless/iwlwifi/mvm/tx.c
+++ b/drivers/net/wireless/iwlwifi/mvm/tx.c
@@ -668,10 +668,6 @@ static void iwl_mvm_rx_tx_cmd_single(struct iwl_mvm *mvm,
668 iwl_mvm_check_ratid_empty(mvm, sta, tid); 668 iwl_mvm_check_ratid_empty(mvm, sta, tid);
669 spin_unlock_bh(&mvmsta->lock); 669 spin_unlock_bh(&mvmsta->lock);
670 } 670 }
671
672#ifdef CONFIG_PM_SLEEP
673 mvmsta->last_seq_ctl = seq_ctl;
674#endif
675 } else { 671 } else {
676 sta = NULL; 672 sta = NULL;
677 mvmsta = NULL; 673 mvmsta = NULL;