Lines Matching refs:mvm

75 static inline int iwl_mvm_add_sta_cmd_size(struct iwl_mvm *mvm)  in iwl_mvm_add_sta_cmd_size()  argument
77 if (iwl_mvm_has_new_rx_api(mvm) || in iwl_mvm_add_sta_cmd_size()
78 fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_STA_TYPE)) in iwl_mvm_add_sta_cmd_size()
84 static int iwl_mvm_find_free_sta_id(struct iwl_mvm *mvm, in iwl_mvm_find_free_sta_id() argument
91 WARN_ON_ONCE(test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)); in iwl_mvm_find_free_sta_id()
93 lockdep_assert_held(&mvm->mutex); in iwl_mvm_find_free_sta_id()
100 for (sta_id = 0; sta_id < ARRAY_SIZE(mvm->fw_id_to_mac_id); sta_id++) { in iwl_mvm_find_free_sta_id()
104 if (!rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id], in iwl_mvm_find_free_sta_id()
105 lockdep_is_held(&mvm->mutex))) in iwl_mvm_find_free_sta_id()
112 int iwl_mvm_sta_send_to_fw(struct iwl_mvm *mvm, struct ieee80211_sta *sta, in iwl_mvm_sta_send_to_fw() argument
129 if (fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_STA_TYPE)) in iwl_mvm_sta_send_to_fw()
135 if (!iwl_mvm_has_new_tx_api(mvm)) { in iwl_mvm_sta_send_to_fw()
233 ret = iwl_mvm_send_cmd_pdu_status(mvm, ADD_STA, in iwl_mvm_sta_send_to_fw()
234 iwl_mvm_add_sta_cmd_size(mvm), in iwl_mvm_sta_send_to_fw()
241 IWL_DEBUG_ASSOC(mvm, "ADD_STA PASSED\n"); in iwl_mvm_sta_send_to_fw()
245 IWL_ERR(mvm, "ADD_STA failed\n"); in iwl_mvm_sta_send_to_fw()
279 sta = rcu_dereference(ba_data->mvm->fw_id_to_mac_id[ba_data->sta_id]); in iwl_mvm_rx_agg_session_expired()
300 static int iwl_mvm_invalidate_sta_queue(struct iwl_mvm *mvm, int queue, in iwl_mvm_invalidate_sta_queue() argument
310 if (WARN_ON(iwl_mvm_has_new_tx_api(mvm))) in iwl_mvm_invalidate_sta_queue()
313 sta_id = mvm->queue_info[queue].ra_sta_id; in iwl_mvm_invalidate_sta_queue()
317 sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); in iwl_mvm_invalidate_sta_queue()
343 return iwl_mvm_send_cmd_pdu_status(mvm, ADD_STA, in iwl_mvm_invalidate_sta_queue()
344 iwl_mvm_add_sta_cmd_size(mvm), in iwl_mvm_invalidate_sta_queue()
348 static int iwl_mvm_disable_txq(struct iwl_mvm *mvm, struct ieee80211_sta *sta, in iwl_mvm_disable_txq() argument
357 if (iwl_mvm_has_new_tx_api(mvm)) { in iwl_mvm_disable_txq()
358 iwl_trans_txq_free(mvm->trans, queue); in iwl_mvm_disable_txq()
363 if (WARN_ON(mvm->queue_info[queue].tid_bitmap == 0)) in iwl_mvm_disable_txq()
366 mvm->queue_info[queue].tid_bitmap &= ~BIT(tid); in iwl_mvm_disable_txq()
368 cmd.action = mvm->queue_info[queue].tid_bitmap ? in iwl_mvm_disable_txq()
371 mvm->queue_info[queue].status = IWL_MVM_QUEUE_FREE; in iwl_mvm_disable_txq()
373 IWL_DEBUG_TX_QUEUES(mvm, in iwl_mvm_disable_txq()
376 mvm->queue_info[queue].tid_bitmap); in iwl_mvm_disable_txq()
382 cmd.sta_id = mvm->queue_info[queue].ra_sta_id; in iwl_mvm_disable_txq()
383 cmd.tid = mvm->queue_info[queue].txq_tid; in iwl_mvm_disable_txq()
386 WARN(mvm->queue_info[queue].tid_bitmap, in iwl_mvm_disable_txq()
388 queue, mvm->queue_info[queue].tid_bitmap); in iwl_mvm_disable_txq()
391 mvm->queue_info[queue].tid_bitmap = 0; in iwl_mvm_disable_txq()
401 mvm->queue_info[queue].reserved = false; in iwl_mvm_disable_txq()
403 iwl_trans_txq_disable(mvm->trans, queue, false); in iwl_mvm_disable_txq()
404 ret = iwl_mvm_send_cmd_pdu(mvm, SCD_QUEUE_CFG, flags, in iwl_mvm_disable_txq()
408 IWL_ERR(mvm, "Failed to disable queue %d (ret=%d)\n", in iwl_mvm_disable_txq()
413 static int iwl_mvm_get_queue_agg_tids(struct iwl_mvm *mvm, int queue) in iwl_mvm_get_queue_agg_tids() argument
422 lockdep_assert_held(&mvm->mutex); in iwl_mvm_get_queue_agg_tids()
424 if (WARN_ON(iwl_mvm_has_new_tx_api(mvm))) in iwl_mvm_get_queue_agg_tids()
427 sta_id = mvm->queue_info[queue].ra_sta_id; in iwl_mvm_get_queue_agg_tids()
428 tid_bitmap = mvm->queue_info[queue].tid_bitmap; in iwl_mvm_get_queue_agg_tids()
430 sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id], in iwl_mvm_get_queue_agg_tids()
431 lockdep_is_held(&mvm->mutex)); in iwl_mvm_get_queue_agg_tids()
453 static int iwl_mvm_remove_sta_queue_marking(struct iwl_mvm *mvm, int queue) in iwl_mvm_remove_sta_queue_marking() argument
462 lockdep_assert_held(&mvm->mutex); in iwl_mvm_remove_sta_queue_marking()
464 if (WARN_ON(iwl_mvm_has_new_tx_api(mvm))) in iwl_mvm_remove_sta_queue_marking()
467 sta_id = mvm->queue_info[queue].ra_sta_id; in iwl_mvm_remove_sta_queue_marking()
468 tid_bitmap = mvm->queue_info[queue].tid_bitmap; in iwl_mvm_remove_sta_queue_marking()
472 sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); in iwl_mvm_remove_sta_queue_marking()
512 static int iwl_mvm_free_inactive_queue(struct iwl_mvm *mvm, int queue, in iwl_mvm_free_inactive_queue() argument
522 lockdep_assert_held(&mvm->mutex); in iwl_mvm_free_inactive_queue()
524 if (WARN_ON(iwl_mvm_has_new_tx_api(mvm))) in iwl_mvm_free_inactive_queue()
527 sta_id = mvm->queue_info[queue].ra_sta_id; in iwl_mvm_free_inactive_queue()
528 tid = mvm->queue_info[queue].txq_tid; in iwl_mvm_free_inactive_queue()
532 mvmsta = iwl_mvm_sta_from_staid_protected(mvm, sta_id); in iwl_mvm_free_inactive_queue()
536 disable_agg_tids = iwl_mvm_remove_sta_queue_marking(mvm, queue); in iwl_mvm_free_inactive_queue()
539 iwl_mvm_invalidate_sta_queue(mvm, queue, in iwl_mvm_free_inactive_queue()
542 ret = iwl_mvm_disable_txq(mvm, old_sta, queue, tid, 0); in iwl_mvm_free_inactive_queue()
544 IWL_ERR(mvm, in iwl_mvm_free_inactive_queue()
553 iwl_mvm_invalidate_sta_queue(mvm, queue, 0, true); in iwl_mvm_free_inactive_queue()
558 static int iwl_mvm_get_shared_queue(struct iwl_mvm *mvm, in iwl_mvm_get_shared_queue() argument
569 lockdep_assert_held(&mvm->mutex); in iwl_mvm_get_shared_queue()
571 if (WARN_ON(iwl_mvm_has_new_tx_api(mvm))) in iwl_mvm_get_shared_queue()
583 ac_to_queue[mvm->queue_info[i].mac80211_ac] = i; in iwl_mvm_get_shared_queue()
616 if (!iwl_mvm_is_dqa_data_queue(mvm, queue) && in iwl_mvm_get_shared_queue()
617 !iwl_mvm_is_dqa_mgmt_queue(mvm, queue) && in iwl_mvm_get_shared_queue()
619 IWL_ERR(mvm, "No DATA queues available to share\n"); in iwl_mvm_get_shared_queue()
632 static int iwl_mvm_redirect_queue(struct iwl_mvm *mvm, int queue, int tid, in iwl_mvm_redirect_queue() argument
643 if (WARN_ON(iwl_mvm_has_new_tx_api(mvm))) in iwl_mvm_redirect_queue()
654 if (ac <= mvm->queue_info[queue].mac80211_ac && !force) { in iwl_mvm_redirect_queue()
655 IWL_DEBUG_TX_QUEUES(mvm, in iwl_mvm_redirect_queue()
661 cmd.sta_id = mvm->queue_info[queue].ra_sta_id; in iwl_mvm_redirect_queue()
662 cmd.tx_fifo = iwl_mvm_ac_to_tx_fifo[mvm->queue_info[queue].mac80211_ac]; in iwl_mvm_redirect_queue()
663 cmd.tid = mvm->queue_info[queue].txq_tid; in iwl_mvm_redirect_queue()
664 shared_queue = hweight16(mvm->queue_info[queue].tid_bitmap) > 1; in iwl_mvm_redirect_queue()
666 IWL_DEBUG_TX_QUEUES(mvm, "Redirecting TXQ #%d to FIFO #%d\n", in iwl_mvm_redirect_queue()
672 ret = iwl_trans_wait_tx_queues_empty(mvm->trans, BIT(queue)); in iwl_mvm_redirect_queue()
674 IWL_ERR(mvm, "Error draining queue %d before reconfig\n", in iwl_mvm_redirect_queue()
681 iwl_trans_txq_disable(mvm->trans, queue, false); in iwl_mvm_redirect_queue()
682 ret = iwl_mvm_send_cmd_pdu(mvm, SCD_QUEUE_CFG, 0, sizeof(cmd), &cmd); in iwl_mvm_redirect_queue()
684 IWL_ERR(mvm, "Failed SCD disable TXQ %d (ret=%d)\n", queue, in iwl_mvm_redirect_queue()
688 iwl_trans_txq_enable_cfg(mvm->trans, queue, ssn, NULL, wdg_timeout); in iwl_mvm_redirect_queue()
691 mvm->queue_info[queue].txq_tid = tid; in iwl_mvm_redirect_queue()
696 iwl_mvm_reconfig_scd(mvm, queue, iwl_mvm_ac_to_tx_fifo[ac], in iwl_mvm_redirect_queue()
700 mvm->queue_info[queue].mac80211_ac = ac; in iwl_mvm_redirect_queue()
709 iwl_trans_txq_set_shared_mode(mvm->trans, queue, true); in iwl_mvm_redirect_queue()
718 static int iwl_mvm_find_free_queue(struct iwl_mvm *mvm, u8 sta_id, in iwl_mvm_find_free_queue() argument
723 lockdep_assert_held(&mvm->mutex); in iwl_mvm_find_free_queue()
726 if (WARN_ON(iwl_mvm_has_new_tx_api(mvm))) in iwl_mvm_find_free_queue()
731 if (mvm->queue_info[i].tid_bitmap == 0 && in iwl_mvm_find_free_queue()
732 mvm->queue_info[i].status == IWL_MVM_QUEUE_FREE) in iwl_mvm_find_free_queue()
738 static int iwl_mvm_tvqm_enable_txq(struct iwl_mvm *mvm, in iwl_mvm_tvqm_enable_txq() argument
742 mvm->trans->cfg->min_256_ba_txq_size); in iwl_mvm_tvqm_enable_txq()
747 mvm->trans->cfg->min_txq_size); in iwl_mvm_tvqm_enable_txq()
749 queue = iwl_trans_txq_alloc(mvm->trans, in iwl_mvm_tvqm_enable_txq()
754 IWL_DEBUG_TX_QUEUES(mvm, in iwl_mvm_tvqm_enable_txq()
760 IWL_DEBUG_TX_QUEUES(mvm, "Enabling TXQ #%d for sta %d tid %d\n", in iwl_mvm_tvqm_enable_txq()
763 IWL_DEBUG_TX_QUEUES(mvm, "Enabling TXQ #%d\n", queue); in iwl_mvm_tvqm_enable_txq()
768 static int iwl_mvm_sta_alloc_queue_tvqm(struct iwl_mvm *mvm, in iwl_mvm_sta_alloc_queue_tvqm() argument
776 iwl_mvm_get_wd_timeout(mvm, mvmsta->vif, false, false); in iwl_mvm_sta_alloc_queue_tvqm()
779 lockdep_assert_held(&mvm->mutex); in iwl_mvm_sta_alloc_queue_tvqm()
781 IWL_DEBUG_TX_QUEUES(mvm, in iwl_mvm_sta_alloc_queue_tvqm()
784 queue = iwl_mvm_tvqm_enable_txq(mvm, mvmsta->sta_id, tid, wdg_timeout); in iwl_mvm_sta_alloc_queue_tvqm()
789 mvm->tvqm_info[queue].txq_tid = tid; in iwl_mvm_sta_alloc_queue_tvqm()
790 mvm->tvqm_info[queue].sta_id = mvmsta->sta_id; in iwl_mvm_sta_alloc_queue_tvqm()
792 IWL_DEBUG_TX_QUEUES(mvm, "Allocated queue is %d\n", queue); in iwl_mvm_sta_alloc_queue_tvqm()
801 static bool iwl_mvm_update_txq_mapping(struct iwl_mvm *mvm, in iwl_mvm_update_txq_mapping() argument
808 if (mvm->queue_info[queue].tid_bitmap & BIT(tid)) { in iwl_mvm_update_txq_mapping()
809 IWL_ERR(mvm, "Trying to enable TXQ %d with existing TID %d\n", in iwl_mvm_update_txq_mapping()
815 if (mvm->queue_info[queue].tid_bitmap) in iwl_mvm_update_txq_mapping()
818 mvm->queue_info[queue].tid_bitmap |= BIT(tid); in iwl_mvm_update_txq_mapping()
819 mvm->queue_info[queue].ra_sta_id = sta_id; in iwl_mvm_update_txq_mapping()
823 mvm->queue_info[queue].mac80211_ac = in iwl_mvm_update_txq_mapping()
826 mvm->queue_info[queue].mac80211_ac = IEEE80211_AC_VO; in iwl_mvm_update_txq_mapping()
828 mvm->queue_info[queue].txq_tid = tid; in iwl_mvm_update_txq_mapping()
838 IWL_DEBUG_TX_QUEUES(mvm, in iwl_mvm_update_txq_mapping()
840 queue, mvm->queue_info[queue].tid_bitmap); in iwl_mvm_update_txq_mapping()
845 static bool iwl_mvm_enable_txq(struct iwl_mvm *mvm, struct ieee80211_sta *sta, in iwl_mvm_enable_txq() argument
862 if (WARN_ON(iwl_mvm_has_new_tx_api(mvm))) in iwl_mvm_enable_txq()
866 if (!iwl_mvm_update_txq_mapping(mvm, sta, queue, cfg->sta_id, cfg->tid)) in iwl_mvm_enable_txq()
869 inc_ssn = iwl_trans_txq_enable_cfg(mvm->trans, queue, ssn, in iwl_mvm_enable_txq()
874 WARN(iwl_mvm_send_cmd_pdu(mvm, SCD_QUEUE_CFG, 0, sizeof(cmd), &cmd), in iwl_mvm_enable_txq()
880 static void iwl_mvm_change_queue_tid(struct iwl_mvm *mvm, int queue) in iwl_mvm_change_queue_tid() argument
890 lockdep_assert_held(&mvm->mutex); in iwl_mvm_change_queue_tid()
892 if (WARN_ON(iwl_mvm_has_new_tx_api(mvm))) in iwl_mvm_change_queue_tid()
895 tid_bitmap = mvm->queue_info[queue].tid_bitmap; in iwl_mvm_change_queue_tid()
905 ret = iwl_mvm_send_cmd_pdu(mvm, SCD_QUEUE_CFG, 0, sizeof(cmd), &cmd); in iwl_mvm_change_queue_tid()
907 IWL_ERR(mvm, "Failed to update owner of TXQ %d (ret=%d)\n", in iwl_mvm_change_queue_tid()
912 mvm->queue_info[queue].txq_tid = tid; in iwl_mvm_change_queue_tid()
913 IWL_DEBUG_TX_QUEUES(mvm, "Changed TXQ %d ownership to tid %d\n", in iwl_mvm_change_queue_tid()
917 static void iwl_mvm_unshare_queue(struct iwl_mvm *mvm, int queue) in iwl_mvm_unshare_queue() argument
929 if (WARN_ON(iwl_mvm_has_new_tx_api(mvm))) in iwl_mvm_unshare_queue()
932 lockdep_assert_held(&mvm->mutex); in iwl_mvm_unshare_queue()
934 sta_id = mvm->queue_info[queue].ra_sta_id; in iwl_mvm_unshare_queue()
935 tid_bitmap = mvm->queue_info[queue].tid_bitmap; in iwl_mvm_unshare_queue()
940 IWL_ERR(mvm, "Failed to unshare q %d, active tids=0x%lx\n", in iwl_mvm_unshare_queue()
945 IWL_DEBUG_TX_QUEUES(mvm, "Unsharing TXQ %d, keeping tid %d\n", queue, in iwl_mvm_unshare_queue()
948 sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id], in iwl_mvm_unshare_queue()
949 lockdep_is_held(&mvm->mutex)); in iwl_mvm_unshare_queue()
955 wdg_timeout = iwl_mvm_get_wd_timeout(mvm, mvmsta->vif, false, false); in iwl_mvm_unshare_queue()
959 ret = iwl_mvm_redirect_queue(mvm, queue, tid, in iwl_mvm_unshare_queue()
964 IWL_ERR(mvm, "Failed to redirect TXQ %d\n", queue); in iwl_mvm_unshare_queue()
981 ret = iwl_mvm_send_cmd_pdu(mvm, ADD_STA, CMD_ASYNC, in iwl_mvm_unshare_queue()
982 iwl_mvm_add_sta_cmd_size(mvm), &cmd); in iwl_mvm_unshare_queue()
984 IWL_DEBUG_TX_QUEUES(mvm, in iwl_mvm_unshare_queue()
989 iwl_trans_txq_set_shared_mode(mvm->trans, queue, false); in iwl_mvm_unshare_queue()
993 mvm->queue_info[queue].status = IWL_MVM_QUEUE_READY; in iwl_mvm_unshare_queue()
1003 static bool iwl_mvm_remove_inactive_tids(struct iwl_mvm *mvm, in iwl_mvm_remove_inactive_tids() argument
1012 lockdep_assert_held(&mvm->mutex); in iwl_mvm_remove_inactive_tids()
1014 if (WARN_ON(iwl_mvm_has_new_tx_api(mvm))) in iwl_mvm_remove_inactive_tids()
1020 if (iwl_mvm_tid_queued(mvm, &mvmsta->tid_data[tid])) in iwl_mvm_remove_inactive_tids()
1029 if (tid_bitmap == mvm->queue_info[queue].tid_bitmap) { in iwl_mvm_remove_inactive_tids()
1030 IWL_DEBUG_TX_QUEUES(mvm, "Queue %d is inactive\n", queue); in iwl_mvm_remove_inactive_tids()
1042 mvm->queue_info[queue].tid_bitmap &= ~BIT(tid); in iwl_mvm_remove_inactive_tids()
1044 tid_bitmap = mvm->queue_info[queue].tid_bitmap; in iwl_mvm_remove_inactive_tids()
1057 if (!(tid_bitmap & BIT(mvm->queue_info[queue].txq_tid))) in iwl_mvm_remove_inactive_tids()
1060 IWL_DEBUG_TX_QUEUES(mvm, in iwl_mvm_remove_inactive_tids()
1065 IWL_DEBUG_TX_QUEUES(mvm, in iwl_mvm_remove_inactive_tids()
1067 mvm->queue_info[queue].tid_bitmap); in iwl_mvm_remove_inactive_tids()
1073 tid_bitmap = mvm->queue_info[queue].tid_bitmap; in iwl_mvm_remove_inactive_tids()
1076 if (hweight16(mvm->queue_info[queue].tid_bitmap) == 1 && in iwl_mvm_remove_inactive_tids()
1077 mvm->queue_info[queue].status == IWL_MVM_QUEUE_SHARED) { in iwl_mvm_remove_inactive_tids()
1078 IWL_DEBUG_TX_QUEUES(mvm, "Marking Q:%d for reconfig\n", in iwl_mvm_remove_inactive_tids()
1095 static int iwl_mvm_inactivity_check(struct iwl_mvm *mvm, u8 alloc_for_sta) in iwl_mvm_inactivity_check() argument
1103 lockdep_assert_held(&mvm->mutex); in iwl_mvm_inactivity_check()
1105 if (iwl_mvm_has_new_tx_api(mvm)) in iwl_mvm_inactivity_check()
1121 queue_tid_bitmap = mvm->queue_info[i].tid_bitmap; in iwl_mvm_inactivity_check()
1126 if (mvm->queue_info[i].status != IWL_MVM_QUEUE_READY && in iwl_mvm_inactivity_check()
1127 mvm->queue_info[i].status != IWL_MVM_QUEUE_SHARED) in iwl_mvm_inactivity_check()
1133 if (time_after(mvm->queue_info[i].last_frame_time[tid] + in iwl_mvm_inactivity_check()
1149 sta_id = mvm->queue_info[i].ra_sta_id; in iwl_mvm_inactivity_check()
1150 sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); in iwl_mvm_inactivity_check()
1163 ret = iwl_mvm_remove_inactive_tids(mvm, mvmsta, i, in iwl_mvm_inactivity_check()
1178 iwl_mvm_unshare_queue(mvm, i); in iwl_mvm_inactivity_check()
1180 iwl_mvm_change_queue_tid(mvm, i); in iwl_mvm_inactivity_check()
1183 ret = iwl_mvm_free_inactive_queue(mvm, free_queue, queue_owner, in iwl_mvm_inactivity_check()
1196 static int iwl_mvm_sta_alloc_queue(struct iwl_mvm *mvm, in iwl_mvm_sta_alloc_queue() argument
1201 .fifo = iwl_mvm_mac_ac_to_tx_fifo(mvm, ac), in iwl_mvm_sta_alloc_queue()
1207 iwl_mvm_get_wd_timeout(mvm, mvmsta->vif, false, false); in iwl_mvm_sta_alloc_queue()
1216 lockdep_assert_held(&mvm->mutex); in iwl_mvm_sta_alloc_queue()
1218 if (iwl_mvm_has_new_tx_api(mvm)) in iwl_mvm_sta_alloc_queue()
1219 return iwl_mvm_sta_alloc_queue_tvqm(mvm, sta, ac, tid); in iwl_mvm_sta_alloc_queue()
1227 queue = iwl_mvm_find_free_queue(mvm, mvmsta->sta_id, in iwl_mvm_sta_alloc_queue()
1231 IWL_DEBUG_TX_QUEUES(mvm, "Found free MGMT queue #%d\n", in iwl_mvm_sta_alloc_queue()
1238 (mvm->queue_info[mvmsta->reserved_queue].status == in iwl_mvm_sta_alloc_queue()
1241 mvm->queue_info[queue].reserved = true; in iwl_mvm_sta_alloc_queue()
1242 IWL_DEBUG_TX_QUEUES(mvm, "Using reserved queue #%d\n", queue); in iwl_mvm_sta_alloc_queue()
1246 queue = iwl_mvm_find_free_queue(mvm, mvmsta->sta_id, in iwl_mvm_sta_alloc_queue()
1251 queue = iwl_mvm_inactivity_check(mvm, mvmsta->sta_id); in iwl_mvm_sta_alloc_queue()
1256 queue = iwl_mvm_get_shared_queue(mvm, tfd_queue_mask, ac); in iwl_mvm_sta_alloc_queue()
1259 mvm->queue_info[queue].status = IWL_MVM_QUEUE_SHARED; in iwl_mvm_sta_alloc_queue()
1270 mvm->queue_info[queue].status = IWL_MVM_QUEUE_READY; in iwl_mvm_sta_alloc_queue()
1274 IWL_ERR(mvm, "No available queues for tid %d on sta_id %d\n", in iwl_mvm_sta_alloc_queue()
1288 IWL_DEBUG_TX_QUEUES(mvm, in iwl_mvm_sta_alloc_queue()
1295 disable_agg_tids = iwl_mvm_get_queue_agg_tids(mvm, queue); in iwl_mvm_sta_alloc_queue()
1298 IWL_DEBUG_TX_QUEUES(mvm, "Disabling aggs on queue %d\n", in iwl_mvm_sta_alloc_queue()
1300 iwl_mvm_invalidate_sta_queue(mvm, queue, in iwl_mvm_sta_alloc_queue()
1305 inc_ssn = iwl_mvm_enable_txq(mvm, sta, queue, ssn, &cfg, wdg_timeout); in iwl_mvm_sta_alloc_queue()
1314 iwl_trans_txq_set_shared_mode(mvm->trans, queue, true); in iwl_mvm_sta_alloc_queue()
1335 ret = iwl_mvm_sta_send_to_fw(mvm, sta, true, STA_MODIFY_QUEUES); in iwl_mvm_sta_alloc_queue()
1341 ret = iwl_mvm_sta_tx_agg(mvm, sta, tid, queue, true); in iwl_mvm_sta_alloc_queue()
1347 ret = iwl_mvm_redirect_queue(mvm, queue, tid, ac, ssn, in iwl_mvm_sta_alloc_queue()
1357 iwl_mvm_disable_txq(mvm, sta, queue, tid, 0); in iwl_mvm_sta_alloc_queue()
1372 struct iwl_mvm *mvm = container_of(wk, struct iwl_mvm, in iwl_mvm_add_new_dqa_stream_wk() local
1375 mutex_lock(&mvm->mutex); in iwl_mvm_add_new_dqa_stream_wk()
1377 iwl_mvm_inactivity_check(mvm, IWL_MVM_INVALID_STA); in iwl_mvm_add_new_dqa_stream_wk()
1379 while (!list_empty(&mvm->add_stream_txqs)) { in iwl_mvm_add_new_dqa_stream_wk()
1384 mvmtxq = list_first_entry(&mvm->add_stream_txqs, in iwl_mvm_add_new_dqa_stream_wk()
1393 iwl_mvm_sta_alloc_queue(mvm, txq->sta, txq->ac, tid); in iwl_mvm_add_new_dqa_stream_wk()
1396 iwl_mvm_mac_itxq_xmit(mvm->hw, txq); in iwl_mvm_add_new_dqa_stream_wk()
1400 mutex_unlock(&mvm->mutex); in iwl_mvm_add_new_dqa_stream_wk()
1403 static int iwl_mvm_reserve_sta_stream(struct iwl_mvm *mvm, in iwl_mvm_reserve_sta_stream() argument
1411 if (WARN_ON(iwl_mvm_has_new_tx_api(mvm))) in iwl_mvm_reserve_sta_stream()
1415 iwl_mvm_inactivity_check(mvm, IWL_MVM_INVALID_STA); in iwl_mvm_reserve_sta_stream()
1419 !mvm->queue_info[IWL_MVM_DQA_BSS_CLIENT_QUEUE].tid_bitmap && in iwl_mvm_reserve_sta_stream()
1420 (mvm->queue_info[IWL_MVM_DQA_BSS_CLIENT_QUEUE].status == in iwl_mvm_reserve_sta_stream()
1424 queue = iwl_mvm_find_free_queue(mvm, mvmsta->sta_id, in iwl_mvm_reserve_sta_stream()
1429 queue = iwl_mvm_inactivity_check(mvm, mvmsta->sta_id); in iwl_mvm_reserve_sta_stream()
1431 IWL_ERR(mvm, "No available queues for new station\n"); in iwl_mvm_reserve_sta_stream()
1435 mvm->queue_info[queue].status = IWL_MVM_QUEUE_RESERVED; in iwl_mvm_reserve_sta_stream()
1439 IWL_DEBUG_TX_QUEUES(mvm, "Reserving data queue #%d for sta_id %d\n", in iwl_mvm_reserve_sta_stream()
1452 static void iwl_mvm_realloc_queues_after_restart(struct iwl_mvm *mvm, in iwl_mvm_realloc_queues_after_restart() argument
1457 iwl_mvm_get_wd_timeout(mvm, mvm_sta->vif, false, false); in iwl_mvm_realloc_queues_after_restart()
1466 mvm->queue_info[mvm_sta->reserved_queue].status = in iwl_mvm_realloc_queues_after_restart()
1479 if (iwl_mvm_has_new_tx_api(mvm)) { in iwl_mvm_realloc_queues_after_restart()
1480 IWL_DEBUG_TX_QUEUES(mvm, in iwl_mvm_realloc_queues_after_restart()
1483 txq_id = iwl_mvm_tvqm_enable_txq(mvm, mvm_sta->sta_id, in iwl_mvm_realloc_queues_after_restart()
1505 cfg.fifo = iwl_mvm_mac_ac_to_tx_fifo(mvm, ac); in iwl_mvm_realloc_queues_after_restart()
1510 IWL_DEBUG_TX_QUEUES(mvm, in iwl_mvm_realloc_queues_after_restart()
1514 iwl_mvm_enable_txq(mvm, sta, txq_id, seq, &cfg, wdg); in iwl_mvm_realloc_queues_after_restart()
1515 mvm->queue_info[txq_id].status = IWL_MVM_QUEUE_READY; in iwl_mvm_realloc_queues_after_restart()
1520 static int iwl_mvm_add_int_sta_common(struct iwl_mvm *mvm, in iwl_mvm_add_int_sta_common() argument
1529 lockdep_assert_held(&mvm->mutex); in iwl_mvm_add_int_sta_common()
1535 if (fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_STA_TYPE)) in iwl_mvm_add_int_sta_common()
1538 if (!iwl_mvm_has_new_tx_api(mvm)) in iwl_mvm_add_int_sta_common()
1545 ret = iwl_mvm_send_cmd_pdu_status(mvm, ADD_STA, in iwl_mvm_add_int_sta_common()
1546 iwl_mvm_add_sta_cmd_size(mvm), in iwl_mvm_add_int_sta_common()
1553 IWL_DEBUG_INFO(mvm, "Internal station added.\n"); in iwl_mvm_add_int_sta_common()
1557 IWL_ERR(mvm, "Add internal station failed, status=0x%x\n", in iwl_mvm_add_int_sta_common()
1564 int iwl_mvm_add_sta(struct iwl_mvm *mvm, in iwl_mvm_add_sta() argument
1575 lockdep_assert_held(&mvm->mutex); in iwl_mvm_add_sta()
1577 if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) in iwl_mvm_add_sta()
1578 sta_id = iwl_mvm_find_free_sta_id(mvm, in iwl_mvm_add_sta()
1589 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { in iwl_mvm_add_sta()
1599 ret = iwl_mvm_add_int_sta_common(mvm, &tmp_sta, sta->addr, in iwl_mvm_add_sta()
1604 iwl_mvm_realloc_queues_after_restart(mvm, sta); in iwl_mvm_add_sta()
1606 sta_flags = iwl_mvm_has_new_tx_api(mvm) ? 0 : STA_MODIFY_QUEUES; in iwl_mvm_add_sta()
1614 if (!mvm->trans->trans_cfg->gen2) in iwl_mvm_add_sta()
1650 if (iwl_mvm_has_new_rx_api(mvm) && in iwl_mvm_add_sta()
1651 !test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { in iwl_mvm_add_sta()
1654 dup_data = kcalloc(mvm->trans->num_rx_queues, in iwl_mvm_add_sta()
1667 for (q = 0; q < mvm->trans->num_rx_queues; q++) in iwl_mvm_add_sta()
1673 if (!iwl_mvm_has_new_tx_api(mvm)) { in iwl_mvm_add_sta()
1674 ret = iwl_mvm_reserve_sta_stream(mvm, sta, in iwl_mvm_add_sta()
1684 if (iwl_mvm_has_tlc_offload(mvm)) in iwl_mvm_add_sta()
1685 iwl_mvm_rs_add_sta(mvm, mvm_sta); in iwl_mvm_add_sta()
1689 iwl_mvm_toggle_tx_ant(mvm, &mvm_sta->tx_ant); in iwl_mvm_add_sta()
1692 ret = iwl_mvm_sta_send_to_fw(mvm, sta, sta_update, sta_flags); in iwl_mvm_add_sta()
1705 rcu_assign_pointer(mvm->fw_id_to_mac_id[sta_id], sta); in iwl_mvm_add_sta()
1713 int iwl_mvm_drain_sta(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, in iwl_mvm_drain_sta() argument
1720 lockdep_assert_held(&mvm->mutex); in iwl_mvm_drain_sta()
1729 ret = iwl_mvm_send_cmd_pdu_status(mvm, ADD_STA, in iwl_mvm_drain_sta()
1730 iwl_mvm_add_sta_cmd_size(mvm), in iwl_mvm_drain_sta()
1737 IWL_DEBUG_INFO(mvm, "Frames for staid %d will drained in fw\n", in iwl_mvm_drain_sta()
1742 IWL_ERR(mvm, "Couldn't drain frames for staid %d\n", in iwl_mvm_drain_sta()
1755 static int iwl_mvm_rm_sta_common(struct iwl_mvm *mvm, u8 sta_id) in iwl_mvm_rm_sta_common() argument
1763 sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id], in iwl_mvm_rm_sta_common()
1764 lockdep_is_held(&mvm->mutex)); in iwl_mvm_rm_sta_common()
1768 IWL_ERR(mvm, "Invalid station id\n"); in iwl_mvm_rm_sta_common()
1772 ret = iwl_mvm_send_cmd_pdu(mvm, REMOVE_STA, 0, in iwl_mvm_rm_sta_common()
1775 IWL_ERR(mvm, "Failed to remove station. Id=%d\n", sta_id); in iwl_mvm_rm_sta_common()
1782 static void iwl_mvm_disable_sta_queues(struct iwl_mvm *mvm, in iwl_mvm_disable_sta_queues() argument
1789 lockdep_assert_held(&mvm->mutex); in iwl_mvm_disable_sta_queues()
1795 iwl_mvm_disable_txq(mvm, sta, mvm_sta->tid_data[i].txq_id, i, in iwl_mvm_disable_sta_queues()
1808 int iwl_mvm_wait_sta_queues_empty(struct iwl_mvm *mvm, in iwl_mvm_wait_sta_queues_empty() argument
1824 ret = iwl_trans_wait_txq_empty(mvm->trans, txq_id); in iwl_mvm_wait_sta_queues_empty()
1832 int iwl_mvm_rm_sta(struct iwl_mvm *mvm, in iwl_mvm_rm_sta() argument
1841 lockdep_assert_held(&mvm->mutex); in iwl_mvm_rm_sta()
1843 if (iwl_mvm_has_new_rx_api(mvm)) in iwl_mvm_rm_sta()
1846 ret = iwl_mvm_drain_sta(mvm, mvm_sta, true); in iwl_mvm_rm_sta()
1851 ret = iwl_mvm_flush_sta(mvm, mvm_sta, false, 0); in iwl_mvm_rm_sta()
1854 if (iwl_mvm_has_new_tx_api(mvm)) { in iwl_mvm_rm_sta()
1855 ret = iwl_mvm_wait_sta_queues_empty(mvm, mvm_sta); in iwl_mvm_rm_sta()
1859 ret = iwl_trans_wait_tx_queues_empty(mvm->trans, in iwl_mvm_rm_sta()
1865 ret = iwl_mvm_drain_sta(mvm, mvm_sta, false); in iwl_mvm_rm_sta()
1867 iwl_mvm_disable_sta_queues(mvm, vif, sta); in iwl_mvm_rm_sta()
1879 status = &mvm->queue_info[reserved_txq].status; in iwl_mvm_rm_sta()
1903 if (WARN_ON_ONCE(mvm->tdls_cs.peer.sta_id == sta_id)) { in iwl_mvm_rm_sta()
1904 mvm->tdls_cs.peer.sta_id = IWL_MVM_INVALID_STA; in iwl_mvm_rm_sta()
1905 cancel_delayed_work(&mvm->tdls_cs.dwork); in iwl_mvm_rm_sta()
1915 ret = iwl_mvm_rm_sta_common(mvm, mvm_sta->sta_id); in iwl_mvm_rm_sta()
1916 RCU_INIT_POINTER(mvm->fw_id_to_mac_id[mvm_sta->sta_id], NULL); in iwl_mvm_rm_sta()
1921 int iwl_mvm_rm_sta_id(struct iwl_mvm *mvm, in iwl_mvm_rm_sta_id() argument
1925 int ret = iwl_mvm_rm_sta_common(mvm, sta_id); in iwl_mvm_rm_sta_id()
1927 lockdep_assert_held(&mvm->mutex); in iwl_mvm_rm_sta_id()
1929 RCU_INIT_POINTER(mvm->fw_id_to_mac_id[sta_id], NULL); in iwl_mvm_rm_sta_id()
1933 int iwl_mvm_allocate_int_sta(struct iwl_mvm *mvm, in iwl_mvm_allocate_int_sta() argument
1938 if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) || in iwl_mvm_allocate_int_sta()
1940 sta->sta_id = iwl_mvm_find_free_sta_id(mvm, iftype); in iwl_mvm_allocate_int_sta()
1949 rcu_assign_pointer(mvm->fw_id_to_mac_id[sta->sta_id], ERR_PTR(-EINVAL)); in iwl_mvm_allocate_int_sta()
1953 void iwl_mvm_dealloc_int_sta(struct iwl_mvm *mvm, struct iwl_mvm_int_sta *sta) in iwl_mvm_dealloc_int_sta() argument
1955 RCU_INIT_POINTER(mvm->fw_id_to_mac_id[sta->sta_id], NULL); in iwl_mvm_dealloc_int_sta()
1960 static void iwl_mvm_enable_aux_snif_queue(struct iwl_mvm *mvm, u16 queue, in iwl_mvm_enable_aux_snif_queue() argument
1964 mvm->trans->trans_cfg->base_params->wd_timeout : in iwl_mvm_enable_aux_snif_queue()
1974 WARN_ON(iwl_mvm_has_new_tx_api(mvm)); in iwl_mvm_enable_aux_snif_queue()
1976 iwl_mvm_enable_txq(mvm, NULL, queue, 0, &cfg, wdg_timeout); in iwl_mvm_enable_aux_snif_queue()
1979 static int iwl_mvm_enable_aux_snif_queue_tvqm(struct iwl_mvm *mvm, u8 sta_id) in iwl_mvm_enable_aux_snif_queue_tvqm() argument
1982 mvm->trans->trans_cfg->base_params->wd_timeout : in iwl_mvm_enable_aux_snif_queue_tvqm()
1985 WARN_ON(!iwl_mvm_has_new_tx_api(mvm)); in iwl_mvm_enable_aux_snif_queue_tvqm()
1987 return iwl_mvm_tvqm_enable_txq(mvm, sta_id, IWL_MAX_TID_COUNT, in iwl_mvm_enable_aux_snif_queue_tvqm()
1991 static int iwl_mvm_add_int_sta_with_queue(struct iwl_mvm *mvm, int macidx, in iwl_mvm_add_int_sta_with_queue() argument
1999 if (!iwl_mvm_has_new_tx_api(mvm)) in iwl_mvm_add_int_sta_with_queue()
2000 iwl_mvm_enable_aux_snif_queue(mvm, *queue, sta->sta_id, fifo); in iwl_mvm_add_int_sta_with_queue()
2002 ret = iwl_mvm_add_int_sta_common(mvm, sta, NULL, macidx, maccolor); in iwl_mvm_add_int_sta_with_queue()
2004 if (!iwl_mvm_has_new_tx_api(mvm)) in iwl_mvm_add_int_sta_with_queue()
2005 iwl_mvm_disable_txq(mvm, NULL, *queue, in iwl_mvm_add_int_sta_with_queue()
2014 if (iwl_mvm_has_new_tx_api(mvm)) { in iwl_mvm_add_int_sta_with_queue()
2017 txq = iwl_mvm_enable_aux_snif_queue_tvqm(mvm, sta->sta_id); in iwl_mvm_add_int_sta_with_queue()
2019 iwl_mvm_rm_sta_common(mvm, sta->sta_id); in iwl_mvm_add_int_sta_with_queue()
2029 int iwl_mvm_add_aux_sta(struct iwl_mvm *mvm) in iwl_mvm_add_aux_sta() argument
2033 lockdep_assert_held(&mvm->mutex); in iwl_mvm_add_aux_sta()
2036 ret = iwl_mvm_allocate_int_sta(mvm, &mvm->aux_sta, BIT(mvm->aux_queue), in iwl_mvm_add_aux_sta()
2042 ret = iwl_mvm_add_int_sta_with_queue(mvm, MAC_INDEX_AUX, 0, in iwl_mvm_add_aux_sta()
2043 &mvm->aux_sta, &mvm->aux_queue, in iwl_mvm_add_aux_sta()
2046 iwl_mvm_dealloc_int_sta(mvm, &mvm->aux_sta); in iwl_mvm_add_aux_sta()
2053 int iwl_mvm_add_snif_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_add_snif_sta() argument
2057 lockdep_assert_held(&mvm->mutex); in iwl_mvm_add_snif_sta()
2059 return iwl_mvm_add_int_sta_with_queue(mvm, mvmvif->id, mvmvif->color, in iwl_mvm_add_snif_sta()
2060 &mvm->snif_sta, &mvm->snif_queue, in iwl_mvm_add_snif_sta()
2064 int iwl_mvm_rm_snif_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_rm_snif_sta() argument
2068 lockdep_assert_held(&mvm->mutex); in iwl_mvm_rm_snif_sta()
2070 iwl_mvm_disable_txq(mvm, NULL, mvm->snif_queue, IWL_MAX_TID_COUNT, 0); in iwl_mvm_rm_snif_sta()
2071 ret = iwl_mvm_rm_sta_common(mvm, mvm->snif_sta.sta_id); in iwl_mvm_rm_snif_sta()
2073 IWL_WARN(mvm, "Failed sending remove station\n"); in iwl_mvm_rm_snif_sta()
2078 void iwl_mvm_dealloc_snif_sta(struct iwl_mvm *mvm) in iwl_mvm_dealloc_snif_sta() argument
2080 iwl_mvm_dealloc_int_sta(mvm, &mvm->snif_sta); in iwl_mvm_dealloc_snif_sta()
2083 void iwl_mvm_del_aux_sta(struct iwl_mvm *mvm) in iwl_mvm_del_aux_sta() argument
2085 lockdep_assert_held(&mvm->mutex); in iwl_mvm_del_aux_sta()
2087 iwl_mvm_dealloc_int_sta(mvm, &mvm->aux_sta); in iwl_mvm_del_aux_sta()
2098 int iwl_mvm_send_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_send_add_bcast_sta() argument
2107 iwl_mvm_get_wd_timeout(mvm, vif, false, false); in iwl_mvm_send_add_bcast_sta()
2116 lockdep_assert_held(&mvm->mutex); in iwl_mvm_send_add_bcast_sta()
2118 if (!iwl_mvm_has_new_tx_api(mvm)) { in iwl_mvm_send_add_bcast_sta()
2121 queue = mvm->probe_queue; in iwl_mvm_send_add_bcast_sta()
2123 queue = mvm->p2p_dev_queue; in iwl_mvm_send_add_bcast_sta()
2131 iwl_mvm_enable_txq(mvm, NULL, queue, 0, &cfg, wdg_timeout); in iwl_mvm_send_add_bcast_sta()
2140 ret = iwl_mvm_add_int_sta_common(mvm, bsta, baddr, in iwl_mvm_send_add_bcast_sta()
2149 if (iwl_mvm_has_new_tx_api(mvm)) { in iwl_mvm_send_add_bcast_sta()
2150 queue = iwl_mvm_tvqm_enable_txq(mvm, bsta->sta_id, in iwl_mvm_send_add_bcast_sta()
2154 iwl_mvm_rm_sta_common(mvm, bsta->sta_id); in iwl_mvm_send_add_bcast_sta()
2160 mvm->probe_queue = queue; in iwl_mvm_send_add_bcast_sta()
2162 mvm->p2p_dev_queue = queue; in iwl_mvm_send_add_bcast_sta()
2168 static void iwl_mvm_free_bcast_sta_queues(struct iwl_mvm *mvm, in iwl_mvm_free_bcast_sta_queues() argument
2174 lockdep_assert_held(&mvm->mutex); in iwl_mvm_free_bcast_sta_queues()
2176 iwl_mvm_flush_sta(mvm, &mvmvif->bcast_sta, true, 0); in iwl_mvm_free_bcast_sta_queues()
2181 queue = mvm->probe_queue; in iwl_mvm_free_bcast_sta_queues()
2184 queue = mvm->p2p_dev_queue; in iwl_mvm_free_bcast_sta_queues()
2192 iwl_mvm_disable_txq(mvm, NULL, queue, IWL_MAX_TID_COUNT, 0); in iwl_mvm_free_bcast_sta_queues()
2193 if (iwl_mvm_has_new_tx_api(mvm)) in iwl_mvm_free_bcast_sta_queues()
2202 int iwl_mvm_send_rm_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_send_rm_bcast_sta() argument
2207 lockdep_assert_held(&mvm->mutex); in iwl_mvm_send_rm_bcast_sta()
2209 iwl_mvm_free_bcast_sta_queues(mvm, vif); in iwl_mvm_send_rm_bcast_sta()
2211 ret = iwl_mvm_rm_sta_common(mvm, mvmvif->bcast_sta.sta_id); in iwl_mvm_send_rm_bcast_sta()
2213 IWL_WARN(mvm, "Failed sending remove station\n"); in iwl_mvm_send_rm_bcast_sta()
2217 int iwl_mvm_alloc_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_alloc_bcast_sta() argument
2221 lockdep_assert_held(&mvm->mutex); in iwl_mvm_alloc_bcast_sta()
2223 return iwl_mvm_allocate_int_sta(mvm, &mvmvif->bcast_sta, 0, in iwl_mvm_alloc_bcast_sta()
2235 int iwl_mvm_add_p2p_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_add_p2p_bcast_sta() argument
2241 lockdep_assert_held(&mvm->mutex); in iwl_mvm_add_p2p_bcast_sta()
2243 ret = iwl_mvm_alloc_bcast_sta(mvm, vif); in iwl_mvm_add_p2p_bcast_sta()
2247 ret = iwl_mvm_send_add_bcast_sta(mvm, vif); in iwl_mvm_add_p2p_bcast_sta()
2250 iwl_mvm_dealloc_int_sta(mvm, bsta); in iwl_mvm_add_p2p_bcast_sta()
2255 void iwl_mvm_dealloc_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_dealloc_bcast_sta() argument
2259 iwl_mvm_dealloc_int_sta(mvm, &mvmvif->bcast_sta); in iwl_mvm_dealloc_bcast_sta()
2266 int iwl_mvm_rm_p2p_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_rm_p2p_bcast_sta() argument
2270 lockdep_assert_held(&mvm->mutex); in iwl_mvm_rm_p2p_bcast_sta()
2272 ret = iwl_mvm_send_rm_bcast_sta(mvm, vif); in iwl_mvm_rm_p2p_bcast_sta()
2274 iwl_mvm_dealloc_bcast_sta(mvm, vif); in iwl_mvm_rm_p2p_bcast_sta()
2287 int iwl_mvm_add_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_add_mcast_sta() argument
2301 unsigned int timeout = iwl_mvm_get_wd_timeout(mvm, vif, false, false); in iwl_mvm_add_mcast_sta()
2304 lockdep_assert_held(&mvm->mutex); in iwl_mvm_add_mcast_sta()
2323 if (!iwl_mvm_has_new_tx_api(mvm) && in iwl_mvm_add_mcast_sta()
2324 fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_STA_TYPE)) { in iwl_mvm_add_mcast_sta()
2325 iwl_mvm_enable_txq(mvm, NULL, mvmvif->cab_queue, 0, &cfg, in iwl_mvm_add_mcast_sta()
2329 ret = iwl_mvm_add_int_sta_common(mvm, msta, maddr, in iwl_mvm_add_mcast_sta()
2341 if (iwl_mvm_has_new_tx_api(mvm)) { in iwl_mvm_add_mcast_sta()
2342 int queue = iwl_mvm_tvqm_enable_txq(mvm, msta->sta_id, in iwl_mvm_add_mcast_sta()
2350 } else if (!fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_add_mcast_sta()
2352 iwl_mvm_enable_txq(mvm, NULL, mvmvif->cab_queue, 0, &cfg, in iwl_mvm_add_mcast_sta()
2357 iwl_mvm_dealloc_int_sta(mvm, msta); in iwl_mvm_add_mcast_sta()
2361 static int __iwl_mvm_remove_sta_key(struct iwl_mvm *mvm, u8 sta_id, in __iwl_mvm_remove_sta_key() argument
2369 bool new_api = fw_has_api(&mvm->fw->ucode_capa, in __iwl_mvm_remove_sta_key()
2398 ret = iwl_mvm_send_cmd_pdu_status(mvm, ADD_STA_KEY, size, &u.cmd, in __iwl_mvm_remove_sta_key()
2403 IWL_DEBUG_WEP(mvm, "MODIFY_STA: remove sta key passed\n"); in __iwl_mvm_remove_sta_key()
2407 IWL_ERR(mvm, "MODIFY_STA: remove sta key failed\n"); in __iwl_mvm_remove_sta_key()
2418 int iwl_mvm_rm_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_rm_mcast_sta() argument
2423 lockdep_assert_held(&mvm->mutex); in iwl_mvm_rm_mcast_sta()
2425 iwl_mvm_flush_sta(mvm, &mvmvif->mcast_sta, true, 0); in iwl_mvm_rm_mcast_sta()
2427 iwl_mvm_disable_txq(mvm, NULL, mvmvif->cab_queue, 0, 0); in iwl_mvm_rm_mcast_sta()
2429 ret = iwl_mvm_rm_sta_common(mvm, mvmvif->mcast_sta.sta_id); in iwl_mvm_rm_mcast_sta()
2431 IWL_WARN(mvm, "Failed sending remove station\n"); in iwl_mvm_rm_mcast_sta()
2438 static void iwl_mvm_sync_rxq_del_ba(struct iwl_mvm *mvm, u8 baid) in iwl_mvm_sync_rxq_del_ba() argument
2445 iwl_mvm_sync_rx_queues_internal(mvm, (void *)&notif, sizeof(notif)); in iwl_mvm_sync_rxq_del_ba()
2448 static void iwl_mvm_free_reorder(struct iwl_mvm *mvm, in iwl_mvm_free_reorder() argument
2453 iwl_mvm_sync_rxq_del_ba(mvm, data->baid); in iwl_mvm_free_reorder()
2455 for (i = 0; i < mvm->trans->num_rx_queues; i++) { in iwl_mvm_free_reorder()
2491 static void iwl_mvm_init_reorder_buffer(struct iwl_mvm *mvm, in iwl_mvm_init_reorder_buffer() argument
2497 for (i = 0; i < mvm->trans->num_rx_queues; i++) { in iwl_mvm_init_reorder_buffer()
2511 reorder_buf->mvm = mvm; in iwl_mvm_init_reorder_buffer()
2519 int iwl_mvm_sta_rx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta, in iwl_mvm_sta_rx_agg() argument
2528 lockdep_assert_held(&mvm->mutex); in iwl_mvm_sta_rx_agg()
2530 if (start && mvm->rx_ba_sessions >= IWL_MAX_RX_BA_SESSIONS) { in iwl_mvm_sta_rx_agg()
2531 IWL_WARN(mvm, "Not enough RX BA SESSIONS\n"); in iwl_mvm_sta_rx_agg()
2535 if (iwl_mvm_has_new_rx_api(mvm) && start) { in iwl_mvm_sta_rx_agg()
2562 mvm->trans->num_rx_queues * in iwl_mvm_sta_rx_agg()
2590 ret = iwl_mvm_send_cmd_pdu_status(mvm, ADD_STA, in iwl_mvm_sta_rx_agg()
2591 iwl_mvm_add_sta_cmd_size(mvm), in iwl_mvm_sta_rx_agg()
2598 IWL_DEBUG_HT(mvm, "RX BA Session %sed in fw\n", in iwl_mvm_sta_rx_agg()
2602 IWL_WARN(mvm, "RX BA Session refused by fw\n"); in iwl_mvm_sta_rx_agg()
2607 IWL_ERR(mvm, "RX BA Session failed %sing, status 0x%x\n", in iwl_mvm_sta_rx_agg()
2618 mvm->rx_ba_sessions++; in iwl_mvm_sta_rx_agg()
2620 if (!iwl_mvm_has_new_rx_api(mvm)) in iwl_mvm_sta_rx_agg()
2632 baid_data->rcu_ptr = &mvm->baid_map[baid]; in iwl_mvm_sta_rx_agg()
2635 baid_data->mvm = mvm; in iwl_mvm_sta_rx_agg()
2644 iwl_mvm_init_reorder_buffer(mvm, baid_data, ssn, buf_size); in iwl_mvm_sta_rx_agg()
2651 IWL_DEBUG_HT(mvm, "Sta %d(%d) is assigned to BAID %d\n", in iwl_mvm_sta_rx_agg()
2653 WARN_ON(rcu_access_pointer(mvm->baid_map[baid])); in iwl_mvm_sta_rx_agg()
2654 rcu_assign_pointer(mvm->baid_map[baid], baid_data); in iwl_mvm_sta_rx_agg()
2658 if (mvm->rx_ba_sessions > 0) in iwl_mvm_sta_rx_agg()
2660 mvm->rx_ba_sessions--; in iwl_mvm_sta_rx_agg()
2661 if (!iwl_mvm_has_new_rx_api(mvm)) in iwl_mvm_sta_rx_agg()
2667 baid_data = rcu_access_pointer(mvm->baid_map[baid]); in iwl_mvm_sta_rx_agg()
2672 iwl_mvm_free_reorder(mvm, baid_data); in iwl_mvm_sta_rx_agg()
2674 RCU_INIT_POINTER(mvm->baid_map[baid], NULL); in iwl_mvm_sta_rx_agg()
2676 IWL_DEBUG_HT(mvm, "BAID %d is free\n", baid); in iwl_mvm_sta_rx_agg()
2685 int iwl_mvm_sta_tx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta, in iwl_mvm_sta_tx_agg() argument
2693 lockdep_assert_held(&mvm->mutex); in iwl_mvm_sta_tx_agg()
2706 if (!iwl_mvm_has_new_tx_api(mvm)) in iwl_mvm_sta_tx_agg()
2713 ret = iwl_mvm_send_cmd_pdu_status(mvm, ADD_STA, in iwl_mvm_sta_tx_agg()
2714 iwl_mvm_add_sta_cmd_size(mvm), in iwl_mvm_sta_tx_agg()
2724 IWL_ERR(mvm, "TX BA Session failed %sing, status 0x%x\n", in iwl_mvm_sta_tx_agg()
2755 int iwl_mvm_sta_tx_agg_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_sta_tx_agg_start() argument
2769 IWL_ERR(mvm, in iwl_mvm_sta_tx_agg_start()
2775 lockdep_assert_held(&mvm->mutex); in iwl_mvm_sta_tx_agg_start()
2778 iwl_mvm_has_new_tx_api(mvm)) { in iwl_mvm_sta_tx_agg_start()
2781 ret = iwl_mvm_sta_alloc_queue_tvqm(mvm, sta, ac, tid); in iwl_mvm_sta_tx_agg_start()
2796 ret = iwl_mvm_find_free_queue(mvm, mvmsta->sta_id, in iwl_mvm_sta_tx_agg_start()
2800 IWL_ERR(mvm, "Failed to allocate agg queue\n"); in iwl_mvm_sta_tx_agg_start()
2807 mvm->queue_info[txq_id].status = IWL_MVM_QUEUE_RESERVED; in iwl_mvm_sta_tx_agg_start()
2810 IWL_ERR(mvm, "tid_id %d out of range (0, %d)!\n", in iwl_mvm_sta_tx_agg_start()
2814 } else if (unlikely(mvm->queue_info[txq_id].status == in iwl_mvm_sta_tx_agg_start()
2817 IWL_DEBUG_TX_QUEUES(mvm, in iwl_mvm_sta_tx_agg_start()
2823 IWL_DEBUG_TX_QUEUES(mvm, in iwl_mvm_sta_tx_agg_start()
2832 IWL_DEBUG_TX_QUEUES(mvm, in iwl_mvm_sta_tx_agg_start()
2842 if (mvm->trans->trans_cfg->gen2) in iwl_mvm_sta_tx_agg_start()
2860 int iwl_mvm_sta_tx_agg_oper(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_sta_tx_agg_oper() argument
2867 iwl_mvm_get_wd_timeout(mvm, vif, sta->tdls, false); in iwl_mvm_sta_tx_agg_oper()
2884 if (WARN_ON_ONCE(iwl_mvm_has_tlc_offload(mvm))) in iwl_mvm_sta_tx_agg_oper()
2899 if (iwl_mvm_has_new_tx_api(mvm)) { in iwl_mvm_sta_tx_agg_oper()
2914 ret = iwl_mvm_sta_tx_agg(mvm, sta, tid, queue, true); in iwl_mvm_sta_tx_agg_oper()
2922 queue_status = mvm->queue_info[queue].status; in iwl_mvm_sta_tx_agg_oper()
2925 if (mvm->queue_info[queue].status == IWL_MVM_QUEUE_READY) in iwl_mvm_sta_tx_agg_oper()
2937 ret = iwl_trans_wait_tx_queues_empty(mvm->trans, in iwl_mvm_sta_tx_agg_oper()
2940 IWL_ERR(mvm, in iwl_mvm_sta_tx_agg_oper()
2945 ret = iwl_mvm_reconfig_scd(mvm, queue, cfg.fifo, in iwl_mvm_sta_tx_agg_oper()
2949 IWL_ERR(mvm, in iwl_mvm_sta_tx_agg_oper()
2956 iwl_mvm_enable_txq(mvm, sta, queue, ssn, in iwl_mvm_sta_tx_agg_oper()
2961 ret = iwl_mvm_sta_tx_agg(mvm, sta, tid, queue, true); in iwl_mvm_sta_tx_agg_oper()
2967 mvm->queue_info[queue].status = IWL_MVM_QUEUE_READY; in iwl_mvm_sta_tx_agg_oper()
2981 IWL_DEBUG_HT(mvm, "Tx aggregation enabled on ra = %pM tid = %d\n", in iwl_mvm_sta_tx_agg_oper()
2984 return iwl_mvm_send_lq_cmd(mvm, &mvmsta->lq_sta.rs_drv.lq); in iwl_mvm_sta_tx_agg_oper()
2987 static void iwl_mvm_unreserve_agg_queue(struct iwl_mvm *mvm, in iwl_mvm_unreserve_agg_queue() argument
2993 lockdep_assert_held(&mvm->mutex); in iwl_mvm_unreserve_agg_queue()
2995 if (iwl_mvm_has_new_tx_api(mvm)) in iwl_mvm_unreserve_agg_queue()
3005 if (mvm->queue_info[txq_id].status == IWL_MVM_QUEUE_RESERVED) { in iwl_mvm_unreserve_agg_queue()
3006 mvm->queue_info[txq_id].status = IWL_MVM_QUEUE_FREE; in iwl_mvm_unreserve_agg_queue()
3011 int iwl_mvm_sta_tx_agg_stop(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_sta_tx_agg_stop() argument
3023 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { in iwl_mvm_sta_tx_agg_stop()
3032 IWL_DEBUG_TX_QUEUES(mvm, "Stop AGG: sta %d tid %d q %d state %d\n", in iwl_mvm_sta_tx_agg_stop()
3037 iwl_mvm_unreserve_agg_queue(mvm, mvmsta, tid_data); in iwl_mvm_sta_tx_agg_stop()
3043 IWL_DEBUG_TX_QUEUES(mvm, in iwl_mvm_sta_tx_agg_stop()
3053 iwl_mvm_sta_tx_agg(mvm, sta, tid, txq_id, false); in iwl_mvm_sta_tx_agg_stop()
3063 lockdep_assert_held(&mvm->mutex); in iwl_mvm_sta_tx_agg_stop()
3070 IWL_ERR(mvm, in iwl_mvm_sta_tx_agg_stop()
3073 IWL_ERR(mvm, in iwl_mvm_sta_tx_agg_stop()
3083 int iwl_mvm_sta_tx_agg_flush(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_sta_tx_agg_flush() argument
3097 IWL_DEBUG_TX_QUEUES(mvm, "Flush AGG: sta %d tid %d q %d state %d\n", in iwl_mvm_sta_tx_agg_flush()
3104 iwl_mvm_unreserve_agg_queue(mvm, mvmsta, tid_data); in iwl_mvm_sta_tx_agg_flush()
3107 iwl_mvm_drain_sta(mvm, mvmsta, true); in iwl_mvm_sta_tx_agg_flush()
3109 if (iwl_mvm_has_new_tx_api(mvm)) { in iwl_mvm_sta_tx_agg_flush()
3110 if (iwl_mvm_flush_sta_tids(mvm, mvmsta->sta_id, in iwl_mvm_sta_tx_agg_flush()
3112 IWL_ERR(mvm, "Couldn't flush the AGG queue\n"); in iwl_mvm_sta_tx_agg_flush()
3113 iwl_trans_wait_txq_empty(mvm->trans, txq_id); in iwl_mvm_sta_tx_agg_flush()
3115 if (iwl_mvm_flush_tx_path(mvm, BIT(txq_id), 0)) in iwl_mvm_sta_tx_agg_flush()
3116 IWL_ERR(mvm, "Couldn't flush the AGG queue\n"); in iwl_mvm_sta_tx_agg_flush()
3117 iwl_trans_wait_tx_queues_empty(mvm->trans, BIT(txq_id)); in iwl_mvm_sta_tx_agg_flush()
3120 iwl_mvm_drain_sta(mvm, mvmsta, false); in iwl_mvm_sta_tx_agg_flush()
3122 iwl_mvm_sta_tx_agg(mvm, sta, tid, txq_id, false); in iwl_mvm_sta_tx_agg_flush()
3128 static int iwl_mvm_set_fw_key_idx(struct iwl_mvm *mvm) in iwl_mvm_set_fw_key_idx() argument
3132 lockdep_assert_held(&mvm->mutex); in iwl_mvm_set_fw_key_idx()
3141 if (test_bit(i, mvm->fw_key_table)) in iwl_mvm_set_fw_key_idx()
3143 if (mvm->fw_key_deleted[i] > max) { in iwl_mvm_set_fw_key_idx()
3144 max = mvm->fw_key_deleted[i]; in iwl_mvm_set_fw_key_idx()
3155 static struct iwl_mvm_sta *iwl_mvm_get_key_sta(struct iwl_mvm *mvm, in iwl_mvm_get_key_sta() argument
3173 sta = rcu_dereference_check(mvm->fw_id_to_mac_id[sta_id], in iwl_mvm_get_key_sta()
3174 lockdep_is_held(&mvm->mutex)); in iwl_mvm_get_key_sta()
3190 static int iwl_mvm_send_sta_key(struct iwl_mvm *mvm, in iwl_mvm_send_sta_key() argument
3206 bool new_api = fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_send_sta_key()
3283 ret = iwl_mvm_send_cmd_pdu(mvm, ADD_STA_KEY, CMD_ASYNC, size, in iwl_mvm_send_sta_key()
3286 ret = iwl_mvm_send_cmd_pdu_status(mvm, ADD_STA_KEY, size, in iwl_mvm_send_sta_key()
3291 IWL_DEBUG_WEP(mvm, "MODIFY_STA: set dynamic key passed\n"); in iwl_mvm_send_sta_key()
3295 IWL_ERR(mvm, "MODIFY_STA: set dynamic key failed\n"); in iwl_mvm_send_sta_key()
3302 static int iwl_mvm_send_sta_igtk(struct iwl_mvm *mvm, in iwl_mvm_send_sta_igtk() argument
3316 if (WARN_ON(!iwl_mvm_has_new_rx_api(mvm) && in iwl_mvm_send_sta_igtk()
3355 IWL_DEBUG_INFO(mvm, "%s igtk for sta %u\n", in iwl_mvm_send_sta_igtk()
3359 if (!iwl_mvm_has_new_rx_api(mvm)) { in iwl_mvm_send_sta_igtk()
3369 return iwl_mvm_send_cmd_pdu(mvm, MGMT_MCAST_KEY, 0, in iwl_mvm_send_sta_igtk()
3372 return iwl_mvm_send_cmd_pdu(mvm, MGMT_MCAST_KEY, 0, in iwl_mvm_send_sta_igtk()
3377 static inline u8 *iwl_mvm_get_mac_addr(struct iwl_mvm *mvm, in iwl_mvm_get_mac_addr() argument
3389 sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id], in iwl_mvm_get_mac_addr()
3390 lockdep_is_held(&mvm->mutex)); in iwl_mvm_get_mac_addr()
3398 static int __iwl_mvm_set_sta_key(struct iwl_mvm *mvm, in __iwl_mvm_set_sta_key() argument
3423 IWL_ERR(mvm, "Failed to find station id\n"); in __iwl_mvm_set_sta_key()
3429 addr = iwl_mvm_get_mac_addr(mvm, vif, sta); in __iwl_mvm_set_sta_key()
3433 ret = iwl_mvm_send_sta_key(mvm, sta_id, keyconf, mcast, in __iwl_mvm_set_sta_key()
3442 ret = iwl_mvm_send_sta_key(mvm, sta_id, keyconf, mcast, in __iwl_mvm_set_sta_key()
3446 ret = iwl_mvm_send_sta_key(mvm, sta_id, keyconf, mcast, in __iwl_mvm_set_sta_key()
3453 int iwl_mvm_set_sta_key(struct iwl_mvm *mvm, in iwl_mvm_set_sta_key() argument
3465 lockdep_assert_held(&mvm->mutex); in iwl_mvm_set_sta_key()
3470 mvm_sta = iwl_mvm_get_key_sta(mvm, vif, sta); in iwl_mvm_set_sta_key()
3472 IWL_ERR(mvm, "Failed to find station\n"); in iwl_mvm_set_sta_key()
3484 mvm->fw_id_to_mac_id[sta_id], in iwl_mvm_set_sta_key()
3485 lockdep_is_held(&mvm->mutex)); in iwl_mvm_set_sta_key()
3487 IWL_ERR(mvm, "Invalid station id\n"); in iwl_mvm_set_sta_key()
3503 ret = iwl_mvm_send_sta_igtk(mvm, keyconf, sta_id, false); in iwl_mvm_set_sta_key()
3519 key_offset = iwl_mvm_set_fw_key_idx(mvm); in iwl_mvm_set_sta_key()
3525 ret = __iwl_mvm_set_sta_key(mvm, vif, sta, keyconf, key_offset, mcast); in iwl_mvm_set_sta_key()
3538 ret = __iwl_mvm_set_sta_key(mvm, vif, sta, keyconf, in iwl_mvm_set_sta_key()
3541 __iwl_mvm_remove_sta_key(mvm, sta_id, keyconf, mcast); in iwl_mvm_set_sta_key()
3546 __set_bit(key_offset, mvm->fw_key_table); in iwl_mvm_set_sta_key()
3549 IWL_DEBUG_WEP(mvm, "key: cipher=%x len=%d idx=%d sta=%pM ret=%d\n", in iwl_mvm_set_sta_key()
3555 int iwl_mvm_remove_sta_key(struct iwl_mvm *mvm, in iwl_mvm_remove_sta_key() argument
3565 lockdep_assert_held(&mvm->mutex); in iwl_mvm_remove_sta_key()
3568 mvm_sta = iwl_mvm_get_key_sta(mvm, vif, sta); in iwl_mvm_remove_sta_key()
3575 IWL_DEBUG_WEP(mvm, "mvm remove dynamic key: idx=%d sta=%d\n", in iwl_mvm_remove_sta_key()
3581 return iwl_mvm_send_sta_igtk(mvm, keyconf, sta_id, true); in iwl_mvm_remove_sta_key()
3583 if (!__test_and_clear_bit(keyconf->hw_key_idx, mvm->fw_key_table)) { in iwl_mvm_remove_sta_key()
3584 IWL_ERR(mvm, "offset %d not used in fw key table.\n", in iwl_mvm_remove_sta_key()
3591 if (mvm->fw_key_deleted[i] < U8_MAX) in iwl_mvm_remove_sta_key()
3592 mvm->fw_key_deleted[i]++; in iwl_mvm_remove_sta_key()
3594 mvm->fw_key_deleted[keyconf->hw_key_idx] = 0; in iwl_mvm_remove_sta_key()
3597 IWL_DEBUG_WEP(mvm, "station non-existent, early return.\n"); in iwl_mvm_remove_sta_key()
3601 ret = __iwl_mvm_remove_sta_key(mvm, sta_id, keyconf, mcast); in iwl_mvm_remove_sta_key()
3608 ret = __iwl_mvm_remove_sta_key(mvm, sta_id, keyconf, !mcast); in iwl_mvm_remove_sta_key()
3613 void iwl_mvm_update_tkip_key(struct iwl_mvm *mvm, in iwl_mvm_update_tkip_key() argument
3625 mvm_sta = iwl_mvm_get_key_sta(mvm, vif, sta); in iwl_mvm_update_tkip_key()
3628 iwl_mvm_send_sta_key(mvm, mvm_sta->sta_id, keyconf, mcast, in iwl_mvm_update_tkip_key()
3636 void iwl_mvm_sta_modify_ps_wake(struct iwl_mvm *mvm, in iwl_mvm_sta_modify_ps_wake() argument
3648 ret = iwl_mvm_send_cmd_pdu(mvm, ADD_STA, CMD_ASYNC, in iwl_mvm_sta_modify_ps_wake()
3649 iwl_mvm_add_sta_cmd_size(mvm), &cmd); in iwl_mvm_sta_modify_ps_wake()
3651 IWL_ERR(mvm, "Failed to send ADD_STA command (%d)\n", ret); in iwl_mvm_sta_modify_ps_wake()
3654 void iwl_mvm_sta_modify_sleep_tx_count(struct iwl_mvm *mvm, in iwl_mvm_sta_modify_sleep_tx_count() argument
3696 n_queued = iwl_mvm_tid_queued(mvm, tid_data); in iwl_mvm_sta_modify_sleep_tx_count()
3728 iwl_trans_block_txq_ptrs(mvm->trans, true); in iwl_mvm_sta_modify_sleep_tx_count()
3730 ret = iwl_mvm_send_cmd_pdu(mvm, ADD_STA, in iwl_mvm_sta_modify_sleep_tx_count()
3732 iwl_mvm_add_sta_cmd_size(mvm), &cmd); in iwl_mvm_sta_modify_sleep_tx_count()
3734 IWL_ERR(mvm, "Failed to send ADD_STA command (%d)\n", ret); in iwl_mvm_sta_modify_sleep_tx_count()
3737 void iwl_mvm_rx_eosp_notif(struct iwl_mvm *mvm, in iwl_mvm_rx_eosp_notif() argument
3749 sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); in iwl_mvm_rx_eosp_notif()
3755 void iwl_mvm_sta_modify_disable_tx(struct iwl_mvm *mvm, in iwl_mvm_sta_modify_disable_tx() argument
3767 ret = iwl_mvm_send_cmd_pdu(mvm, ADD_STA, CMD_ASYNC, in iwl_mvm_sta_modify_disable_tx()
3768 iwl_mvm_add_sta_cmd_size(mvm), &cmd); in iwl_mvm_sta_modify_disable_tx()
3770 IWL_ERR(mvm, "Failed to send ADD_STA command (%d)\n", ret); in iwl_mvm_sta_modify_disable_tx()
3773 void iwl_mvm_sta_modify_disable_tx_ap(struct iwl_mvm *mvm, in iwl_mvm_sta_modify_disable_tx_ap() argument
3789 ieee80211_sta_block_awake(mvm->hw, sta, disable); in iwl_mvm_sta_modify_disable_tx_ap()
3791 iwl_mvm_sta_modify_disable_tx(mvm, mvm_sta, disable); in iwl_mvm_sta_modify_disable_tx_ap()
3796 static void iwl_mvm_int_sta_modify_disable_tx(struct iwl_mvm *mvm, in iwl_mvm_int_sta_modify_disable_tx() argument
3811 ret = iwl_mvm_send_cmd_pdu(mvm, ADD_STA, 0, in iwl_mvm_int_sta_modify_disable_tx()
3812 iwl_mvm_add_sta_cmd_size(mvm), &cmd); in iwl_mvm_int_sta_modify_disable_tx()
3814 IWL_ERR(mvm, "Failed to send ADD_STA command (%d)\n", ret); in iwl_mvm_int_sta_modify_disable_tx()
3817 void iwl_mvm_modify_all_sta_disable_tx(struct iwl_mvm *mvm, in iwl_mvm_modify_all_sta_disable_tx() argument
3825 lockdep_assert_held(&mvm->mutex); in iwl_mvm_modify_all_sta_disable_tx()
3828 for (i = 0; i < ARRAY_SIZE(mvm->fw_id_to_mac_id); i++) { in iwl_mvm_modify_all_sta_disable_tx()
3829 sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[i], in iwl_mvm_modify_all_sta_disable_tx()
3830 lockdep_is_held(&mvm->mutex)); in iwl_mvm_modify_all_sta_disable_tx()
3839 iwl_mvm_sta_modify_disable_tx_ap(mvm, sta, disable); in iwl_mvm_modify_all_sta_disable_tx()
3842 if (!fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_STA_TYPE)) in iwl_mvm_modify_all_sta_disable_tx()
3847 iwl_mvm_int_sta_modify_disable_tx(mvm, mvmvif, in iwl_mvm_modify_all_sta_disable_tx()
3855 iwl_mvm_int_sta_modify_disable_tx(mvm, mvmvif, in iwl_mvm_modify_all_sta_disable_tx()
3859 void iwl_mvm_csa_client_absent(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_csa_client_absent() argument
3866 mvmsta = iwl_mvm_sta_from_staid_rcu(mvm, mvmvif->ap_sta_id); in iwl_mvm_csa_client_absent()
3869 iwl_mvm_sta_modify_disable_tx(mvm, mvmsta, true); in iwl_mvm_csa_client_absent()
3874 u16 iwl_mvm_tid_queued(struct iwl_mvm *mvm, struct iwl_mvm_tid_data *tid_data) in iwl_mvm_tid_queued() argument
3882 if (mvm->trans->trans_cfg->gen2) in iwl_mvm_tid_queued()