aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-07-25 12:39:30 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-08-06 04:35:19 -0400
commit057397943eee0bf3bc01a58ee52a9a6f1810258e (patch)
tree557681819fd5f33b5f6b57d4838bb05ea7484885
parent4f0c848a334ff1840a105c506883edbfaf0e57cc (diff)
iwlwifi: mvm: disconnect if time event scheduling fails
If scheduling an important time event fails, or if we get an unexpected notification from the firmware, there isn't much we can do to recover, so just drop the connection and let higher layers retry it. Reviewed-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/time-event.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/time-event.c b/drivers/net/wireless/iwlwifi/mvm/time-event.c
index ad9bbca99213..7fd6fbfbc1b3 100644
--- a/drivers/net/wireless/iwlwifi/mvm/time-event.c
+++ b/drivers/net/wireless/iwlwifi/mvm/time-event.c
@@ -138,6 +138,20 @@ static void iwl_mvm_roc_finished(struct iwl_mvm *mvm)
138 schedule_work(&mvm->roc_done_wk); 138 schedule_work(&mvm->roc_done_wk);
139} 139}
140 140
141static bool iwl_mvm_te_check_disconnect(struct iwl_mvm *mvm,
142 struct ieee80211_vif *vif,
143 const char *errmsg)
144{
145 if (vif->type != NL80211_IFTYPE_STATION)
146 return false;
147 if (vif->bss_conf.assoc && vif->bss_conf.dtim_period)
148 return false;
149 if (errmsg)
150 IWL_ERR(mvm, "%s\n", errmsg);
151 ieee80211_connection_loss(vif);
152 return true;
153}
154
141/* 155/*
142 * Handles a FW notification for an event that is known to the driver. 156 * Handles a FW notification for an event that is known to the driver.
143 * 157 *
@@ -163,8 +177,13 @@ static void iwl_mvm_te_handle_notif(struct iwl_mvm *mvm,
163 * P2P Device discoveribility, while there are other higher priority 177 * P2P Device discoveribility, while there are other higher priority
164 * events in the system). 178 * events in the system).
165 */ 179 */
166 WARN_ONCE(!le32_to_cpu(notif->status), 180 if (WARN_ONCE(!le32_to_cpu(notif->status),
167 "Failed to schedule time event\n"); 181 "Failed to schedule time event\n")) {
182 if (iwl_mvm_te_check_disconnect(mvm, te_data->vif, NULL)) {
183 iwl_mvm_te_clear_data(mvm, te_data);
184 return;
185 }
186 }
168 187
169 if (le32_to_cpu(notif->action) & TE_NOTIF_HOST_EVENT_END) { 188 if (le32_to_cpu(notif->action) & TE_NOTIF_HOST_EVENT_END) {
170 IWL_DEBUG_TE(mvm, 189 IWL_DEBUG_TE(mvm,
@@ -180,14 +199,8 @@ static void iwl_mvm_te_handle_notif(struct iwl_mvm *mvm,
180 * By now, we should have finished association 199 * By now, we should have finished association
181 * and know the dtim period. 200 * and know the dtim period.
182 */ 201 */
183 if (te_data->vif->type == NL80211_IFTYPE_STATION && 202 iwl_mvm_te_check_disconnect(mvm, te_data->vif,
184 (!te_data->vif->bss_conf.assoc || 203 "No assocation and the time event is over already...");
185 !te_data->vif->bss_conf.dtim_period)) {
186 IWL_ERR(mvm,
187 "No assocation and the time event is over already...\n");
188 ieee80211_connection_loss(te_data->vif);
189 }
190
191 iwl_mvm_te_clear_data(mvm, te_data); 204 iwl_mvm_te_clear_data(mvm, te_data);
192 } else if (le32_to_cpu(notif->action) & TE_NOTIF_HOST_EVENT_START) { 205 } else if (le32_to_cpu(notif->action) & TE_NOTIF_HOST_EVENT_START) {
193 te_data->running = true; 206 te_data->running = true;