diff options
author | Johannes Berg <johannes.berg@intel.com> | 2017-11-13 11:26:09 -0500 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2017-12-05 09:23:29 -0500 |
commit | 6c2d49fdc5d947c5fe89935bd52e69f10000f4cb (patch) | |
tree | 2f2be004d8ff37ea752a922a938bd15f4567ac99 | |
parent | 567deca8e72df3ceb6c07c63f8541a4928f64d3b (diff) |
iwlwifi: mvm: flush queue before deleting ROC
Before deleting a time event (remain-on-channel instance), flush
the queue so that frames cannot get stuck on it. We already flush
the AUX STA queues, but a separate station is used for the P2P
Device queue.
Cc: stable@vger.kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/time-event.c | 24 |
2 files changed, 24 insertions, 2 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h index 6a9a25beab3f..55ab5349dd40 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | |||
@@ -1061,6 +1061,7 @@ struct iwl_mvm { | |||
1061 | * @IWL_MVM_STATUS_ROC_AUX_RUNNING: AUX remain-on-channel is running | 1061 | * @IWL_MVM_STATUS_ROC_AUX_RUNNING: AUX remain-on-channel is running |
1062 | * @IWL_MVM_STATUS_D3_RECONFIG: D3 reconfiguration is being done | 1062 | * @IWL_MVM_STATUS_D3_RECONFIG: D3 reconfiguration is being done |
1063 | * @IWL_MVM_STATUS_FIRMWARE_RUNNING: firmware is running | 1063 | * @IWL_MVM_STATUS_FIRMWARE_RUNNING: firmware is running |
1064 | * @IWL_MVM_STATUS_NEED_FLUSH_P2P: need to flush P2P bcast STA | ||
1064 | */ | 1065 | */ |
1065 | enum iwl_mvm_status { | 1066 | enum iwl_mvm_status { |
1066 | IWL_MVM_STATUS_HW_RFKILL, | 1067 | IWL_MVM_STATUS_HW_RFKILL, |
@@ -1072,6 +1073,7 @@ enum iwl_mvm_status { | |||
1072 | IWL_MVM_STATUS_ROC_AUX_RUNNING, | 1073 | IWL_MVM_STATUS_ROC_AUX_RUNNING, |
1073 | IWL_MVM_STATUS_D3_RECONFIG, | 1074 | IWL_MVM_STATUS_D3_RECONFIG, |
1074 | IWL_MVM_STATUS_FIRMWARE_RUNNING, | 1075 | IWL_MVM_STATUS_FIRMWARE_RUNNING, |
1076 | IWL_MVM_STATUS_NEED_FLUSH_P2P, | ||
1075 | }; | 1077 | }; |
1076 | 1078 | ||
1077 | /* Keep track of completed init configuration */ | 1079 | /* Keep track of completed init configuration */ |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c b/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c index 4d0314912e94..e25cda9fbf6c 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c | |||
@@ -132,6 +132,24 @@ void iwl_mvm_roc_done_wk(struct work_struct *wk) | |||
132 | * executed, and a new time event means a new command. | 132 | * executed, and a new time event means a new command. |
133 | */ | 133 | */ |
134 | iwl_mvm_flush_sta(mvm, &mvm->aux_sta, true, CMD_ASYNC); | 134 | iwl_mvm_flush_sta(mvm, &mvm->aux_sta, true, CMD_ASYNC); |
135 | |||
136 | /* Do the same for the P2P device queue (STA) */ | ||
137 | if (test_and_clear_bit(IWL_MVM_STATUS_NEED_FLUSH_P2P, &mvm->status)) { | ||
138 | struct iwl_mvm_vif *mvmvif; | ||
139 | |||
140 | /* | ||
141 | * NB: access to this pointer would be racy, but the flush bit | ||
142 | * can only be set when we had a P2P-Device VIF, and we have a | ||
143 | * flush of this work in iwl_mvm_prepare_mac_removal() so it's | ||
144 | * not really racy. | ||
145 | */ | ||
146 | |||
147 | if (!WARN_ON(!mvm->p2p_device_vif)) { | ||
148 | mvmvif = iwl_mvm_vif_from_mac80211(mvm->p2p_device_vif); | ||
149 | iwl_mvm_flush_sta(mvm, &mvmvif->bcast_sta, true, | ||
150 | CMD_ASYNC); | ||
151 | } | ||
152 | } | ||
135 | } | 153 | } |
136 | 154 | ||
137 | static void iwl_mvm_roc_finished(struct iwl_mvm *mvm) | 155 | static void iwl_mvm_roc_finished(struct iwl_mvm *mvm) |
@@ -855,10 +873,12 @@ void iwl_mvm_stop_roc(struct iwl_mvm *mvm) | |||
855 | 873 | ||
856 | mvmvif = iwl_mvm_vif_from_mac80211(te_data->vif); | 874 | mvmvif = iwl_mvm_vif_from_mac80211(te_data->vif); |
857 | 875 | ||
858 | if (te_data->vif->type == NL80211_IFTYPE_P2P_DEVICE) | 876 | if (te_data->vif->type == NL80211_IFTYPE_P2P_DEVICE) { |
859 | iwl_mvm_remove_time_event(mvm, mvmvif, te_data); | 877 | iwl_mvm_remove_time_event(mvm, mvmvif, te_data); |
860 | else | 878 | set_bit(IWL_MVM_STATUS_NEED_FLUSH_P2P, &mvm->status); |
879 | } else { | ||
861 | iwl_mvm_remove_aux_roc_te(mvm, mvmvif, te_data); | 880 | iwl_mvm_remove_aux_roc_te(mvm, mvmvif, te_data); |
881 | } | ||
862 | 882 | ||
863 | iwl_mvm_roc_finished(mvm); | 883 | iwl_mvm_roc_finished(mvm); |
864 | } | 884 | } |