Lines Matching refs:mvm
71 static int iwl_mvm_find_free_sta_id(struct iwl_mvm *mvm, in iwl_mvm_find_free_sta_id() argument
78 WARN_ON_ONCE(test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)); in iwl_mvm_find_free_sta_id()
80 lockdep_assert_held(&mvm->mutex); in iwl_mvm_find_free_sta_id()
91 if (!rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id], in iwl_mvm_find_free_sta_id()
92 lockdep_is_held(&mvm->mutex))) in iwl_mvm_find_free_sta_id()
99 int iwl_mvm_sta_send_to_fw(struct iwl_mvm *mvm, struct ieee80211_sta *sta, in iwl_mvm_sta_send_to_fw() argument
189 ret = iwl_mvm_send_cmd_pdu_status(mvm, ADD_STA, sizeof(add_sta_cmd), in iwl_mvm_sta_send_to_fw()
196 IWL_DEBUG_ASSOC(mvm, "ADD_STA PASSED\n"); in iwl_mvm_sta_send_to_fw()
200 IWL_ERR(mvm, "ADD_STA failed\n"); in iwl_mvm_sta_send_to_fw()
207 static int iwl_mvm_tdls_sta_init(struct iwl_mvm *mvm, in iwl_mvm_tdls_sta_init() argument
213 iwl_mvm_get_wd_timeout(mvm, NULL, true, false); in iwl_mvm_tdls_sta_init()
216 lockdep_assert_held(&mvm->mutex); in iwl_mvm_tdls_sta_init()
218 used_hw_queues = iwl_mvm_get_used_hw_queues(mvm, NULL); in iwl_mvm_tdls_sta_init()
223 mvm->first_agg_queue); in iwl_mvm_tdls_sta_init()
225 if (queue >= mvm->first_agg_queue) { in iwl_mvm_tdls_sta_init()
226 IWL_ERR(mvm, "Failed to allocate STA queue\n"); in iwl_mvm_tdls_sta_init()
236 iwl_mvm_enable_ac_txq(mvm, mvmsta->hw_queue[ac], in iwl_mvm_tdls_sta_init()
244 static void iwl_mvm_tdls_sta_deinit(struct iwl_mvm *mvm, in iwl_mvm_tdls_sta_deinit() argument
251 lockdep_assert_held(&mvm->mutex); in iwl_mvm_tdls_sta_deinit()
256 iwl_mvm_disable_txq(mvm, i, 0); in iwl_mvm_tdls_sta_deinit()
259 int iwl_mvm_add_sta(struct iwl_mvm *mvm, in iwl_mvm_add_sta() argument
267 lockdep_assert_held(&mvm->mutex); in iwl_mvm_add_sta()
269 if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) in iwl_mvm_add_sta()
270 sta_id = iwl_mvm_find_free_sta_id(mvm, in iwl_mvm_add_sta()
289 atomic_set(&mvm->pending_frames[sta_id], 0); in iwl_mvm_add_sta()
295 ret = iwl_mvm_tdls_sta_init(mvm, sta); in iwl_mvm_add_sta()
312 ret = iwl_mvm_sta_send_to_fw(mvm, sta, false); in iwl_mvm_add_sta()
325 rcu_assign_pointer(mvm->fw_id_to_mac_id[sta_id], sta); in iwl_mvm_add_sta()
330 iwl_mvm_tdls_sta_deinit(mvm, sta); in iwl_mvm_add_sta()
334 int iwl_mvm_update_sta(struct iwl_mvm *mvm, in iwl_mvm_update_sta() argument
338 return iwl_mvm_sta_send_to_fw(mvm, sta, true); in iwl_mvm_update_sta()
341 int iwl_mvm_drain_sta(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, in iwl_mvm_drain_sta() argument
348 lockdep_assert_held(&mvm->mutex); in iwl_mvm_drain_sta()
357 ret = iwl_mvm_send_cmd_pdu_status(mvm, ADD_STA, sizeof(cmd), in iwl_mvm_drain_sta()
364 IWL_DEBUG_INFO(mvm, "Frames for staid %d will drained in fw\n", in iwl_mvm_drain_sta()
369 IWL_ERR(mvm, "Couldn't drain frames for staid %d\n", in iwl_mvm_drain_sta()
382 static int iwl_mvm_rm_sta_common(struct iwl_mvm *mvm, u8 sta_id) in iwl_mvm_rm_sta_common() argument
390 sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id], in iwl_mvm_rm_sta_common()
391 lockdep_is_held(&mvm->mutex)); in iwl_mvm_rm_sta_common()
395 IWL_ERR(mvm, "Invalid station id\n"); in iwl_mvm_rm_sta_common()
399 ret = iwl_mvm_send_cmd_pdu(mvm, REMOVE_STA, 0, in iwl_mvm_rm_sta_common()
402 IWL_ERR(mvm, "Failed to remove station. Id=%d\n", sta_id); in iwl_mvm_rm_sta_common()
411 struct iwl_mvm *mvm = container_of(wk, struct iwl_mvm, sta_drained_wk); in iwl_mvm_sta_drained_wk() local
421 mutex_lock(&mvm->mutex); in iwl_mvm_sta_drained_wk()
423 for_each_set_bit(sta_id, mvm->sta_drained, IWL_MVM_STATION_COUNT) { in iwl_mvm_sta_drained_wk()
426 rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id], in iwl_mvm_sta_drained_wk()
427 lockdep_is_held(&mvm->mutex)); in iwl_mvm_sta_drained_wk()
441 IWL_ERR(mvm, "Drained sta %d, but it is internal?\n", in iwl_mvm_sta_drained_wk()
447 IWL_ERR(mvm, "Drained sta %d, but it was NULL?\n", in iwl_mvm_sta_drained_wk()
456 ret = iwl_mvm_rm_sta_common(mvm, sta_id); in iwl_mvm_sta_drained_wk()
458 IWL_ERR(mvm, in iwl_mvm_sta_drained_wk()
463 RCU_INIT_POINTER(mvm->fw_id_to_mac_id[sta_id], NULL); in iwl_mvm_sta_drained_wk()
464 clear_bit(sta_id, mvm->sta_drained); in iwl_mvm_sta_drained_wk()
466 if (mvm->tfd_drained[sta_id]) { in iwl_mvm_sta_drained_wk()
467 unsigned long i, msk = mvm->tfd_drained[sta_id]; in iwl_mvm_sta_drained_wk()
470 iwl_mvm_disable_txq(mvm, i, 0); in iwl_mvm_sta_drained_wk()
472 mvm->tfd_drained[sta_id] = 0; in iwl_mvm_sta_drained_wk()
473 IWL_DEBUG_TDLS(mvm, "Drained sta %d, with queues %ld\n", in iwl_mvm_sta_drained_wk()
478 mutex_unlock(&mvm->mutex); in iwl_mvm_sta_drained_wk()
481 int iwl_mvm_rm_sta(struct iwl_mvm *mvm, in iwl_mvm_rm_sta() argument
489 lockdep_assert_held(&mvm->mutex); in iwl_mvm_rm_sta()
493 ret = iwl_mvm_drain_sta(mvm, mvm_sta, true); in iwl_mvm_rm_sta()
497 ret = iwl_mvm_flush_tx_path(mvm, mvm_sta->tfd_queue_msk, true); in iwl_mvm_rm_sta()
500 ret = iwl_trans_wait_tx_queue_empty(mvm->trans, in iwl_mvm_rm_sta()
504 ret = iwl_mvm_drain_sta(mvm, mvm_sta, false); in iwl_mvm_rm_sta()
514 if (mvm->d0i3_ap_sta_id == mvm_sta->sta_id) in iwl_mvm_rm_sta()
515 mvm->d0i3_ap_sta_id = IWL_MVM_STATION_COUNT; in iwl_mvm_rm_sta()
522 if (WARN_ON_ONCE(mvm->tdls_cs.peer.sta_id == mvm_sta->sta_id)) { in iwl_mvm_rm_sta()
523 mvm->tdls_cs.peer.sta_id = IWL_MVM_STATION_COUNT; in iwl_mvm_rm_sta()
524 cancel_delayed_work(&mvm->tdls_cs.dwork); in iwl_mvm_rm_sta()
536 if (atomic_read(&mvm->pending_frames[mvm_sta->sta_id])) { in iwl_mvm_rm_sta()
537 rcu_assign_pointer(mvm->fw_id_to_mac_id[mvm_sta->sta_id], in iwl_mvm_rm_sta()
543 mvm->tfd_drained[mvm_sta->sta_id] = in iwl_mvm_rm_sta()
545 IWL_DEBUG_TDLS(mvm, "Draining TDLS sta %d\n", in iwl_mvm_rm_sta()
549 ret = iwl_mvm_drain_sta(mvm, mvm_sta, true); in iwl_mvm_rm_sta()
554 iwl_mvm_tdls_sta_deinit(mvm, sta); in iwl_mvm_rm_sta()
556 ret = iwl_mvm_rm_sta_common(mvm, mvm_sta->sta_id); in iwl_mvm_rm_sta()
557 RCU_INIT_POINTER(mvm->fw_id_to_mac_id[mvm_sta->sta_id], NULL); in iwl_mvm_rm_sta()
563 int iwl_mvm_rm_sta_id(struct iwl_mvm *mvm, in iwl_mvm_rm_sta_id() argument
567 int ret = iwl_mvm_rm_sta_common(mvm, sta_id); in iwl_mvm_rm_sta_id()
569 lockdep_assert_held(&mvm->mutex); in iwl_mvm_rm_sta_id()
571 RCU_INIT_POINTER(mvm->fw_id_to_mac_id[sta_id], NULL); in iwl_mvm_rm_sta_id()
575 static int iwl_mvm_allocate_int_sta(struct iwl_mvm *mvm, in iwl_mvm_allocate_int_sta() argument
579 if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { in iwl_mvm_allocate_int_sta()
580 sta->sta_id = iwl_mvm_find_free_sta_id(mvm, iftype); in iwl_mvm_allocate_int_sta()
588 rcu_assign_pointer(mvm->fw_id_to_mac_id[sta->sta_id], ERR_PTR(-EINVAL)); in iwl_mvm_allocate_int_sta()
592 static void iwl_mvm_dealloc_int_sta(struct iwl_mvm *mvm, in iwl_mvm_dealloc_int_sta() argument
595 RCU_INIT_POINTER(mvm->fw_id_to_mac_id[sta->sta_id], NULL); in iwl_mvm_dealloc_int_sta()
600 static int iwl_mvm_add_int_sta_common(struct iwl_mvm *mvm, in iwl_mvm_add_int_sta_common() argument
609 lockdep_assert_held(&mvm->mutex); in iwl_mvm_add_int_sta_common()
621 ret = iwl_mvm_send_cmd_pdu_status(mvm, ADD_STA, sizeof(cmd), in iwl_mvm_add_int_sta_common()
628 IWL_DEBUG_INFO(mvm, "Internal station added.\n"); in iwl_mvm_add_int_sta_common()
632 IWL_ERR(mvm, "Add internal station failed, status=0x%x\n", in iwl_mvm_add_int_sta_common()
639 int iwl_mvm_add_aux_sta(struct iwl_mvm *mvm) in iwl_mvm_add_aux_sta() argument
642 mvm->cfg->base_params->wd_timeout : in iwl_mvm_add_aux_sta()
646 lockdep_assert_held(&mvm->mutex); in iwl_mvm_add_aux_sta()
649 iwl_mvm_enable_ac_txq(mvm, mvm->aux_queue, in iwl_mvm_add_aux_sta()
653 ret = iwl_mvm_allocate_int_sta(mvm, &mvm->aux_sta, BIT(mvm->aux_queue), in iwl_mvm_add_aux_sta()
658 ret = iwl_mvm_add_int_sta_common(mvm, &mvm->aux_sta, NULL, in iwl_mvm_add_aux_sta()
662 iwl_mvm_dealloc_int_sta(mvm, &mvm->aux_sta); in iwl_mvm_add_aux_sta()
666 void iwl_mvm_del_aux_sta(struct iwl_mvm *mvm) in iwl_mvm_del_aux_sta() argument
668 lockdep_assert_held(&mvm->mutex); in iwl_mvm_del_aux_sta()
670 iwl_mvm_dealloc_int_sta(mvm, &mvm->aux_sta); in iwl_mvm_del_aux_sta()
681 int iwl_mvm_send_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_send_add_bcast_sta() argument
688 lockdep_assert_held(&mvm->mutex); in iwl_mvm_send_add_bcast_sta()
696 return iwl_mvm_add_int_sta_common(mvm, bsta, baddr, in iwl_mvm_send_add_bcast_sta()
702 int iwl_mvm_send_rm_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_send_rm_bcast_sta() argument
707 lockdep_assert_held(&mvm->mutex); in iwl_mvm_send_rm_bcast_sta()
709 ret = iwl_mvm_rm_sta_common(mvm, mvmvif->bcast_sta.sta_id); in iwl_mvm_send_rm_bcast_sta()
711 IWL_WARN(mvm, "Failed sending remove station\n"); in iwl_mvm_send_rm_bcast_sta()
715 int iwl_mvm_alloc_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_alloc_bcast_sta() argument
720 lockdep_assert_held(&mvm->mutex); in iwl_mvm_alloc_bcast_sta()
732 return iwl_mvm_allocate_int_sta(mvm, &mvmvif->bcast_sta, qmask, in iwl_mvm_alloc_bcast_sta()
743 int iwl_mvm_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_add_bcast_sta() argument
749 lockdep_assert_held(&mvm->mutex); in iwl_mvm_add_bcast_sta()
751 ret = iwl_mvm_alloc_bcast_sta(mvm, vif); in iwl_mvm_add_bcast_sta()
755 ret = iwl_mvm_send_add_bcast_sta(mvm, vif); in iwl_mvm_add_bcast_sta()
758 iwl_mvm_dealloc_int_sta(mvm, bsta); in iwl_mvm_add_bcast_sta()
763 void iwl_mvm_dealloc_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_dealloc_bcast_sta() argument
767 iwl_mvm_dealloc_int_sta(mvm, &mvmvif->bcast_sta); in iwl_mvm_dealloc_bcast_sta()
774 int iwl_mvm_rm_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_rm_bcast_sta() argument
778 lockdep_assert_held(&mvm->mutex); in iwl_mvm_rm_bcast_sta()
780 ret = iwl_mvm_send_rm_bcast_sta(mvm, vif); in iwl_mvm_rm_bcast_sta()
782 iwl_mvm_dealloc_bcast_sta(mvm, vif); in iwl_mvm_rm_bcast_sta()
789 int iwl_mvm_sta_rx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta, in iwl_mvm_sta_rx_agg() argument
797 lockdep_assert_held(&mvm->mutex); in iwl_mvm_sta_rx_agg()
799 if (start && mvm->rx_ba_sessions >= IWL_MAX_RX_BA_SESSIONS) { in iwl_mvm_sta_rx_agg()
800 IWL_WARN(mvm, "Not enough RX BA SESSIONS\n"); in iwl_mvm_sta_rx_agg()
817 ret = iwl_mvm_send_cmd_pdu_status(mvm, ADD_STA, sizeof(cmd), in iwl_mvm_sta_rx_agg()
824 IWL_DEBUG_INFO(mvm, "RX BA Session %sed in fw\n", in iwl_mvm_sta_rx_agg()
828 IWL_WARN(mvm, "RX BA Session refused by fw\n"); in iwl_mvm_sta_rx_agg()
833 IWL_ERR(mvm, "RX BA Session failed %sing, status 0x%x\n", in iwl_mvm_sta_rx_agg()
840 mvm->rx_ba_sessions++; in iwl_mvm_sta_rx_agg()
841 else if (mvm->rx_ba_sessions > 0) in iwl_mvm_sta_rx_agg()
843 mvm->rx_ba_sessions--; in iwl_mvm_sta_rx_agg()
849 static int iwl_mvm_sta_tx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta, in iwl_mvm_sta_tx_agg() argument
857 lockdep_assert_held(&mvm->mutex); in iwl_mvm_sta_tx_agg()
875 ret = iwl_mvm_send_cmd_pdu_status(mvm, ADD_STA, sizeof(cmd), in iwl_mvm_sta_tx_agg()
885 IWL_ERR(mvm, "TX BA Session failed %sing, status 0x%x\n", in iwl_mvm_sta_tx_agg()
915 int iwl_mvm_sta_tx_agg_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_sta_tx_agg_start() argument
926 IWL_ERR(mvm, "Start AGG when state is not IWL_AGG_OFF %d!\n", in iwl_mvm_sta_tx_agg_start()
931 lockdep_assert_held(&mvm->mutex); in iwl_mvm_sta_tx_agg_start()
933 for (txq_id = mvm->first_agg_queue; in iwl_mvm_sta_tx_agg_start()
934 txq_id <= mvm->last_agg_queue; txq_id++) in iwl_mvm_sta_tx_agg_start()
935 if (mvm->queue_to_mac80211[txq_id] == in iwl_mvm_sta_tx_agg_start()
939 if (txq_id > mvm->last_agg_queue) { in iwl_mvm_sta_tx_agg_start()
940 IWL_ERR(mvm, "Failed to allocate agg queue\n"); in iwl_mvm_sta_tx_agg_start()
947 if (test_bit(IWL_MVM_STATUS_IN_D0I3, &mvm->status)) { in iwl_mvm_sta_tx_agg_start()
949 IWL_ERR(mvm, "Entered D0i3 while starting Tx agg\n"); in iwl_mvm_sta_tx_agg_start()
954 mvm->queue_to_mac80211[txq_id] = vif->hw_queue[tid_to_mac80211_ac[tid]]; in iwl_mvm_sta_tx_agg_start()
961 IWL_DEBUG_TX_QUEUES(mvm, in iwl_mvm_sta_tx_agg_start()
978 int iwl_mvm_sta_tx_agg_oper(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_sta_tx_agg_oper() argument
984 iwl_mvm_get_wd_timeout(mvm, vif, sta->tdls, false); in iwl_mvm_sta_tx_agg_oper()
1003 ret = iwl_mvm_sta_tx_agg(mvm, sta, tid, queue, true); in iwl_mvm_sta_tx_agg_oper()
1007 iwl_mvm_enable_agg_txq(mvm, queue, fifo, mvmsta->sta_id, tid, in iwl_mvm_sta_tx_agg_oper()
1021 IWL_DEBUG_HT(mvm, "Tx aggregation enabled on ra = %pM tid = %d\n", in iwl_mvm_sta_tx_agg_oper()
1024 return iwl_mvm_send_lq_cmd(mvm, &mvmsta->lq_sta.lq, false); in iwl_mvm_sta_tx_agg_oper()
1027 int iwl_mvm_sta_tx_agg_stop(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_sta_tx_agg_stop() argument
1040 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { in iwl_mvm_sta_tx_agg_stop()
1049 IWL_DEBUG_TX_QUEUES(mvm, "Stop AGG: sta %d tid %d q %d state %d\n", in iwl_mvm_sta_tx_agg_stop()
1058 IWL_DEBUG_TX_QUEUES(mvm, in iwl_mvm_sta_tx_agg_stop()
1071 mvm->queue_to_mac80211[txq_id] = IWL_INVALID_MAC80211_QUEUE; in iwl_mvm_sta_tx_agg_stop()
1076 iwl_mvm_sta_tx_agg(mvm, sta, tid, txq_id, false); in iwl_mvm_sta_tx_agg_stop()
1078 iwl_mvm_disable_txq(mvm, txq_id, 0); in iwl_mvm_sta_tx_agg_stop()
1088 lockdep_assert_held(&mvm->mutex); in iwl_mvm_sta_tx_agg_stop()
1089 mvm->queue_to_mac80211[txq_id] = IWL_INVALID_MAC80211_QUEUE; in iwl_mvm_sta_tx_agg_stop()
1096 IWL_ERR(mvm, in iwl_mvm_sta_tx_agg_stop()
1099 IWL_ERR(mvm, in iwl_mvm_sta_tx_agg_stop()
1109 int iwl_mvm_sta_tx_agg_flush(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_sta_tx_agg_flush() argument
1123 IWL_DEBUG_TX_QUEUES(mvm, "Flush AGG: sta %d tid %d q %d state %d\n", in iwl_mvm_sta_tx_agg_flush()
1131 iwl_mvm_drain_sta(mvm, mvmsta, true); in iwl_mvm_sta_tx_agg_flush()
1132 if (iwl_mvm_flush_tx_path(mvm, BIT(txq_id), true)) in iwl_mvm_sta_tx_agg_flush()
1133 IWL_ERR(mvm, "Couldn't flush the AGG queue\n"); in iwl_mvm_sta_tx_agg_flush()
1134 iwl_trans_wait_tx_queue_empty(mvm->trans, in iwl_mvm_sta_tx_agg_flush()
1136 iwl_mvm_drain_sta(mvm, mvmsta, false); in iwl_mvm_sta_tx_agg_flush()
1138 iwl_mvm_sta_tx_agg(mvm, sta, tid, txq_id, false); in iwl_mvm_sta_tx_agg_flush()
1140 iwl_mvm_disable_txq(mvm, tid_data->txq_id, 0); in iwl_mvm_sta_tx_agg_flush()
1143 mvm->queue_to_mac80211[tid_data->txq_id] = in iwl_mvm_sta_tx_agg_flush()
1149 static int iwl_mvm_set_fw_key_idx(struct iwl_mvm *mvm) in iwl_mvm_set_fw_key_idx() argument
1153 lockdep_assert_held(&mvm->mutex); in iwl_mvm_set_fw_key_idx()
1155 i = find_first_zero_bit(mvm->fw_key_table, STA_KEY_MAX_NUM); in iwl_mvm_set_fw_key_idx()
1160 __set_bit(i, mvm->fw_key_table); in iwl_mvm_set_fw_key_idx()
1188 static int iwl_mvm_send_sta_key(struct iwl_mvm *mvm, in iwl_mvm_send_sta_key() argument
1239 ret = iwl_mvm_send_cmd_pdu(mvm, ADD_STA_KEY, CMD_ASYNC, in iwl_mvm_send_sta_key()
1242 ret = iwl_mvm_send_cmd_pdu_status(mvm, ADD_STA_KEY, sizeof(cmd), in iwl_mvm_send_sta_key()
1247 IWL_DEBUG_WEP(mvm, "MODIFY_STA: set dynamic key passed\n"); in iwl_mvm_send_sta_key()
1251 IWL_ERR(mvm, "MODIFY_STA: set dynamic key failed\n"); in iwl_mvm_send_sta_key()
1258 static int iwl_mvm_send_sta_igtk(struct iwl_mvm *mvm, in iwl_mvm_send_sta_igtk() argument
1292 IWL_DEBUG_INFO(mvm, "%s igtk for sta %u\n", in iwl_mvm_send_sta_igtk()
1296 return iwl_mvm_send_cmd_pdu(mvm, MGMT_MCAST_KEY, 0, in iwl_mvm_send_sta_igtk()
1301 static inline u8 *iwl_mvm_get_mac_addr(struct iwl_mvm *mvm, in iwl_mvm_get_mac_addr() argument
1313 sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id], in iwl_mvm_get_mac_addr()
1314 lockdep_is_held(&mvm->mutex)); in iwl_mvm_get_mac_addr()
1322 static int __iwl_mvm_set_sta_key(struct iwl_mvm *mvm, in __iwl_mvm_set_sta_key() argument
1336 addr = iwl_mvm_get_mac_addr(mvm, vif, sta); in __iwl_mvm_set_sta_key()
1340 ret = iwl_mvm_send_sta_key(mvm, mvm_sta, keyconf, mcast, in __iwl_mvm_set_sta_key()
1346 ret = iwl_mvm_send_sta_key(mvm, mvm_sta, keyconf, mcast, in __iwl_mvm_set_sta_key()
1350 ret = iwl_mvm_send_sta_key(mvm, mvm_sta, keyconf, mcast, in __iwl_mvm_set_sta_key()
1357 static int __iwl_mvm_remove_sta_key(struct iwl_mvm *mvm, u8 sta_id, in __iwl_mvm_remove_sta_key() argument
1379 ret = iwl_mvm_send_cmd_pdu_status(mvm, ADD_STA_KEY, sizeof(cmd), in __iwl_mvm_remove_sta_key()
1384 IWL_DEBUG_WEP(mvm, "MODIFY_STA: remove sta key passed\n"); in __iwl_mvm_remove_sta_key()
1388 IWL_ERR(mvm, "MODIFY_STA: remove sta key failed\n"); in __iwl_mvm_remove_sta_key()
1395 int iwl_mvm_set_sta_key(struct iwl_mvm *mvm, in iwl_mvm_set_sta_key() argument
1405 lockdep_assert_held(&mvm->mutex); in iwl_mvm_set_sta_key()
1410 IWL_ERR(mvm, "Failed to find station id\n"); in iwl_mvm_set_sta_key()
1415 ret = iwl_mvm_send_sta_igtk(mvm, keyconf, sta_id, false); in iwl_mvm_set_sta_key()
1424 sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id], in iwl_mvm_set_sta_key()
1425 lockdep_is_held(&mvm->mutex)); in iwl_mvm_set_sta_key()
1427 IWL_ERR(mvm, "Invalid station id\n"); in iwl_mvm_set_sta_key()
1441 keyconf->hw_key_idx = iwl_mvm_set_fw_key_idx(mvm); in iwl_mvm_set_sta_key()
1446 ret = __iwl_mvm_set_sta_key(mvm, vif, sta, keyconf, mcast); in iwl_mvm_set_sta_key()
1448 __clear_bit(keyconf->hw_key_idx, mvm->fw_key_table); in iwl_mvm_set_sta_key()
1460 ret = __iwl_mvm_set_sta_key(mvm, vif, sta, keyconf, !mcast); in iwl_mvm_set_sta_key()
1462 __clear_bit(keyconf->hw_key_idx, mvm->fw_key_table); in iwl_mvm_set_sta_key()
1463 __iwl_mvm_remove_sta_key(mvm, sta_id, keyconf, mcast); in iwl_mvm_set_sta_key()
1468 IWL_DEBUG_WEP(mvm, "key: cipher=%x len=%d idx=%d sta=%pM ret=%d\n", in iwl_mvm_set_sta_key()
1474 int iwl_mvm_remove_sta_key(struct iwl_mvm *mvm, in iwl_mvm_remove_sta_key() argument
1483 lockdep_assert_held(&mvm->mutex); in iwl_mvm_remove_sta_key()
1488 IWL_DEBUG_WEP(mvm, "mvm remove dynamic key: idx=%d sta=%d\n", in iwl_mvm_remove_sta_key()
1492 return iwl_mvm_send_sta_igtk(mvm, keyconf, sta_id, true); in iwl_mvm_remove_sta_key()
1494 if (!__test_and_clear_bit(keyconf->hw_key_idx, mvm->fw_key_table)) { in iwl_mvm_remove_sta_key()
1495 IWL_ERR(mvm, "offset %d not used in fw key table.\n", in iwl_mvm_remove_sta_key()
1501 IWL_DEBUG_WEP(mvm, "station non-existent, early return.\n"); in iwl_mvm_remove_sta_key()
1512 sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id], in iwl_mvm_remove_sta_key()
1513 lockdep_is_held(&mvm->mutex)); in iwl_mvm_remove_sta_key()
1515 IWL_ERR(mvm, "Invalid station id\n"); in iwl_mvm_remove_sta_key()
1523 ret = __iwl_mvm_remove_sta_key(mvm, sta_id, keyconf, mcast); in iwl_mvm_remove_sta_key()
1530 ret = __iwl_mvm_remove_sta_key(mvm, sta_id, keyconf, !mcast); in iwl_mvm_remove_sta_key()
1535 void iwl_mvm_update_tkip_key(struct iwl_mvm *mvm, in iwl_mvm_update_tkip_key() argument
1551 sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); in iwl_mvm_update_tkip_key()
1559 iwl_mvm_send_sta_key(mvm, mvm_sta, keyconf, mcast, in iwl_mvm_update_tkip_key()
1564 void iwl_mvm_sta_modify_ps_wake(struct iwl_mvm *mvm, in iwl_mvm_sta_modify_ps_wake() argument
1576 ret = iwl_mvm_send_cmd_pdu(mvm, ADD_STA, CMD_ASYNC, sizeof(cmd), &cmd); in iwl_mvm_sta_modify_ps_wake()
1578 IWL_ERR(mvm, "Failed to send ADD_STA command (%d)\n", ret); in iwl_mvm_sta_modify_ps_wake()
1581 void iwl_mvm_sta_modify_sleep_tx_count(struct iwl_mvm *mvm, in iwl_mvm_sta_modify_sleep_tx_count() argument
1658 ret = iwl_mvm_send_cmd_pdu(mvm, ADD_STA, CMD_ASYNC, sizeof(cmd), &cmd); in iwl_mvm_sta_modify_sleep_tx_count()
1660 IWL_ERR(mvm, "Failed to send ADD_STA command (%d)\n", ret); in iwl_mvm_sta_modify_sleep_tx_count()
1663 int iwl_mvm_rx_eosp_notif(struct iwl_mvm *mvm, in iwl_mvm_rx_eosp_notif() argument
1676 sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); in iwl_mvm_rx_eosp_notif()
1684 void iwl_mvm_sta_modify_disable_tx(struct iwl_mvm *mvm, in iwl_mvm_sta_modify_disable_tx() argument
1696 ret = iwl_mvm_send_cmd_pdu(mvm, ADD_STA, CMD_ASYNC, sizeof(cmd), &cmd); in iwl_mvm_sta_modify_disable_tx()
1698 IWL_ERR(mvm, "Failed to send ADD_STA command (%d)\n", ret); in iwl_mvm_sta_modify_disable_tx()
1701 void iwl_mvm_sta_modify_disable_tx_ap(struct iwl_mvm *mvm, in iwl_mvm_sta_modify_disable_tx_ap() argument
1721 if (disable || !atomic_read(&mvm->pending_frames[mvm_sta->sta_id])) in iwl_mvm_sta_modify_disable_tx_ap()
1722 ieee80211_sta_block_awake(mvm->hw, sta, disable); in iwl_mvm_sta_modify_disable_tx_ap()
1724 iwl_mvm_sta_modify_disable_tx(mvm, mvm_sta, disable); in iwl_mvm_sta_modify_disable_tx_ap()
1729 void iwl_mvm_modify_all_sta_disable_tx(struct iwl_mvm *mvm, in iwl_mvm_modify_all_sta_disable_tx() argument
1737 lockdep_assert_held(&mvm->mutex); in iwl_mvm_modify_all_sta_disable_tx()
1741 sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[i], in iwl_mvm_modify_all_sta_disable_tx()
1742 lockdep_is_held(&mvm->mutex)); in iwl_mvm_modify_all_sta_disable_tx()
1751 iwl_mvm_sta_modify_disable_tx_ap(mvm, sta, disable); in iwl_mvm_modify_all_sta_disable_tx()
1755 void iwl_mvm_csa_client_absent(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_csa_client_absent() argument
1762 mvmsta = iwl_mvm_sta_from_staid_rcu(mvm, mvmvif->ap_sta_id); in iwl_mvm_csa_client_absent()
1765 iwl_mvm_sta_modify_disable_tx(mvm, mvmsta, true); in iwl_mvm_csa_client_absent()