diff options
author | Johannes Berg <johannes.berg@intel.com> | 2015-03-11 15:27:06 -0400 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2015-03-12 03:57:47 -0400 |
commit | bca13904d0558ad4160441ebb00b37e44a19483f (patch) | |
tree | a55648bbb827b1896551aadbdef9d18c562b7913 | |
parent | f4a3ee493e69239ad9e76e42524d08c58ac31f11 (diff) |
iwlwifi: mvm: clarify time event end handling
The code here is a little confusing, the iwl_mvm_te_check_disconnect()
will check that the interface is a station, but going into it after
already having processed the time even end for P2P seems strange at
first look.
Put a switch statement there to distinguish the interface types and
make this more readable.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/time-event.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/time-event.c b/drivers/net/wireless/iwlwifi/mvm/time-event.c index 54fafbf9a711..1dbfcc43d82c 100644 --- a/drivers/net/wireless/iwlwifi/mvm/time-event.c +++ b/drivers/net/wireless/iwlwifi/mvm/time-event.c | |||
@@ -261,17 +261,23 @@ static void iwl_mvm_te_handle_notif(struct iwl_mvm *mvm, | |||
261 | "TE ended - current time %lu, estimated end %lu\n", | 261 | "TE ended - current time %lu, estimated end %lu\n", |
262 | jiffies, te_data->end_jiffies); | 262 | jiffies, te_data->end_jiffies); |
263 | 263 | ||
264 | if (te_data->vif->type == NL80211_IFTYPE_P2P_DEVICE) { | 264 | switch (te_data->vif->type) { |
265 | case NL80211_IFTYPE_P2P_DEVICE: | ||
265 | ieee80211_remain_on_channel_expired(mvm->hw); | 266 | ieee80211_remain_on_channel_expired(mvm->hw); |
266 | iwl_mvm_roc_finished(mvm); | 267 | iwl_mvm_roc_finished(mvm); |
268 | break; | ||
269 | case NL80211_IFTYPE_STATION: | ||
270 | /* | ||
271 | * By now, we should have finished association | ||
272 | * and know the dtim period. | ||
273 | */ | ||
274 | iwl_mvm_te_check_disconnect(mvm, te_data->vif, | ||
275 | "No association and the time event is over already..."); | ||
276 | break; | ||
277 | default: | ||
278 | break; | ||
267 | } | 279 | } |
268 | 280 | ||
269 | /* | ||
270 | * By now, we should have finished association | ||
271 | * and know the dtim period. | ||
272 | */ | ||
273 | iwl_mvm_te_check_disconnect(mvm, te_data->vif, | ||
274 | "No association and the time event is over already..."); | ||
275 | iwl_mvm_te_clear_data(mvm, te_data); | 281 | iwl_mvm_te_clear_data(mvm, te_data); |
276 | } else if (le32_to_cpu(notif->action) & TE_V2_NOTIF_HOST_EVENT_START) { | 282 | } else if (le32_to_cpu(notif->action) & TE_V2_NOTIF_HOST_EVENT_START) { |
277 | te_data->running = true; | 283 | te_data->running = true; |