Lines Matching refs:mvm
86 void iwl_mvm_te_clear_data(struct iwl_mvm *mvm, in iwl_mvm_te_clear_data() argument
89 lockdep_assert_held(&mvm->time_event_lock); in iwl_mvm_te_clear_data()
103 struct iwl_mvm *mvm = container_of(wk, struct iwl_mvm, roc_done_wk); in iwl_mvm_roc_done_wk() local
117 iwl_mvm_flush_tx_path(mvm, BIT(IWL_MVM_OFFCHANNEL_QUEUE), false); in iwl_mvm_roc_done_wk()
120 static void iwl_mvm_roc_finished(struct iwl_mvm *mvm) in iwl_mvm_roc_finished() argument
129 clear_bit(IWL_MVM_STATUS_ROC_RUNNING, &mvm->status); in iwl_mvm_roc_finished()
138 schedule_work(&mvm->roc_done_wk); in iwl_mvm_roc_finished()
148 static void iwl_mvm_te_handle_notif(struct iwl_mvm *mvm, in iwl_mvm_te_handle_notif() argument
152 lockdep_assert_held(&mvm->time_event_lock); in iwl_mvm_te_handle_notif()
154 IWL_DEBUG_TE(mvm, "Handle time event notif - UID = 0x%x action %d\n", in iwl_mvm_te_handle_notif()
170 IWL_DEBUG_TE(mvm, in iwl_mvm_te_handle_notif()
175 ieee80211_remain_on_channel_expired(mvm->hw); in iwl_mvm_te_handle_notif()
176 iwl_mvm_roc_finished(mvm); in iwl_mvm_te_handle_notif()
186 IWL_ERR(mvm, in iwl_mvm_te_handle_notif()
191 iwl_mvm_te_clear_data(mvm, te_data); in iwl_mvm_te_handle_notif()
198 set_bit(IWL_MVM_STATUS_ROC_RUNNING, &mvm->status); in iwl_mvm_te_handle_notif()
199 ieee80211_ready_on_channel(mvm->hw); in iwl_mvm_te_handle_notif()
202 IWL_WARN(mvm, "Got TE with unknown action\n"); in iwl_mvm_te_handle_notif()
209 int iwl_mvm_rx_time_event_notif(struct iwl_mvm *mvm, in iwl_mvm_rx_time_event_notif() argument
217 IWL_DEBUG_TE(mvm, "Time event notification - UID = 0x%x action %d\n", in iwl_mvm_rx_time_event_notif()
221 spin_lock_bh(&mvm->time_event_lock); in iwl_mvm_rx_time_event_notif()
222 list_for_each_entry_safe(te_data, tmp, &mvm->time_event_list, list) { in iwl_mvm_rx_time_event_notif()
224 iwl_mvm_te_handle_notif(mvm, te_data, notif); in iwl_mvm_rx_time_event_notif()
226 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_rx_time_event_notif()
234 struct iwl_mvm *mvm = in iwl_mvm_time_event_response() local
244 IWL_ERR(mvm, "Invalid TIME_EVENT_CMD response\n"); in iwl_mvm_time_event_response()
255 IWL_DEBUG_TE(mvm, "TIME_EVENT_CMD response - UID = 0x%x\n", in iwl_mvm_time_event_response()
260 static int iwl_mvm_time_event_send_add(struct iwl_mvm *mvm, in iwl_mvm_time_event_send_add() argument
269 lockdep_assert_held(&mvm->mutex); in iwl_mvm_time_event_send_add()
271 IWL_DEBUG_TE(mvm, "Add new TE, duration %d TU\n", in iwl_mvm_time_event_send_add()
274 spin_lock_bh(&mvm->time_event_lock); in iwl_mvm_time_event_send_add()
276 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_time_event_send_add()
282 list_add_tail(&te_data->list, &mvm->time_event_list); in iwl_mvm_time_event_send_add()
283 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_time_event_send_add()
294 iwl_init_notification_wait(&mvm->notif_wait, &wait_time_event, in iwl_mvm_time_event_send_add()
299 ret = iwl_mvm_send_cmd_pdu(mvm, TIME_EVENT_CMD, CMD_SYNC, in iwl_mvm_time_event_send_add()
302 IWL_ERR(mvm, "Couldn't send TIME_EVENT_CMD: %d\n", ret); in iwl_mvm_time_event_send_add()
303 iwl_remove_notification(&mvm->notif_wait, &wait_time_event); in iwl_mvm_time_event_send_add()
308 ret = iwl_wait_notification(&mvm->notif_wait, &wait_time_event, 1); in iwl_mvm_time_event_send_add()
314 spin_lock_bh(&mvm->time_event_lock); in iwl_mvm_time_event_send_add()
315 iwl_mvm_te_clear_data(mvm, te_data); in iwl_mvm_time_event_send_add()
316 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_time_event_send_add()
321 void iwl_mvm_protect_session(struct iwl_mvm *mvm, in iwl_mvm_protect_session() argument
329 lockdep_assert_held(&mvm->mutex); in iwl_mvm_protect_session()
334 IWL_DEBUG_TE(mvm, "We have enough time in the current TE: %u\n", in iwl_mvm_protect_session()
340 IWL_DEBUG_TE(mvm, "extend 0x%x: only %u ms left\n", in iwl_mvm_protect_session()
351 iwl_mvm_stop_session_protection(mvm, vif); in iwl_mvm_protect_session()
360 cpu_to_le32(iwl_read_prph(mvm->trans, DEVICE_SYSTEM_TIME_REG)); in iwl_mvm_protect_session()
374 iwl_mvm_time_event_send_add(mvm, vif, te_data, &time_cmd); in iwl_mvm_protect_session()
382 void iwl_mvm_remove_time_event(struct iwl_mvm *mvm, in iwl_mvm_remove_time_event() argument
394 spin_lock_bh(&mvm->time_event_lock); in iwl_mvm_remove_time_event()
403 iwl_mvm_te_clear_data(mvm, te_data); in iwl_mvm_remove_time_event()
404 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_remove_time_event()
412 IWL_DEBUG_TE(mvm, "TE 0x%x has already ended\n", uid); in iwl_mvm_remove_time_event()
422 IWL_DEBUG_TE(mvm, "Removing TE 0x%x\n", le32_to_cpu(time_cmd.id)); in iwl_mvm_remove_time_event()
423 ret = iwl_mvm_send_cmd_pdu(mvm, TIME_EVENT_CMD, CMD_SYNC, in iwl_mvm_remove_time_event()
429 void iwl_mvm_stop_session_protection(struct iwl_mvm *mvm, in iwl_mvm_stop_session_protection() argument
435 lockdep_assert_held(&mvm->mutex); in iwl_mvm_stop_session_protection()
436 iwl_mvm_remove_time_event(mvm, mvmvif, te_data); in iwl_mvm_stop_session_protection()
439 int iwl_mvm_start_p2p_roc(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_start_p2p_roc() argument
446 lockdep_assert_held(&mvm->mutex); in iwl_mvm_start_p2p_roc()
448 IWL_WARN(mvm, "P2P_DEVICE remain on channel already running\n"); in iwl_mvm_start_p2p_roc()
456 flush_work(&mvm->roc_done_wk); in iwl_mvm_start_p2p_roc()
492 return iwl_mvm_time_event_send_add(mvm, vif, te_data, &time_cmd); in iwl_mvm_start_p2p_roc()
495 void iwl_mvm_stop_p2p_roc(struct iwl_mvm *mvm) in iwl_mvm_stop_p2p_roc() argument
500 lockdep_assert_held(&mvm->mutex); in iwl_mvm_stop_p2p_roc()
510 spin_lock_bh(&mvm->time_event_lock); in iwl_mvm_stop_p2p_roc()
511 list_for_each_entry(te_data, &mvm->time_event_list, list) { in iwl_mvm_stop_p2p_roc()
517 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_stop_p2p_roc()
520 IWL_WARN(mvm, "P2P_DEVICE no remain on channel event\n"); in iwl_mvm_stop_p2p_roc()
524 iwl_mvm_remove_time_event(mvm, mvmvif, te_data); in iwl_mvm_stop_p2p_roc()
526 iwl_mvm_roc_finished(mvm); in iwl_mvm_stop_p2p_roc()