diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/time-event.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/time-event.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/time-event.c b/drivers/net/wireless/iwlwifi/mvm/time-event.c index c09b71f23759..e437e02c7149 100644 --- a/drivers/net/wireless/iwlwifi/mvm/time-event.c +++ b/drivers/net/wireless/iwlwifi/mvm/time-event.c | |||
@@ -248,6 +248,11 @@ static bool iwl_mvm_time_event_response(struct iwl_notif_wait_data *notif_wait, | |||
248 | } | 248 | } |
249 | 249 | ||
250 | resp = (void *)pkt->data; | 250 | resp = (void *)pkt->data; |
251 | |||
252 | /* we should never get a response to another TIME_EVENT_CMD here */ | ||
253 | if (WARN_ON_ONCE(le32_to_cpu(resp->id) != te_data->id)) | ||
254 | return false; | ||
255 | |||
251 | te_data->uid = le32_to_cpu(resp->unique_id); | 256 | te_data->uid = le32_to_cpu(resp->unique_id); |
252 | IWL_DEBUG_TE(mvm, "TIME_EVENT_CMD response - UID = 0x%x\n", | 257 | IWL_DEBUG_TE(mvm, "TIME_EVENT_CMD response - UID = 0x%x\n", |
253 | te_data->uid); | 258 | te_data->uid); |
@@ -265,6 +270,9 @@ static int iwl_mvm_time_event_send_add(struct iwl_mvm *mvm, | |||
265 | 270 | ||
266 | lockdep_assert_held(&mvm->mutex); | 271 | lockdep_assert_held(&mvm->mutex); |
267 | 272 | ||
273 | IWL_DEBUG_TE(mvm, "Add new TE, duration %d TU\n", | ||
274 | le32_to_cpu(te_cmd->duration)); | ||
275 | |||
268 | spin_lock_bh(&mvm->time_event_lock); | 276 | spin_lock_bh(&mvm->time_event_lock); |
269 | if (WARN_ON(te_data->id != TE_MAX)) { | 277 | if (WARN_ON(te_data->id != TE_MAX)) { |
270 | spin_unlock_bh(&mvm->time_event_lock); | 278 | spin_unlock_bh(&mvm->time_event_lock); |
@@ -413,7 +421,7 @@ void iwl_mvm_remove_time_event(struct iwl_mvm *mvm, | |||
413 | cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id, mvmvif->color)); | 421 | cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id, mvmvif->color)); |
414 | 422 | ||
415 | IWL_DEBUG_TE(mvm, "Removing TE 0x%x\n", le32_to_cpu(time_cmd.id)); | 423 | IWL_DEBUG_TE(mvm, "Removing TE 0x%x\n", le32_to_cpu(time_cmd.id)); |
416 | ret = iwl_mvm_send_cmd_pdu(mvm, TIME_EVENT_CMD, CMD_ASYNC, | 424 | ret = iwl_mvm_send_cmd_pdu(mvm, TIME_EVENT_CMD, CMD_SYNC, |
417 | sizeof(time_cmd), &time_cmd); | 425 | sizeof(time_cmd), &time_cmd); |
418 | if (WARN_ON(ret)) | 426 | if (WARN_ON(ret)) |
419 | return; | 427 | return; |