Lines Matching refs:mvm
216 static void iwl_mvm_reset_phy_ctxts(struct iwl_mvm *mvm) in iwl_mvm_reset_phy_ctxts() argument
220 memset(mvm->phy_ctxts, 0, sizeof(mvm->phy_ctxts)); in iwl_mvm_reset_phy_ctxts()
222 mvm->phy_ctxts[i].id = i; in iwl_mvm_reset_phy_ctxts()
223 mvm->phy_ctxts[i].ref = 0; in iwl_mvm_reset_phy_ctxts()
234 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_get_regdomain() local
237 IWL_DEBUG_LAR(mvm, "Getting regdomain data for %s from FW\n", alpha2); in iwl_mvm_get_regdomain()
239 lockdep_assert_held(&mvm->mutex); in iwl_mvm_get_regdomain()
241 resp = iwl_mvm_update_mcc(mvm, alpha2, src_id); in iwl_mvm_get_regdomain()
243 IWL_DEBUG_LAR(mvm, "Could not get update from FW %d\n", in iwl_mvm_get_regdomain()
255 regd = iwl_parse_nvm_mcc_info(mvm->trans->dev, mvm->cfg, in iwl_mvm_get_regdomain()
264 IWL_DEBUG_LAR(mvm, "Could not get parse update from FW %d\n", in iwl_mvm_get_regdomain()
269 IWL_DEBUG_LAR(mvm, "setting alpha2 from FW to %s (0x%x, 0x%x) src=%d\n", in iwl_mvm_get_regdomain()
271 mvm->lar_regdom_set = true; in iwl_mvm_get_regdomain()
272 mvm->mcc_src = src_id; in iwl_mvm_get_regdomain()
278 void iwl_mvm_update_changed_regdom(struct iwl_mvm *mvm) in iwl_mvm_update_changed_regdom() argument
283 if (!iwl_mvm_is_lar_supported(mvm)) in iwl_mvm_update_changed_regdom()
286 regd = iwl_mvm_get_current_regdomain(mvm, &changed); in iwl_mvm_update_changed_regdom()
290 regulatory_set_wiphy_regd(mvm->hw->wiphy, regd); in iwl_mvm_update_changed_regdom()
296 struct ieee80211_regdomain *iwl_mvm_get_current_regdomain(struct iwl_mvm *mvm, in iwl_mvm_get_current_regdomain() argument
299 return iwl_mvm_get_regdomain(mvm->hw->wiphy, "ZZ", in iwl_mvm_get_current_regdomain()
300 iwl_mvm_is_wifi_mcc_supported(mvm) ? in iwl_mvm_get_current_regdomain()
305 int iwl_mvm_init_fw_regd(struct iwl_mvm *mvm) in iwl_mvm_init_fw_regd() argument
312 rtnl_dereference(mvm->hw->wiphy->regd); in iwl_mvm_init_fw_regd()
318 used_src = mvm->mcc_src; in iwl_mvm_init_fw_regd()
319 if (iwl_mvm_is_wifi_mcc_supported(mvm)) { in iwl_mvm_init_fw_regd()
321 regd = iwl_mvm_get_current_regdomain(mvm, NULL); in iwl_mvm_init_fw_regd()
327 regd = iwl_mvm_get_regdomain(mvm->hw->wiphy, r->alpha2, used_src, in iwl_mvm_init_fw_regd()
334 ret = regulatory_set_wiphy_regd_sync_rtnl(mvm->hw->wiphy, regd); in iwl_mvm_init_fw_regd()
358 int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) in iwl_mvm_mac_setup_register() argument
360 struct ieee80211_hw *hw = mvm->hw; in iwl_mvm_mac_setup_register()
369 bool unified = fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
403 if (mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_9000) in iwl_mvm_mac_setup_register()
407 if (iwl_mvm_has_tlc_offload(mvm)) { in iwl_mvm_mac_setup_register()
412 if (iwl_mvm_has_new_rx_api(mvm)) in iwl_mvm_mac_setup_register()
415 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
418 } else if (WARN_ON(iwl_mvm_has_new_tx_api(mvm))) { in iwl_mvm_mac_setup_register()
427 if (mvm->trans->num_rx_queues > 1) in iwl_mvm_mac_setup_register()
430 if (mvm->trans->max_skb_frags) in iwl_mvm_mac_setup_register()
446 if (!iwl_mvm_has_tlc_offload(mvm)) in iwl_mvm_mac_setup_register()
451 hw->max_tx_fragments = mvm->trans->max_skb_frags; in iwl_mvm_mac_setup_register()
453 BUILD_BUG_ON(ARRAY_SIZE(mvm->ciphers) < ARRAY_SIZE(mvm_ciphers) + 6); in iwl_mvm_mac_setup_register()
454 memcpy(mvm->ciphers, mvm_ciphers, sizeof(mvm_ciphers)); in iwl_mvm_mac_setup_register()
456 hw->wiphy->cipher_suites = mvm->ciphers; in iwl_mvm_mac_setup_register()
458 if (iwl_mvm_has_new_rx_api(mvm)) { in iwl_mvm_mac_setup_register()
459 mvm->ciphers[hw->wiphy->n_cipher_suites] = in iwl_mvm_mac_setup_register()
462 mvm->ciphers[hw->wiphy->n_cipher_suites] = in iwl_mvm_mac_setup_register()
473 mvm->ciphers[hw->wiphy->n_cipher_suites] = in iwl_mvm_mac_setup_register()
476 if (iwl_mvm_has_new_rx_api(mvm)) { in iwl_mvm_mac_setup_register()
477 mvm->ciphers[hw->wiphy->n_cipher_suites] = in iwl_mvm_mac_setup_register()
480 mvm->ciphers[hw->wiphy->n_cipher_suites] = in iwl_mvm_mac_setup_register()
487 if (mvm->fw->cs[0].cipher) { in iwl_mvm_mac_setup_register()
488 const struct iwl_fw_cipher_scheme *fwcs = &mvm->fw->cs[0]; in iwl_mvm_mac_setup_register()
489 struct ieee80211_cipher_scheme *cs = &mvm->cs[0]; in iwl_mvm_mac_setup_register()
491 mvm->hw->n_cipher_schemes = 1; in iwl_mvm_mac_setup_register()
503 mvm->hw->cipher_schemes = mvm->cs; in iwl_mvm_mac_setup_register()
504 mvm->ciphers[hw->wiphy->n_cipher_suites] = cs->cipher; in iwl_mvm_mac_setup_register()
508 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
538 if (iwl_mvm_is_lar_supported(mvm)) in iwl_mvm_mac_setup_register()
555 memcpy(mvm->addresses[0].addr, mvm->nvm_data->hw_addr, ETH_ALEN); in iwl_mvm_mac_setup_register()
556 hw->wiphy->addresses = mvm->addresses; in iwl_mvm_mac_setup_register()
560 num_mac = (mvm->nvm_data->n_hw_addrs > 1) ? in iwl_mvm_mac_setup_register()
561 min(IWL_MVM_MAX_ADDRESSES, mvm->nvm_data->n_hw_addrs) : 1; in iwl_mvm_mac_setup_register()
564 memcpy(mvm->addresses[i].addr, mvm->addresses[i-1].addr, in iwl_mvm_mac_setup_register()
566 mvm->addresses[i].addr[5]++; in iwl_mvm_mac_setup_register()
570 iwl_mvm_reset_phy_ctxts(mvm); in iwl_mvm_mac_setup_register()
572 hw->wiphy->max_scan_ie_len = iwl_mvm_max_scan_ie_len(mvm); in iwl_mvm_mac_setup_register()
580 if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_UMAC_SCAN)) in iwl_mvm_mac_setup_register()
581 mvm->max_scans = IWL_MVM_MAX_UMAC_SCANS; in iwl_mvm_mac_setup_register()
583 mvm->max_scans = IWL_MVM_MAX_LMAC_SCANS; in iwl_mvm_mac_setup_register()
585 if (mvm->nvm_data->bands[NL80211_BAND_2GHZ].n_channels) in iwl_mvm_mac_setup_register()
587 &mvm->nvm_data->bands[NL80211_BAND_2GHZ]; in iwl_mvm_mac_setup_register()
588 if (mvm->nvm_data->bands[NL80211_BAND_5GHZ].n_channels) { in iwl_mvm_mac_setup_register()
590 &mvm->nvm_data->bands[NL80211_BAND_5GHZ]; in iwl_mvm_mac_setup_register()
592 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
594 fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
600 hw->wiphy->hw_version = mvm->trans->hw_id; in iwl_mvm_mac_setup_register()
630 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
633 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
637 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
642 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
646 if (fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
656 if (iwl_mvm_is_oce_supported(mvm)) { in iwl_mvm_mac_setup_register()
667 if (mvm->nvm_data->sku_cap_11ax_enable && in iwl_mvm_mac_setup_register()
677 mvm->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD; in iwl_mvm_mac_setup_register()
680 if ((unified || mvm->fw->img[IWL_UCODE_WOWLAN].num_sec) && in iwl_mvm_mac_setup_register()
681 mvm->trans->ops->d3_suspend && in iwl_mvm_mac_setup_register()
682 mvm->trans->ops->d3_resume && in iwl_mvm_mac_setup_register()
683 device_can_wakeup(mvm->trans->dev)) { in iwl_mvm_mac_setup_register()
684 mvm->wowlan.flags |= WIPHY_WOWLAN_MAGIC_PKT | in iwl_mvm_mac_setup_register()
690 mvm->wowlan.flags |= WIPHY_WOWLAN_SUPPORTS_GTK_REKEY | in iwl_mvm_mac_setup_register()
694 mvm->wowlan.n_patterns = IWL_WOWLAN_MAX_PATTERNS; in iwl_mvm_mac_setup_register()
695 mvm->wowlan.pattern_min_len = IWL_WOWLAN_MIN_PATTERN_LEN; in iwl_mvm_mac_setup_register()
696 mvm->wowlan.pattern_max_len = IWL_WOWLAN_MAX_PATTERN_LEN; in iwl_mvm_mac_setup_register()
697 mvm->wowlan.max_nd_match_sets = IWL_SCAN_MAX_PROFILES; in iwl_mvm_mac_setup_register()
698 hw->wiphy->wowlan = &mvm->wowlan; in iwl_mvm_mac_setup_register()
704 mvm->bcast_filters = iwl_mvm_default_bcast_filters; in iwl_mvm_mac_setup_register()
707 ret = iwl_mvm_leds_init(mvm); in iwl_mvm_mac_setup_register()
711 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
713 IWL_DEBUG_TDLS(mvm, "TDLS supported\n"); in iwl_mvm_mac_setup_register()
718 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
720 IWL_DEBUG_TDLS(mvm, "TDLS channel switch supported\n"); in iwl_mvm_mac_setup_register()
724 hw->netdev_features |= mvm->cfg->features; in iwl_mvm_mac_setup_register()
725 if (!iwl_mvm_is_csum_supported(mvm)) { in iwl_mvm_mac_setup_register()
733 if (mvm->cfg->vht_mu_mimo_supported) in iwl_mvm_mac_setup_register()
737 ret = ieee80211_register_hw(mvm->hw); in iwl_mvm_mac_setup_register()
739 iwl_mvm_leds_exit(mvm); in iwl_mvm_mac_setup_register()
749 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_tx() local
756 if (iwl_mvm_is_radio_killed(mvm)) { in iwl_mvm_mac_tx()
757 IWL_DEBUG_DROP(mvm, "Dropping - RF/CT KILL\n"); in iwl_mvm_mac_tx()
762 !test_bit(IWL_MVM_STATUS_ROC_RUNNING, &mvm->status) && in iwl_mvm_mac_tx()
763 !test_bit(IWL_MVM_STATUS_ROC_AUX_RUNNING, &mvm->status)) in iwl_mvm_mac_tx()
782 sta = rcu_dereference(mvm->fw_id_to_mac_id[ap_sta_id]); in iwl_mvm_mac_tx()
789 if (iwl_mvm_tx_skb(mvm, skb, sta)) in iwl_mvm_mac_tx()
794 if (iwl_mvm_tx_skb_non_sta(mvm, skb)) in iwl_mvm_mac_tx()
803 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_itxq_xmit() local
832 (mvm->trans->system_pm_mode == in iwl_mvm_mac_itxq_xmit()
838 IWL_DEBUG_TX(mvm, in iwl_mvm_mac_itxq_xmit()
846 iwl_mvm_tx_skb_non_sta(mvm, skb); in iwl_mvm_mac_itxq_xmit()
848 iwl_mvm_tx_skb(mvm, skb, txq->sta); in iwl_mvm_mac_itxq_xmit()
857 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_wake_tx_queue() local
894 list_add_tail(&mvmtxq->list, &mvm->add_stream_txqs); in iwl_mvm_mac_wake_tx_queue()
895 schedule_work(&mvm->add_stream_wk); in iwl_mvm_mac_wake_tx_queue()
906 iwl_mvm_ampdu_check_trigger(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_ampdu_check_trigger() argument
913 trig = iwl_fw_dbg_trigger_on(&mvm->fwrt, ieee80211_vif_to_wdev(vif), in iwl_mvm_ampdu_check_trigger()
925 CHECK_BA_TRIGGER(mvm, trig, ba_trig->tx_ba_start, tid, in iwl_mvm_ampdu_check_trigger()
931 CHECK_BA_TRIGGER(mvm, trig, ba_trig->tx_ba_stop, tid, in iwl_mvm_ampdu_check_trigger()
936 CHECK_BA_TRIGGER(mvm, trig, ba_trig->rx_ba_start, tid, in iwl_mvm_ampdu_check_trigger()
941 CHECK_BA_TRIGGER(mvm, trig, ba_trig->rx_ba_stop, tid, in iwl_mvm_ampdu_check_trigger()
954 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_ampdu_action() local
964 IWL_DEBUG_HT(mvm, "A-MPDU action on addr %pM tid %d: action %d\n", in iwl_mvm_mac_ampdu_action()
967 if (!(mvm->nvm_data->sku_cap_11n_enable)) in iwl_mvm_mac_ampdu_action()
970 mutex_lock(&mvm->mutex); in iwl_mvm_mac_ampdu_action()
978 struct iwl_mvm_tcm_mac *mdata = &mvm->tcm.data[macid]; in iwl_mvm_mac_ampdu_action()
988 ret = iwl_mvm_sta_rx_agg(mvm, sta, tid, *ssn, true, buf_size, in iwl_mvm_mac_ampdu_action()
992 ret = iwl_mvm_sta_rx_agg(mvm, sta, tid, 0, false, buf_size, in iwl_mvm_mac_ampdu_action()
1000 ret = iwl_mvm_sta_tx_agg_start(mvm, vif, sta, tid, ssn); in iwl_mvm_mac_ampdu_action()
1003 ret = iwl_mvm_sta_tx_agg_stop(mvm, vif, sta, tid); in iwl_mvm_mac_ampdu_action()
1007 ret = iwl_mvm_sta_tx_agg_flush(mvm, vif, sta, tid); in iwl_mvm_mac_ampdu_action()
1010 ret = iwl_mvm_sta_tx_agg_oper(mvm, vif, sta, tid, in iwl_mvm_mac_ampdu_action()
1025 iwl_mvm_ampdu_check_trigger(mvm, vif, sta, tid, in iwl_mvm_mac_ampdu_action()
1028 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_ampdu_action()
1036 struct iwl_mvm *mvm = data; in iwl_mvm_cleanup_iterator() local
1042 spin_lock_bh(&mvm->time_event_lock); in iwl_mvm_cleanup_iterator()
1043 iwl_mvm_te_clear_data(mvm, &mvmvif->time_event_data); in iwl_mvm_cleanup_iterator()
1044 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_cleanup_iterator()
1051 static void iwl_mvm_restart_cleanup(struct iwl_mvm *mvm) in iwl_mvm_restart_cleanup() argument
1053 iwl_mvm_stop_device(mvm); in iwl_mvm_restart_cleanup()
1055 mvm->cur_aid = 0; in iwl_mvm_restart_cleanup()
1057 mvm->scan_status = 0; in iwl_mvm_restart_cleanup()
1058 mvm->ps_disabled = false; in iwl_mvm_restart_cleanup()
1059 mvm->rfkill_safe_init_done = false; in iwl_mvm_restart_cleanup()
1062 iwl_mvm_cleanup_roc_te(mvm); in iwl_mvm_restart_cleanup()
1063 ieee80211_remain_on_channel_expired(mvm->hw); in iwl_mvm_restart_cleanup()
1065 iwl_mvm_ftm_restart(mvm); in iwl_mvm_restart_cleanup()
1071 ieee80211_iterate_interfaces(mvm->hw, 0, iwl_mvm_cleanup_iterator, mvm); in iwl_mvm_restart_cleanup()
1073 mvm->p2p_device_vif = NULL; in iwl_mvm_restart_cleanup()
1075 iwl_mvm_reset_phy_ctxts(mvm); in iwl_mvm_restart_cleanup()
1076 memset(mvm->fw_key_table, 0, sizeof(mvm->fw_key_table)); in iwl_mvm_restart_cleanup()
1077 memset(&mvm->last_bt_notif, 0, sizeof(mvm->last_bt_notif)); in iwl_mvm_restart_cleanup()
1078 memset(&mvm->last_bt_ci_cmd, 0, sizeof(mvm->last_bt_ci_cmd)); in iwl_mvm_restart_cleanup()
1080 ieee80211_wake_queues(mvm->hw); in iwl_mvm_restart_cleanup()
1082 mvm->vif_count = 0; in iwl_mvm_restart_cleanup()
1083 mvm->rx_ba_sessions = 0; in iwl_mvm_restart_cleanup()
1084 mvm->fwrt.dump.conf = FW_DBG_INVALID; in iwl_mvm_restart_cleanup()
1085 mvm->monitor_on = false; in iwl_mvm_restart_cleanup()
1088 iwl_mvm_accu_radio_stats(mvm); in iwl_mvm_restart_cleanup()
1091 int __iwl_mvm_mac_start(struct iwl_mvm *mvm) in __iwl_mvm_mac_start() argument
1095 lockdep_assert_held(&mvm->mutex); in __iwl_mvm_mac_start()
1097 if (test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status)) { in __iwl_mvm_mac_start()
1102 set_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status); in __iwl_mvm_mac_start()
1103 clear_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status); in __iwl_mvm_mac_start()
1105 iwl_mvm_restart_cleanup(mvm); in __iwl_mvm_mac_start()
1107 ret = iwl_mvm_up(mvm); in __iwl_mvm_mac_start()
1109 iwl_dbg_tlv_time_point(&mvm->fwrt, IWL_FW_INI_TIME_POINT_POST_INIT, in __iwl_mvm_mac_start()
1111 iwl_dbg_tlv_time_point(&mvm->fwrt, IWL_FW_INI_TIME_POINT_PERIODIC, in __iwl_mvm_mac_start()
1114 if (ret && test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { in __iwl_mvm_mac_start()
1119 clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status); in __iwl_mvm_mac_start()
1127 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_start() local
1130 mutex_lock(&mvm->mutex); in iwl_mvm_mac_start()
1131 ret = __iwl_mvm_mac_start(mvm); in iwl_mvm_mac_start()
1132 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_start()
1137 static void iwl_mvm_restart_complete(struct iwl_mvm *mvm) in iwl_mvm_restart_complete() argument
1141 mutex_lock(&mvm->mutex); in iwl_mvm_restart_complete()
1143 clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status); in iwl_mvm_restart_complete()
1145 ret = iwl_mvm_update_quotas(mvm, true, NULL); in iwl_mvm_restart_complete()
1147 IWL_ERR(mvm, "Failed to update quotas after restart (%d)\n", in iwl_mvm_restart_complete()
1150 iwl_mvm_send_recovery_cmd(mvm, ERROR_RECOVERY_END_OF_RECOVERY); in iwl_mvm_restart_complete()
1156 iwl_mvm_teardown_tdls_peers(mvm); in iwl_mvm_restart_complete()
1158 mutex_unlock(&mvm->mutex); in iwl_mvm_restart_complete()
1165 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_reconfig_complete() local
1169 iwl_mvm_restart_complete(mvm); in iwl_mvm_mac_reconfig_complete()
1176 void __iwl_mvm_mac_stop(struct iwl_mvm *mvm) in __iwl_mvm_mac_stop() argument
1178 lockdep_assert_held(&mvm->mutex); in __iwl_mvm_mac_stop()
1183 memset(&mvm->accu_radio_stats, 0, sizeof(mvm->accu_radio_stats)); in __iwl_mvm_mac_stop()
1191 flush_work(&mvm->roc_done_wk); in __iwl_mvm_mac_stop()
1193 iwl_mvm_stop_device(mvm); in __iwl_mvm_mac_stop()
1195 iwl_mvm_async_handlers_purge(mvm); in __iwl_mvm_mac_stop()
1199 iwl_mvm_del_aux_sta(mvm); in __iwl_mvm_mac_stop()
1208 if (test_and_clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) || in __iwl_mvm_mac_stop()
1210 &mvm->status)) in __iwl_mvm_mac_stop()
1211 ieee80211_iterate_interfaces(mvm->hw, 0, in __iwl_mvm_mac_stop()
1212 iwl_mvm_cleanup_iterator, mvm); in __iwl_mvm_mac_stop()
1217 if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_UMAC_SCAN)) { in __iwl_mvm_mac_stop()
1220 for (i = 0; i < mvm->max_scans; i++) { in __iwl_mvm_mac_stop()
1221 if (WARN_ONCE(mvm->scan_uid_status[i], in __iwl_mvm_mac_stop()
1224 mvm->scan_uid_status[i] = 0; in __iwl_mvm_mac_stop()
1231 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_stop() local
1233 flush_work(&mvm->async_handlers_wk); in iwl_mvm_mac_stop()
1234 flush_work(&mvm->add_stream_wk); in iwl_mvm_mac_stop()
1244 clear_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status); in iwl_mvm_mac_stop()
1246 cancel_delayed_work_sync(&mvm->cs_tx_unblock_dwork); in iwl_mvm_mac_stop()
1247 cancel_delayed_work_sync(&mvm->scan_timeout_dwork); in iwl_mvm_mac_stop()
1248 iwl_fw_free_dump_desc(&mvm->fwrt); in iwl_mvm_mac_stop()
1250 mutex_lock(&mvm->mutex); in iwl_mvm_mac_stop()
1251 __iwl_mvm_mac_stop(mvm); in iwl_mvm_mac_stop()
1252 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_stop()
1258 cancel_work_sync(&mvm->async_handlers_wk); in iwl_mvm_mac_stop()
1261 static struct iwl_mvm_phy_ctxt *iwl_mvm_get_free_phy_ctxt(struct iwl_mvm *mvm) in iwl_mvm_get_free_phy_ctxt() argument
1265 lockdep_assert_held(&mvm->mutex); in iwl_mvm_get_free_phy_ctxt()
1268 if (!mvm->phy_ctxts[i].ref) in iwl_mvm_get_free_phy_ctxt()
1269 return &mvm->phy_ctxts[i]; in iwl_mvm_get_free_phy_ctxt()
1271 IWL_ERR(mvm, "No available PHY context\n"); in iwl_mvm_get_free_phy_ctxt()
1275 static int iwl_mvm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_set_tx_power() argument
1292 if (fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_set_tx_power()
1295 else if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_set_tx_power()
1301 return iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0, len, &cmd); in iwl_mvm_set_tx_power()
1308 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_post_channel_switch() local
1311 mutex_lock(&mvm->mutex); in iwl_mvm_post_channel_switch()
1323 mvmsta = iwl_mvm_sta_from_staid_protected(mvm, in iwl_mvm_post_channel_switch()
1331 if (!fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_post_channel_switch()
1333 iwl_mvm_sta_modify_disable_tx(mvm, mvmsta, false); in iwl_mvm_post_channel_switch()
1335 iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); in iwl_mvm_post_channel_switch()
1337 if (!fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_post_channel_switch()
1339 ret = iwl_mvm_enable_beacon_filter(mvm, vif, 0); in iwl_mvm_post_channel_switch()
1343 iwl_mvm_stop_session_protection(mvm, vif); in iwl_mvm_post_channel_switch()
1349 ret = iwl_mvm_power_update_ps(mvm); in iwl_mvm_post_channel_switch()
1352 mutex_unlock(&mvm->mutex); in iwl_mvm_post_channel_switch()
1360 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_abort_channel_switch() local
1368 IWL_DEBUG_MAC80211(mvm, "Abort CSA on mac %d\n", mvmvif->id); in iwl_mvm_abort_channel_switch()
1370 mutex_lock(&mvm->mutex); in iwl_mvm_abort_channel_switch()
1371 WARN_ON(iwl_mvm_send_cmd_pdu(mvm, in iwl_mvm_abort_channel_switch()
1375 mutex_unlock(&mvm->mutex); in iwl_mvm_abort_channel_switch()
1382 struct iwl_mvm *mvm; in iwl_mvm_channel_switch_disconnect_wk() local
1388 mvm = mvmvif->mvm; in iwl_mvm_channel_switch_disconnect_wk()
1390 iwl_mvm_abort_channel_switch(mvm->hw, vif); in iwl_mvm_channel_switch_disconnect_wk()
1397 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_add_interface() local
1401 mvmvif->mvm = mvm; in iwl_mvm_mac_add_interface()
1410 mutex_lock(&mvm->mutex); in iwl_mvm_mac_add_interface()
1413 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) in iwl_mvm_mac_add_interface()
1418 ret = iwl_mvm_mac_ctxt_init(mvm, vif); in iwl_mvm_mac_add_interface()
1422 rcu_assign_pointer(mvm->vif_id_to_mac[mvmvif->id], vif); in iwl_mvm_mac_add_interface()
1426 mvm->vif_count++; in iwl_mvm_mac_add_interface()
1441 ret = iwl_mvm_alloc_bcast_sta(mvm, vif); in iwl_mvm_mac_add_interface()
1443 IWL_ERR(mvm, "Failed to allocate bcast sta\n"); in iwl_mvm_mac_add_interface()
1451 ret = iwl_mvm_allocate_int_sta(mvm, &mvmvif->mcast_sta, in iwl_mvm_mac_add_interface()
1457 iwl_mvm_vif_dbgfs_register(mvm, vif); in iwl_mvm_mac_add_interface()
1463 ret = iwl_mvm_mac_ctxt_add(mvm, vif); in iwl_mvm_mac_add_interface()
1467 ret = iwl_mvm_power_update_mac(mvm); in iwl_mvm_mac_add_interface()
1472 ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0); in iwl_mvm_mac_add_interface()
1476 if (!mvm->bf_allowed_vif && in iwl_mvm_mac_add_interface()
1478 mvm->bf_allowed_vif = mvmvif; in iwl_mvm_mac_add_interface()
1490 mvmvif->phy_ctxt = iwl_mvm_get_free_phy_ctxt(mvm); in iwl_mvm_mac_add_interface()
1496 iwl_mvm_phy_ctxt_ref(mvm, mvmvif->phy_ctxt); in iwl_mvm_mac_add_interface()
1497 ret = iwl_mvm_binding_add_vif(mvm, vif); in iwl_mvm_mac_add_interface()
1501 ret = iwl_mvm_add_p2p_bcast_sta(mvm, vif); in iwl_mvm_mac_add_interface()
1507 mvm->p2p_device_vif = vif; in iwl_mvm_mac_add_interface()
1510 iwl_mvm_tcm_add_vif(mvm, vif); in iwl_mvm_mac_add_interface()
1515 mvm->monitor_on = true; in iwl_mvm_mac_add_interface()
1517 iwl_mvm_vif_dbgfs_register(mvm, vif); in iwl_mvm_mac_add_interface()
1521 iwl_mvm_binding_remove_vif(mvm, vif); in iwl_mvm_mac_add_interface()
1523 iwl_mvm_phy_ctxt_unref(mvm, mvmvif->phy_ctxt); in iwl_mvm_mac_add_interface()
1525 if (mvm->bf_allowed_vif == mvmvif) { in iwl_mvm_mac_add_interface()
1526 mvm->bf_allowed_vif = NULL; in iwl_mvm_mac_add_interface()
1532 iwl_mvm_mac_ctxt_remove(mvm, vif); in iwl_mvm_mac_add_interface()
1535 mvm->vif_count--; in iwl_mvm_mac_add_interface()
1537 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_add_interface()
1542 static void iwl_mvm_prepare_mac_removal(struct iwl_mvm *mvm, in iwl_mvm_prepare_mac_removal() argument
1551 flush_work(&mvm->roc_done_wk); in iwl_mvm_prepare_mac_removal()
1558 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_remove_interface() local
1562 iwl_mvm_prepare_mac_removal(mvm, vif); in iwl_mvm_mac_remove_interface()
1566 iwl_mvm_tcm_rm_vif(mvm, vif); in iwl_mvm_mac_remove_interface()
1568 mutex_lock(&mvm->mutex); in iwl_mvm_mac_remove_interface()
1571 lockdep_is_held(&mvm->mutex)); in iwl_mvm_mac_remove_interface()
1576 if (mvm->bf_allowed_vif == mvmvif) { in iwl_mvm_mac_remove_interface()
1577 mvm->bf_allowed_vif = NULL; in iwl_mvm_mac_remove_interface()
1583 memset(&mvm->ftm_resp_stats, 0, sizeof(mvm->ftm_resp_stats)); in iwl_mvm_mac_remove_interface()
1585 iwl_mvm_vif_dbgfs_clean(mvm, vif); in iwl_mvm_mac_remove_interface()
1594 if (vif == mvm->noa_vif) { in iwl_mvm_mac_remove_interface()
1595 mvm->noa_vif = NULL; in iwl_mvm_mac_remove_interface()
1596 mvm->noa_duration = 0; in iwl_mvm_mac_remove_interface()
1599 iwl_mvm_dealloc_int_sta(mvm, &mvmvif->mcast_sta); in iwl_mvm_mac_remove_interface()
1600 iwl_mvm_dealloc_bcast_sta(mvm, vif); in iwl_mvm_mac_remove_interface()
1605 mvm->p2p_device_vif = NULL; in iwl_mvm_mac_remove_interface()
1606 iwl_mvm_rm_p2p_bcast_sta(mvm, vif); in iwl_mvm_mac_remove_interface()
1607 iwl_mvm_binding_remove_vif(mvm, vif); in iwl_mvm_mac_remove_interface()
1608 iwl_mvm_phy_ctxt_unref(mvm, mvmvif->phy_ctxt); in iwl_mvm_mac_remove_interface()
1612 if (mvm->vif_count && vif->type != NL80211_IFTYPE_P2P_DEVICE) in iwl_mvm_mac_remove_interface()
1613 mvm->vif_count--; in iwl_mvm_mac_remove_interface()
1615 iwl_mvm_power_update_mac(mvm); in iwl_mvm_mac_remove_interface()
1616 iwl_mvm_mac_ctxt_remove(mvm, vif); in iwl_mvm_mac_remove_interface()
1618 RCU_INIT_POINTER(mvm->vif_id_to_mac[mvmvif->id], NULL); in iwl_mvm_mac_remove_interface()
1621 mvm->monitor_on = false; in iwl_mvm_mac_remove_interface()
1624 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_remove_interface()
1633 struct iwl_mvm *mvm; member
1641 struct iwl_mvm *mvm = data->mvm; in iwl_mvm_mc_iface_iterator() local
1642 struct iwl_mcast_filter_cmd *cmd = mvm->mcast_filter_cmd; in iwl_mvm_mc_iface_iterator()
1665 ret = iwl_mvm_send_cmd(mvm, &hcmd); in iwl_mvm_mc_iface_iterator()
1667 IWL_ERR(mvm, "mcast filter cmd error. ret=%d\n", ret); in iwl_mvm_mc_iface_iterator()
1670 static void iwl_mvm_recalc_multicast(struct iwl_mvm *mvm) in iwl_mvm_recalc_multicast() argument
1673 .mvm = mvm, in iwl_mvm_recalc_multicast()
1676 lockdep_assert_held(&mvm->mutex); in iwl_mvm_recalc_multicast()
1678 if (WARN_ON_ONCE(!mvm->mcast_filter_cmd)) in iwl_mvm_recalc_multicast()
1682 mvm->hw, IEEE80211_IFACE_ITER_NORMAL, in iwl_mvm_recalc_multicast()
1689 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_prepare_multicast() local
1713 IWL_DEBUG_MAC80211(mvm, "mcast addr (%d): %pM\n", in iwl_mvm_prepare_multicast()
1728 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_configure_filter() local
1731 mutex_lock(&mvm->mutex); in iwl_mvm_configure_filter()
1734 kfree(mvm->mcast_filter_cmd); in iwl_mvm_configure_filter()
1735 mvm->mcast_filter_cmd = cmd; in iwl_mvm_configure_filter()
1746 iwl_mvm_recalc_multicast(mvm); in iwl_mvm_configure_filter()
1748 mutex_unlock(&mvm->mutex); in iwl_mvm_configure_filter()
1757 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_config_iface_filter() local
1768 mutex_lock(&mvm->mutex); in iwl_mvm_config_iface_filter()
1769 iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); in iwl_mvm_config_iface_filter()
1770 mutex_unlock(&mvm->mutex); in iwl_mvm_config_iface_filter()
1775 struct iwl_mvm *mvm; member
1820 struct iwl_mvm *mvm = data->mvm; in iwl_mvm_bcast_filter_iterator() local
1842 for (i = 0; mvm->bcast_filters[i].attrs[0].mask; i++) { in iwl_mvm_bcast_filter_iterator()
1856 &mvm->bcast_filters[i], in iwl_mvm_bcast_filter_iterator()
1871 bool iwl_mvm_bcast_filter_build_cmd(struct iwl_mvm *mvm, in iwl_mvm_bcast_filter_build_cmd() argument
1875 .mvm = mvm, in iwl_mvm_bcast_filter_build_cmd()
1888 if (mvm->dbgfs_bcast_filtering.override) { in iwl_mvm_bcast_filter_build_cmd()
1889 memcpy(cmd->filters, &mvm->dbgfs_bcast_filtering.cmd.filters, in iwl_mvm_bcast_filter_build_cmd()
1891 memcpy(cmd->macs, &mvm->dbgfs_bcast_filtering.cmd.macs, in iwl_mvm_bcast_filter_build_cmd()
1898 if (!mvm->bcast_filters) in iwl_mvm_bcast_filter_build_cmd()
1903 mvm->hw, IEEE80211_IFACE_ITER_NORMAL, in iwl_mvm_bcast_filter_build_cmd()
1909 static int iwl_mvm_configure_bcast_filter(struct iwl_mvm *mvm) in iwl_mvm_configure_bcast_filter() argument
1913 if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_BCAST_FILTERING)) in iwl_mvm_configure_bcast_filter()
1916 if (!iwl_mvm_bcast_filter_build_cmd(mvm, &cmd)) in iwl_mvm_configure_bcast_filter()
1919 return iwl_mvm_send_cmd_pdu(mvm, BCAST_FILTER_CMD, 0, in iwl_mvm_configure_bcast_filter()
1923 static inline int iwl_mvm_configure_bcast_filter(struct iwl_mvm *mvm) in iwl_mvm_configure_bcast_filter() argument
1929 static int iwl_mvm_update_mu_groups(struct iwl_mvm *mvm, in iwl_mvm_update_mu_groups() argument
1939 return iwl_mvm_send_cmd_pdu(mvm, in iwl_mvm_update_mu_groups()
1962 void iwl_mvm_mu_mimo_grp_notif(struct iwl_mvm *mvm, in iwl_mvm_mu_mimo_grp_notif() argument
1969 mvm->hw, IEEE80211_IFACE_ITER_NORMAL, in iwl_mvm_mu_mimo_grp_notif()
2000 static void iwl_mvm_cfg_he_sta(struct iwl_mvm *mvm, in iwl_mvm_cfg_he_sta() argument
2012 int size = fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_cfg_he_sta()
2022 sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_ctxt_cmd.sta_id]); in iwl_mvm_cfg_he_sta()
2094 IWL_INFO(mvm, "Got NSS = %d - trimming to %d\n", nss, in iwl_mvm_cfg_he_sta()
2218 if (iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(STA_HE_CTXT_CMD, in iwl_mvm_cfg_he_sta()
2221 IWL_ERR(mvm, "Failed to config FW to work HE!\n"); in iwl_mvm_cfg_he_sta()
2224 static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm, in iwl_mvm_bss_info_changed_station() argument
2240 iwl_mvm_cfg_he_sta(mvm, vif, mvmvif->ap_sta_id); in iwl_mvm_bss_info_changed_station()
2242 iwl_mvm_mac_ctxt_recalc_tsf_id(mvm, vif); in iwl_mvm_bss_info_changed_station()
2249 iwl_mvm_cfg_he_sta(mvm, vif, mvmvif->ap_sta_id); in iwl_mvm_bss_info_changed_station()
2260 ret = iwl_mvm_mac_ctxt_changed(mvm, vif, false, mvmvif->bssid); in iwl_mvm_bss_info_changed_station()
2262 IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr); in iwl_mvm_bss_info_changed_station()
2271 iwl_mvm_request_statistics(mvm, true); in iwl_mvm_bss_info_changed_station()
2276 ret = iwl_mvm_update_quotas(mvm, true, NULL); in iwl_mvm_bss_info_changed_station()
2278 IWL_ERR(mvm, "failed to update quotas\n"); in iwl_mvm_bss_info_changed_station()
2283 &mvm->status)) { in iwl_mvm_bss_info_changed_station()
2299 iwl_mvm_protect_session(mvm, vif, dur, dur, in iwl_mvm_bss_info_changed_station()
2303 iwl_mvm_sf_update(mvm, vif, false); in iwl_mvm_bss_info_changed_station()
2304 iwl_mvm_power_vif_assoc(mvm, vif); in iwl_mvm_bss_info_changed_station()
2306 iwl_mvm_update_smps(mvm, vif, in iwl_mvm_bss_info_changed_station()
2315 ret = iwl_mvm_sf_update(mvm, vif, false); in iwl_mvm_bss_info_changed_station()
2318 &mvm->status), in iwl_mvm_bss_info_changed_station()
2330 &mvm->status)) { in iwl_mvm_bss_info_changed_station()
2335 ret = iwl_mvm_rm_sta_id(mvm, vif, in iwl_mvm_bss_info_changed_station()
2338 IWL_ERR(mvm, in iwl_mvm_bss_info_changed_station()
2345 ret = iwl_mvm_update_quotas(mvm, false, NULL); in iwl_mvm_bss_info_changed_station()
2347 IWL_ERR(mvm, "failed to update quotas\n"); in iwl_mvm_bss_info_changed_station()
2350 ret = iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); in iwl_mvm_bss_info_changed_station()
2352 IWL_ERR(mvm, in iwl_mvm_bss_info_changed_station()
2361 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) && in iwl_mvm_bss_info_changed_station()
2363 ret = iwl_mvm_update_mu_groups(mvm, vif); in iwl_mvm_bss_info_changed_station()
2365 IWL_ERR(mvm, in iwl_mvm_bss_info_changed_station()
2369 iwl_mvm_recalc_multicast(mvm); in iwl_mvm_bss_info_changed_station()
2370 iwl_mvm_configure_bcast_filter(mvm); in iwl_mvm_bss_info_changed_station()
2375 iwl_mvm_bt_coex_vif_change(mvm); in iwl_mvm_bss_info_changed_station()
2376 iwl_mvm_update_smps(mvm, vif, IWL_MVM_SMPS_REQ_TT, in iwl_mvm_bss_info_changed_station()
2378 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_bss_info_changed_station()
2380 iwl_mvm_config_scan(mvm); in iwl_mvm_bss_info_changed_station()
2388 iwl_mvm_stop_session_protection(mvm, vif); in iwl_mvm_bss_info_changed_station()
2390 iwl_mvm_sf_update(mvm, vif, false); in iwl_mvm_bss_info_changed_station()
2391 WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif, 0)); in iwl_mvm_bss_info_changed_station()
2400 ret = iwl_mvm_power_update_mac(mvm); in iwl_mvm_bss_info_changed_station()
2402 IWL_ERR(mvm, "failed to update power mode\n"); in iwl_mvm_bss_info_changed_station()
2406 IWL_DEBUG_CALIB(mvm, "Changing TX Power to %d\n", in iwl_mvm_bss_info_changed_station()
2408 iwl_mvm_set_tx_power(mvm, vif, bss_conf->txpower); in iwl_mvm_bss_info_changed_station()
2412 IWL_DEBUG_MAC80211(mvm, "cqm info_changed\n"); in iwl_mvm_bss_info_changed_station()
2416 ret = iwl_mvm_enable_beacon_filter(mvm, vif, 0); in iwl_mvm_bss_info_changed_station()
2418 IWL_ERR(mvm, in iwl_mvm_bss_info_changed_station()
2424 IWL_DEBUG_MAC80211(mvm, "arp filter changed\n"); in iwl_mvm_bss_info_changed_station()
2425 iwl_mvm_configure_bcast_filter(mvm); in iwl_mvm_bss_info_changed_station()
2432 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_start_ap_ibss() local
2436 mutex_lock(&mvm->mutex); in iwl_mvm_start_ap_ibss()
2439 ret = iwl_mvm_mac_ctxt_beacon_changed(mvm, vif); in iwl_mvm_start_ap_ibss()
2448 iwl_mvm_mac_ctxt_recalc_tsf_id(mvm, vif); in iwl_mvm_start_ap_ibss()
2453 ret = iwl_mvm_mac_ctxt_add(mvm, vif); in iwl_mvm_start_ap_ibss()
2458 ret = iwl_mvm_binding_add_vif(mvm, vif); in iwl_mvm_start_ap_ibss()
2469 if (fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_STA_TYPE)) { in iwl_mvm_start_ap_ibss()
2470 ret = iwl_mvm_add_mcast_sta(mvm, vif); in iwl_mvm_start_ap_ibss()
2477 ret = iwl_mvm_send_add_bcast_sta(mvm, vif); in iwl_mvm_start_ap_ibss()
2479 iwl_mvm_rm_mcast_sta(mvm, vif); in iwl_mvm_start_ap_ibss()
2487 ret = iwl_mvm_send_add_bcast_sta(mvm, vif); in iwl_mvm_start_ap_ibss()
2490 ret = iwl_mvm_add_mcast_sta(mvm, vif); in iwl_mvm_start_ap_ibss()
2492 iwl_mvm_send_rm_bcast_sta(mvm, vif); in iwl_mvm_start_ap_ibss()
2517 iwl_mvm_send_low_latency_cmd(mvm, true, mvmvif->id); in iwl_mvm_start_ap_ibss()
2521 iwl_mvm_power_update_mac(mvm); in iwl_mvm_start_ap_ibss()
2523 ret = iwl_mvm_update_quotas(mvm, false, NULL); in iwl_mvm_start_ap_ibss()
2528 if (vif->p2p && mvm->p2p_device_vif) in iwl_mvm_start_ap_ibss()
2529 iwl_mvm_mac_ctxt_changed(mvm, mvm->p2p_device_vif, false, NULL); in iwl_mvm_start_ap_ibss()
2531 iwl_mvm_bt_coex_vif_change(mvm); in iwl_mvm_start_ap_ibss()
2534 if (iwl_mvm_phy_ctx_count(mvm) > 1) in iwl_mvm_start_ap_ibss()
2535 iwl_mvm_teardown_tdls_peers(mvm); in iwl_mvm_start_ap_ibss()
2537 iwl_mvm_ftm_restart_responder(mvm, vif); in iwl_mvm_start_ap_ibss()
2542 iwl_mvm_power_update_mac(mvm); in iwl_mvm_start_ap_ibss()
2544 iwl_mvm_send_rm_bcast_sta(mvm, vif); in iwl_mvm_start_ap_ibss()
2545 iwl_mvm_rm_mcast_sta(mvm, vif); in iwl_mvm_start_ap_ibss()
2547 iwl_mvm_binding_remove_vif(mvm, vif); in iwl_mvm_start_ap_ibss()
2549 iwl_mvm_mac_ctxt_remove(mvm, vif); in iwl_mvm_start_ap_ibss()
2551 mutex_unlock(&mvm->mutex); in iwl_mvm_start_ap_ibss()
2558 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_stop_ap_ibss() local
2561 iwl_mvm_prepare_mac_removal(mvm, vif); in iwl_mvm_stop_ap_ibss()
2563 mutex_lock(&mvm->mutex); in iwl_mvm_stop_ap_ibss()
2566 if (rcu_access_pointer(mvm->csa_vif) == vif) { in iwl_mvm_stop_ap_ibss()
2567 iwl_mvm_remove_time_event(mvm, mvmvif, in iwl_mvm_stop_ap_ibss()
2569 RCU_INIT_POINTER(mvm->csa_vif, NULL); in iwl_mvm_stop_ap_ibss()
2573 if (rcu_access_pointer(mvm->csa_tx_blocked_vif) == vif) { in iwl_mvm_stop_ap_ibss()
2574 RCU_INIT_POINTER(mvm->csa_tx_blocked_vif, NULL); in iwl_mvm_stop_ap_ibss()
2575 mvm->csa_tx_block_bcn_timeout = 0; in iwl_mvm_stop_ap_ibss()
2579 mvm->ap_last_beacon_gp2 = 0; in iwl_mvm_stop_ap_ibss()
2584 iwl_mvm_send_low_latency_cmd(mvm, false, mvmvif->id); in iwl_mvm_stop_ap_ibss()
2587 iwl_mvm_bt_coex_vif_change(mvm); in iwl_mvm_stop_ap_ibss()
2590 if (vif->p2p && mvm->p2p_device_vif) in iwl_mvm_stop_ap_ibss()
2591 iwl_mvm_mac_ctxt_changed(mvm, mvm->p2p_device_vif, false, NULL); in iwl_mvm_stop_ap_ibss()
2593 iwl_mvm_update_quotas(mvm, false, NULL); in iwl_mvm_stop_ap_ibss()
2603 if (!fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_STA_TYPE)) in iwl_mvm_stop_ap_ibss()
2604 iwl_mvm_rm_mcast_sta(mvm, vif); in iwl_mvm_stop_ap_ibss()
2605 iwl_mvm_send_rm_bcast_sta(mvm, vif); in iwl_mvm_stop_ap_ibss()
2606 if (fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_STA_TYPE)) in iwl_mvm_stop_ap_ibss()
2607 iwl_mvm_rm_mcast_sta(mvm, vif); in iwl_mvm_stop_ap_ibss()
2608 iwl_mvm_binding_remove_vif(mvm, vif); in iwl_mvm_stop_ap_ibss()
2610 iwl_mvm_power_update_mac(mvm); in iwl_mvm_stop_ap_ibss()
2612 iwl_mvm_mac_ctxt_remove(mvm, vif); in iwl_mvm_stop_ap_ibss()
2614 mutex_unlock(&mvm->mutex); in iwl_mvm_stop_ap_ibss()
2618 iwl_mvm_bss_info_changed_ap_ibss(struct iwl_mvm *mvm, in iwl_mvm_bss_info_changed_ap_ibss() argument
2631 iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL)) in iwl_mvm_bss_info_changed_ap_ibss()
2632 IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr); in iwl_mvm_bss_info_changed_ap_ibss()
2636 iwl_mvm_mac_ctxt_beacon_changed(mvm, vif)) in iwl_mvm_bss_info_changed_ap_ibss()
2637 IWL_WARN(mvm, "Failed updating beacon data\n"); in iwl_mvm_bss_info_changed_ap_ibss()
2640 IWL_DEBUG_CALIB(mvm, "Changing TX Power to %d\n", in iwl_mvm_bss_info_changed_ap_ibss()
2642 iwl_mvm_set_tx_power(mvm, vif, bss_conf->txpower); in iwl_mvm_bss_info_changed_ap_ibss()
2646 int ret = iwl_mvm_ftm_start_responder(mvm, vif); in iwl_mvm_bss_info_changed_ap_ibss()
2649 IWL_WARN(mvm, "Failed to enable FTM responder (%d)\n", in iwl_mvm_bss_info_changed_ap_ibss()
2660 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_bss_info_changed() local
2662 mutex_lock(&mvm->mutex); in iwl_mvm_bss_info_changed()
2665 iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_SCHED, true); in iwl_mvm_bss_info_changed()
2669 iwl_mvm_bss_info_changed_station(mvm, vif, bss_conf, changes); in iwl_mvm_bss_info_changed()
2673 iwl_mvm_bss_info_changed_ap_ibss(mvm, vif, bss_conf, changes); in iwl_mvm_bss_info_changed()
2677 iwl_mvm_update_mu_groups(mvm, vif); in iwl_mvm_bss_info_changed()
2684 mutex_unlock(&mvm->mutex); in iwl_mvm_bss_info_changed()
2691 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_hw_scan() local
2695 hw_req->req.n_channels > mvm->fw->ucode_capa.n_scan_channels) in iwl_mvm_mac_hw_scan()
2698 mutex_lock(&mvm->mutex); in iwl_mvm_mac_hw_scan()
2699 ret = iwl_mvm_reg_scan_start(mvm, vif, &hw_req->req, &hw_req->ies); in iwl_mvm_mac_hw_scan()
2700 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_hw_scan()
2708 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_cancel_hw_scan() local
2710 mutex_lock(&mvm->mutex); in iwl_mvm_mac_cancel_hw_scan()
2719 if (mvm->scan_status & IWL_MVM_SCAN_REGULAR) in iwl_mvm_mac_cancel_hw_scan()
2720 iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_REGULAR, true); in iwl_mvm_mac_cancel_hw_scan()
2722 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_cancel_hw_scan()
2732 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_allow_buffered_frames() local
2736 iwl_mvm_sta_modify_sleep_tx_count(mvm, sta, reason, num_frames, in iwl_mvm_mac_allow_buffered_frames()
2747 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_release_buffered_frames() local
2751 iwl_mvm_sta_modify_sleep_tx_count(mvm, sta, reason, num_frames, in iwl_mvm_mac_release_buffered_frames()
2759 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in __iwl_mvm_mac_sta_notify() local
2769 if (WARN_ON(iwl_mvm_has_new_tx_api(mvm))) in __iwl_mvm_mac_sta_notify()
2781 if (iwl_mvm_tid_queued(mvm, tid_data) == 0) in __iwl_mvm_mac_sta_notify()
2793 iwl_trans_freeze_txq_timer(mvm->trans, txqs, true); in __iwl_mvm_mac_sta_notify()
2805 iwl_trans_freeze_txq_timer(mvm->trans, txqs, false); in __iwl_mvm_mac_sta_notify()
2806 iwl_mvm_sta_modify_ps_wake(mvm, sta); in __iwl_mvm_mac_sta_notify()
2822 void iwl_mvm_sta_pm_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) in iwl_mvm_sta_pm_notif() argument
2830 if (WARN_ON(notif->sta_id >= ARRAY_SIZE(mvm->fw_id_to_mac_id))) in iwl_mvm_sta_pm_notif()
2834 sta = rcu_dereference(mvm->fw_id_to_mac_id[notif->sta_id]); in iwl_mvm_sta_pm_notif()
2850 __iwl_mvm_mac_sta_notify(mvm->hw, in iwl_mvm_sta_pm_notif()
2879 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_sta_pre_rcu_remove() local
2890 mutex_lock(&mvm->mutex); in iwl_mvm_sta_pre_rcu_remove()
2891 if (sta == rcu_access_pointer(mvm->fw_id_to_mac_id[mvm_sta->sta_id])) in iwl_mvm_sta_pre_rcu_remove()
2892 rcu_assign_pointer(mvm->fw_id_to_mac_id[mvm_sta->sta_id], in iwl_mvm_sta_pre_rcu_remove()
2895 mutex_unlock(&mvm->mutex); in iwl_mvm_sta_pre_rcu_remove()
2898 static void iwl_mvm_check_uapsd(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_check_uapsd() argument
2903 if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { in iwl_mvm_check_uapsd()
2906 mdata = &mvm->tcm.data[iwl_mvm_vif_from_mac80211(vif)->id]; in iwl_mvm_check_uapsd()
2911 if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_UAPSD_SUPPORT)) in iwl_mvm_check_uapsd()
2914 if (vif->p2p && !iwl_mvm_is_p2p_scm_uapsd_supported(mvm)) { in iwl_mvm_check_uapsd()
2926 if (ether_addr_equal(mvm->uapsd_noagg_bssids[i].addr, bssid)) { in iwl_mvm_check_uapsd()
2936 iwl_mvm_tdls_check_trigger(struct iwl_mvm *mvm, in iwl_mvm_tdls_check_trigger() argument
2943 trig = iwl_fw_dbg_trigger_on(&mvm->fwrt, ieee80211_vif_to_wdev(vif), in iwl_mvm_tdls_check_trigger()
2957 iwl_fw_dbg_collect_trig(&mvm->fwrt, trig, in iwl_mvm_tdls_check_trigger()
3013 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_sta_state() local
3018 IWL_DEBUG_MAC80211(mvm, "station %pM state change %d->%d\n", in iwl_mvm_mac_sta_state()
3040 flush_work(&mvm->add_stream_wk); in iwl_mvm_mac_sta_state()
3048 mutex_lock(&mvm->mutex); in iwl_mvm_mac_sta_state()
3063 IWL_ERR(mvm, in iwl_mvm_mac_sta_state()
3072 iwl_mvm_tdls_sta_count(mvm, NULL) == in iwl_mvm_mac_sta_state()
3074 iwl_mvm_phy_ctx_count(mvm) > 1)) { in iwl_mvm_mac_sta_state()
3075 IWL_DEBUG_MAC80211(mvm, "refusing TDLS sta\n"); in iwl_mvm_mac_sta_state()
3080 ret = iwl_mvm_add_sta(mvm, vif, sta); in iwl_mvm_mac_sta_state()
3082 iwl_mvm_recalc_tdls_state(mvm, vif, true); in iwl_mvm_mac_sta_state()
3083 iwl_mvm_tdls_check_trigger(mvm, vif, sta->addr, in iwl_mvm_mac_sta_state()
3094 mvm->last_ebs_successful = true; in iwl_mvm_mac_sta_state()
3095 iwl_mvm_check_uapsd(mvm, vif, sta->addr); in iwl_mvm_mac_sta_state()
3102 iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); in iwl_mvm_mac_sta_state()
3105 iwl_mvm_cfg_he_sta(mvm, vif, mvm_sta->sta_id); in iwl_mvm_mac_sta_state()
3113 iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); in iwl_mvm_mac_sta_state()
3116 iwl_mvm_rs_rate_init(mvm, sta, mvmvif->phy_ctxt->channel->band, in iwl_mvm_mac_sta_state()
3118 ret = iwl_mvm_update_sta(mvm, vif, sta); in iwl_mvm_mac_sta_state()
3124 if (iwl_mvm_phy_ctx_count(mvm) > 1) in iwl_mvm_mac_sta_state()
3125 iwl_mvm_teardown_tdls_peers(mvm); in iwl_mvm_mac_sta_state()
3128 iwl_mvm_tdls_check_trigger(mvm, vif, sta->addr, in iwl_mvm_mac_sta_state()
3132 WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif, 0)); in iwl_mvm_mac_sta_state()
3139 iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); in iwl_mvm_mac_sta_state()
3141 iwl_mvm_rs_rate_init(mvm, sta, mvmvif->phy_ctxt->channel->band, in iwl_mvm_mac_sta_state()
3146 iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); in iwl_mvm_mac_sta_state()
3149 ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0); in iwl_mvm_mac_sta_state()
3152 &mvm->status)); in iwl_mvm_mac_sta_state()
3158 iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); in iwl_mvm_mac_sta_state()
3166 ret = iwl_mvm_rm_sta(mvm, vif, sta); in iwl_mvm_mac_sta_state()
3168 iwl_mvm_recalc_tdls_state(mvm, vif, false); in iwl_mvm_mac_sta_state()
3169 iwl_mvm_tdls_check_trigger(mvm, vif, sta->addr, in iwl_mvm_mac_sta_state()
3175 &mvm->status))) in iwl_mvm_mac_sta_state()
3181 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_sta_state()
3197 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_set_rts_threshold() local
3199 mvm->rts_threshold = value; in iwl_mvm_mac_set_rts_threshold()
3208 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_sta_rc_update() local
3214 iwl_mvm_rs_rate_init(mvm, sta, mvmvif->phy_ctxt->channel->band, in iwl_mvm_sta_rc_update()
3219 iwl_mvm_sf_update(mvm, vif, false); in iwl_mvm_sta_rc_update()
3226 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_conf_tx() local
3238 mutex_lock(&mvm->mutex); in iwl_mvm_mac_conf_tx()
3239 ret = iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); in iwl_mvm_mac_conf_tx()
3240 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_conf_tx()
3250 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_mgd_prepare_tx() local
3257 mutex_lock(&mvm->mutex); in iwl_mvm_mac_mgd_prepare_tx()
3259 iwl_mvm_protect_session(mvm, vif, duration, min_duration, 500, false); in iwl_mvm_mac_mgd_prepare_tx()
3260 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_mgd_prepare_tx()
3268 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_sched_scan_start() local
3272 mutex_lock(&mvm->mutex); in iwl_mvm_mac_sched_scan_start()
3279 ret = iwl_mvm_sched_scan_start(mvm, vif, req, ies, IWL_MVM_SCAN_SCHED); in iwl_mvm_mac_sched_scan_start()
3282 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_sched_scan_start()
3289 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_sched_scan_stop() local
3292 mutex_lock(&mvm->mutex); in iwl_mvm_mac_sched_scan_stop()
3302 if (!(mvm->scan_status & IWL_MVM_SCAN_SCHED)) { in iwl_mvm_mac_sched_scan_stop()
3303 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_sched_scan_stop()
3307 ret = iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_SCHED, false); in iwl_mvm_mac_sched_scan_stop()
3308 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_sched_scan_stop()
3309 iwl_mvm_wait_for_async_handlers(mvm); in iwl_mvm_mac_sched_scan_stop()
3321 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in __iwl_mvm_mac_set_key() local
3329 IWL_DEBUG_MAC80211(mvm, "leave - hwcrypto disabled\n"); in __iwl_mvm_mac_set_key()
3335 if (!mvm->trans->trans_cfg->gen2) { in __iwl_mvm_mac_set_key()
3341 IWL_DEBUG_MAC80211(mvm, "Use SW encryption for TKIP\n"); in __iwl_mvm_mac_set_key()
3348 if (!iwl_mvm_has_new_tx_api(mvm)) in __iwl_mvm_mac_set_key()
3360 if (iwl_mvm_has_new_tx_api(mvm)) in __iwl_mvm_mac_set_key()
3392 !iwl_mvm_has_new_tx_api(mvm)) { in __iwl_mvm_mac_set_key()
3417 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) && in __iwl_mvm_mac_set_key()
3419 IWL_DEBUG_MAC80211(mvm, in __iwl_mvm_mac_set_key()
3425 if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) && in __iwl_mvm_mac_set_key()
3426 sta && iwl_mvm_has_new_rx_api(mvm) && in __iwl_mvm_mac_set_key()
3437 mvm->trans->num_rx_queues), in __iwl_mvm_mac_set_key()
3446 for (q = 0; q < mvm->trans->num_rx_queues; q++) in __iwl_mvm_mac_set_key()
3456 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) in __iwl_mvm_mac_set_key()
3461 IWL_DEBUG_MAC80211(mvm, "set hwcrypto key\n"); in __iwl_mvm_mac_set_key()
3462 ret = iwl_mvm_set_sta_key(mvm, vif, sta, key, key_offset); in __iwl_mvm_mac_set_key()
3464 IWL_WARN(mvm, "set key failed\n"); in __iwl_mvm_mac_set_key()
3472 if (iwl_mvm_has_new_tx_api(mvm)) in __iwl_mvm_mac_set_key()
3497 if (sta && iwl_mvm_has_new_rx_api(mvm) && in __iwl_mvm_mac_set_key()
3505 lockdep_is_held(&mvm->mutex)); in __iwl_mvm_mac_set_key()
3511 IWL_DEBUG_MAC80211(mvm, "disable hwcrypto key\n"); in __iwl_mvm_mac_set_key()
3512 ret = iwl_mvm_remove_sta_key(mvm, vif, sta, key); in __iwl_mvm_mac_set_key()
3527 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_set_key() local
3530 mutex_lock(&mvm->mutex); in iwl_mvm_mac_set_key()
3532 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_set_key()
3543 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_update_tkip_key() local
3548 iwl_mvm_update_tkip_key(mvm, vif, keyconf, sta, iv32, phase1key); in iwl_mvm_mac_update_tkip_key()
3555 struct iwl_mvm *mvm = in iwl_mvm_rx_aux_roc() local
3565 IWL_ERR(mvm, "Invalid HOT_SPOT_CMD response\n"); in iwl_mvm_rx_aux_roc()
3571 IWL_DEBUG_TE(mvm, in iwl_mvm_rx_aux_roc()
3576 IWL_DEBUG_TE(mvm, "TIME_EVENT_CMD response - UID = 0x%x\n", in iwl_mvm_rx_aux_roc()
3579 spin_lock_bh(&mvm->time_event_lock); in iwl_mvm_rx_aux_roc()
3580 list_add_tail(&te_data->list, &mvm->aux_roc_te_list); in iwl_mvm_rx_aux_roc()
3581 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_rx_aux_roc()
3591 static int iwl_mvm_send_aux_roc_cmd(struct iwl_mvm *mvm, in iwl_mvm_send_aux_roc_cmd() argument
3608 .sta_id_and_color = cpu_to_le32(mvm->aux_sta.sta_id), in iwl_mvm_send_aux_roc_cmd()
3610 struct iwl_hs20_roc_req_tail *tail = iwl_mvm_chan_info_cmd_tail(mvm, in iwl_mvm_send_aux_roc_cmd()
3612 u16 len = sizeof(aux_roc_req) - iwl_mvm_chan_info_padding(mvm); in iwl_mvm_send_aux_roc_cmd()
3615 iwl_mvm_set_chan_info(mvm, &aux_roc_req.channel_info, channel->hw_value, in iwl_mvm_send_aux_roc_cmd()
3622 tail->apply_time = cpu_to_le32(iwl_mvm_get_systime(mvm)); in iwl_mvm_send_aux_roc_cmd()
3650 IWL_DEBUG_TE(mvm, in iwl_mvm_send_aux_roc_cmd()
3657 lockdep_assert_held(&mvm->mutex); in iwl_mvm_send_aux_roc_cmd()
3659 spin_lock_bh(&mvm->time_event_lock); in iwl_mvm_send_aux_roc_cmd()
3662 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_send_aux_roc_cmd()
3670 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_send_aux_roc_cmd()
3681 iwl_init_notification_wait(&mvm->notif_wait, &wait_time_event, in iwl_mvm_send_aux_roc_cmd()
3686 res = iwl_mvm_send_cmd_pdu(mvm, HOT_SPOT_CMD, 0, len, in iwl_mvm_send_aux_roc_cmd()
3690 IWL_ERR(mvm, "Couldn't send HOT_SPOT_CMD: %d\n", res); in iwl_mvm_send_aux_roc_cmd()
3691 iwl_remove_notification(&mvm->notif_wait, &wait_time_event); in iwl_mvm_send_aux_roc_cmd()
3696 res = iwl_wait_notification(&mvm->notif_wait, &wait_time_event, 1); in iwl_mvm_send_aux_roc_cmd()
3702 spin_lock_bh(&mvm->time_event_lock); in iwl_mvm_send_aux_roc_cmd()
3703 iwl_mvm_te_clear_data(mvm, te_data); in iwl_mvm_send_aux_roc_cmd()
3704 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_send_aux_roc_cmd()
3716 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_roc() local
3722 IWL_DEBUG_MAC80211(mvm, "enter (%d, %d, %d)\n", channel->hw_value, in iwl_mvm_roc()
3729 flush_work(&mvm->roc_done_wk); in iwl_mvm_roc()
3731 mutex_lock(&mvm->mutex); in iwl_mvm_roc()
3735 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_roc()
3738 ret = iwl_mvm_send_aux_roc_cmd(mvm, channel, in iwl_mvm_roc()
3742 IWL_ERR(mvm, "hotspot not supported\n"); in iwl_mvm_roc()
3749 IWL_ERR(mvm, "vif isn't P2P_DEVICE: %d\n", vif->type); in iwl_mvm_roc()
3755 phy_ctxt = &mvm->phy_ctxts[i]; in iwl_mvm_roc()
3764 ret = iwl_mvm_binding_remove_vif(mvm, vif); in iwl_mvm_roc()
3768 iwl_mvm_phy_ctxt_unref(mvm, mvmvif->phy_ctxt); in iwl_mvm_roc()
3773 ret = iwl_mvm_binding_add_vif(mvm, vif); in iwl_mvm_roc()
3777 iwl_mvm_phy_ctxt_ref(mvm, mvmvif->phy_ctxt); in iwl_mvm_roc()
3793 ret = iwl_mvm_phy_ctxt_changed(mvm, mvmvif->phy_ctxt, in iwl_mvm_roc()
3803 phy_ctxt = iwl_mvm_get_free_phy_ctxt(mvm); in iwl_mvm_roc()
3809 ret = iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, &chandef, in iwl_mvm_roc()
3812 IWL_ERR(mvm, "Failed to change PHY context\n"); in iwl_mvm_roc()
3817 ret = iwl_mvm_binding_remove_vif(mvm, vif); in iwl_mvm_roc()
3821 iwl_mvm_phy_ctxt_unref(mvm, mvmvif->phy_ctxt); in iwl_mvm_roc()
3826 ret = iwl_mvm_binding_add_vif(mvm, vif); in iwl_mvm_roc()
3830 iwl_mvm_phy_ctxt_ref(mvm, mvmvif->phy_ctxt); in iwl_mvm_roc()
3835 ret = iwl_mvm_start_p2p_roc(mvm, vif, duration, type); in iwl_mvm_roc()
3838 mutex_unlock(&mvm->mutex); in iwl_mvm_roc()
3839 IWL_DEBUG_MAC80211(mvm, "leave\n"); in iwl_mvm_roc()
3846 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_cancel_roc() local
3848 IWL_DEBUG_MAC80211(mvm, "enter\n"); in iwl_mvm_cancel_roc()
3850 mutex_lock(&mvm->mutex); in iwl_mvm_cancel_roc()
3851 iwl_mvm_stop_roc(mvm); in iwl_mvm_cancel_roc()
3852 mutex_unlock(&mvm->mutex); in iwl_mvm_cancel_roc()
3854 IWL_DEBUG_MAC80211(mvm, "leave\n"); in iwl_mvm_cancel_roc()
3873 static bool iwl_mvm_is_ftm_responder_chanctx(struct iwl_mvm *mvm, in iwl_mvm_is_ftm_responder_chanctx() argument
3881 ieee80211_iterate_active_interfaces_atomic(mvm->hw, in iwl_mvm_is_ftm_responder_chanctx()
3888 static int __iwl_mvm_add_chanctx(struct iwl_mvm *mvm, in __iwl_mvm_add_chanctx() argument
3893 bool responder = iwl_mvm_is_ftm_responder_chanctx(mvm, ctx); in __iwl_mvm_add_chanctx()
3897 lockdep_assert_held(&mvm->mutex); in __iwl_mvm_add_chanctx()
3899 IWL_DEBUG_MAC80211(mvm, "Add channel context\n"); in __iwl_mvm_add_chanctx()
3901 phy_ctxt = iwl_mvm_get_free_phy_ctxt(mvm); in __iwl_mvm_add_chanctx()
3907 ret = iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, def, in __iwl_mvm_add_chanctx()
3911 IWL_ERR(mvm, "Failed to add PHY context\n"); in __iwl_mvm_add_chanctx()
3915 iwl_mvm_phy_ctxt_ref(mvm, phy_ctxt); in __iwl_mvm_add_chanctx()
3924 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_add_chanctx() local
3927 mutex_lock(&mvm->mutex); in iwl_mvm_add_chanctx()
3928 ret = __iwl_mvm_add_chanctx(mvm, ctx); in iwl_mvm_add_chanctx()
3929 mutex_unlock(&mvm->mutex); in iwl_mvm_add_chanctx()
3934 static void __iwl_mvm_remove_chanctx(struct iwl_mvm *mvm, in __iwl_mvm_remove_chanctx() argument
3938 struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id]; in __iwl_mvm_remove_chanctx()
3940 lockdep_assert_held(&mvm->mutex); in __iwl_mvm_remove_chanctx()
3942 iwl_mvm_phy_ctxt_unref(mvm, phy_ctxt); in __iwl_mvm_remove_chanctx()
3948 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_remove_chanctx() local
3950 mutex_lock(&mvm->mutex); in iwl_mvm_remove_chanctx()
3951 __iwl_mvm_remove_chanctx(mvm, ctx); in iwl_mvm_remove_chanctx()
3952 mutex_unlock(&mvm->mutex); in iwl_mvm_remove_chanctx()
3959 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_change_chanctx() local
3961 struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id]; in iwl_mvm_change_chanctx()
3962 bool responder = iwl_mvm_is_ftm_responder_chanctx(mvm, ctx); in iwl_mvm_change_chanctx()
3974 mutex_lock(&mvm->mutex); in iwl_mvm_change_chanctx()
3987 iwl_mvm_bt_coex_vif_change(mvm); in iwl_mvm_change_chanctx()
3988 iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, def, in iwl_mvm_change_chanctx()
3993 mutex_unlock(&mvm->mutex); in iwl_mvm_change_chanctx()
3996 static int __iwl_mvm_assign_vif_chanctx(struct iwl_mvm *mvm, in __iwl_mvm_assign_vif_chanctx() argument
4002 struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id]; in __iwl_mvm_assign_vif_chanctx()
4006 lockdep_assert_held(&mvm->mutex); in __iwl_mvm_assign_vif_chanctx()
4037 ret = iwl_mvm_binding_add_vif(mvm, vif); in __iwl_mvm_assign_vif_chanctx()
4045 iwl_mvm_power_update_mac(mvm); in __iwl_mvm_assign_vif_chanctx()
4053 ret = iwl_mvm_update_quotas(mvm, false, NULL); in __iwl_mvm_assign_vif_chanctx()
4057 ret = iwl_mvm_add_snif_sta(mvm, vif); in __iwl_mvm_assign_vif_chanctx()
4065 iwl_mvm_update_quotas(mvm, false, NULL); in __iwl_mvm_assign_vif_chanctx()
4066 iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); in __iwl_mvm_assign_vif_chanctx()
4072 if (!fw_has_capa(&mvm->fw->ucode_capa, in __iwl_mvm_assign_vif_chanctx()
4079 iwl_mvm_protect_session(mvm, vif, duration, duration, in __iwl_mvm_assign_vif_chanctx()
4084 iwl_mvm_update_quotas(mvm, false, NULL); in __iwl_mvm_assign_vif_chanctx()
4090 iwl_mvm_binding_remove_vif(mvm, vif); in __iwl_mvm_assign_vif_chanctx()
4091 iwl_mvm_power_update_mac(mvm); in __iwl_mvm_assign_vif_chanctx()
4101 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_assign_vif_chanctx() local
4104 mutex_lock(&mvm->mutex); in iwl_mvm_assign_vif_chanctx()
4105 ret = __iwl_mvm_assign_vif_chanctx(mvm, vif, ctx, false); in iwl_mvm_assign_vif_chanctx()
4106 mutex_unlock(&mvm->mutex); in iwl_mvm_assign_vif_chanctx()
4111 static void __iwl_mvm_unassign_vif_chanctx(struct iwl_mvm *mvm, in __iwl_mvm_unassign_vif_chanctx() argument
4119 lockdep_assert_held(&mvm->mutex); in __iwl_mvm_unassign_vif_chanctx()
4121 iwl_mvm_remove_time_event(mvm, mvmvif, &mvmvif->time_event_data); in __iwl_mvm_unassign_vif_chanctx()
4129 iwl_mvm_rm_snif_sta(mvm, vif); in __iwl_mvm_unassign_vif_chanctx()
4139 iwl_mvm_modify_all_sta_disable_tx(mvm, mvmvif, true); in __iwl_mvm_unassign_vif_chanctx()
4142 rcu_assign_pointer(mvm->csa_tx_blocked_vif, vif); in __iwl_mvm_unassign_vif_chanctx()
4152 if (!fw_has_capa(&mvm->fw->ucode_capa, in __iwl_mvm_unassign_vif_chanctx()
4154 iwl_mvm_mac_ctxt_changed(mvm, vif, true, NULL); in __iwl_mvm_unassign_vif_chanctx()
4160 iwl_mvm_update_quotas(mvm, false, disabled_vif); in __iwl_mvm_unassign_vif_chanctx()
4161 iwl_mvm_binding_remove_vif(mvm, vif); in __iwl_mvm_unassign_vif_chanctx()
4165 iwl_mvm_power_update_mac(mvm); in __iwl_mvm_unassign_vif_chanctx()
4172 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_unassign_vif_chanctx() local
4174 mutex_lock(&mvm->mutex); in iwl_mvm_unassign_vif_chanctx()
4175 __iwl_mvm_unassign_vif_chanctx(mvm, vif, ctx, false); in iwl_mvm_unassign_vif_chanctx()
4176 mutex_unlock(&mvm->mutex); in iwl_mvm_unassign_vif_chanctx()
4180 iwl_mvm_switch_vif_chanctx_swap(struct iwl_mvm *mvm, in iwl_mvm_switch_vif_chanctx_swap() argument
4185 mutex_lock(&mvm->mutex); in iwl_mvm_switch_vif_chanctx_swap()
4186 __iwl_mvm_unassign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx, true); in iwl_mvm_switch_vif_chanctx_swap()
4187 __iwl_mvm_remove_chanctx(mvm, vifs[0].old_ctx); in iwl_mvm_switch_vif_chanctx_swap()
4189 ret = __iwl_mvm_add_chanctx(mvm, vifs[0].new_ctx); in iwl_mvm_switch_vif_chanctx_swap()
4191 IWL_ERR(mvm, "failed to add new_ctx during channel switch\n"); in iwl_mvm_switch_vif_chanctx_swap()
4195 ret = __iwl_mvm_assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].new_ctx, in iwl_mvm_switch_vif_chanctx_swap()
4198 IWL_ERR(mvm, in iwl_mvm_switch_vif_chanctx_swap()
4204 if (iwl_mvm_phy_ctx_count(mvm) > 1) in iwl_mvm_switch_vif_chanctx_swap()
4205 iwl_mvm_teardown_tdls_peers(mvm); in iwl_mvm_switch_vif_chanctx_swap()
4210 __iwl_mvm_remove_chanctx(mvm, vifs[0].new_ctx); in iwl_mvm_switch_vif_chanctx_swap()
4213 if (__iwl_mvm_add_chanctx(mvm, vifs[0].old_ctx)) { in iwl_mvm_switch_vif_chanctx_swap()
4214 IWL_ERR(mvm, "failed to add old_ctx back after failure.\n"); in iwl_mvm_switch_vif_chanctx_swap()
4218 if (__iwl_mvm_assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx, in iwl_mvm_switch_vif_chanctx_swap()
4220 IWL_ERR(mvm, "failed to reassign old_ctx after failure.\n"); in iwl_mvm_switch_vif_chanctx_swap()
4228 iwl_mvm_nic_restart(mvm, false); in iwl_mvm_switch_vif_chanctx_swap()
4231 mutex_unlock(&mvm->mutex); in iwl_mvm_switch_vif_chanctx_swap()
4237 iwl_mvm_switch_vif_chanctx_reassign(struct iwl_mvm *mvm, in iwl_mvm_switch_vif_chanctx_reassign() argument
4242 mutex_lock(&mvm->mutex); in iwl_mvm_switch_vif_chanctx_reassign()
4243 __iwl_mvm_unassign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx, true); in iwl_mvm_switch_vif_chanctx_reassign()
4245 ret = __iwl_mvm_assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].new_ctx, in iwl_mvm_switch_vif_chanctx_reassign()
4248 IWL_ERR(mvm, in iwl_mvm_switch_vif_chanctx_reassign()
4256 if (__iwl_mvm_assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx, in iwl_mvm_switch_vif_chanctx_reassign()
4258 IWL_ERR(mvm, "failed to reassign old_ctx after failure.\n"); in iwl_mvm_switch_vif_chanctx_reassign()
4266 iwl_mvm_nic_restart(mvm, false); in iwl_mvm_switch_vif_chanctx_reassign()
4269 mutex_unlock(&mvm->mutex); in iwl_mvm_switch_vif_chanctx_reassign()
4279 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_switch_vif_chanctx() local
4288 ret = iwl_mvm_switch_vif_chanctx_swap(mvm, vifs); in iwl_mvm_switch_vif_chanctx()
4291 ret = iwl_mvm_switch_vif_chanctx_reassign(mvm, vifs); in iwl_mvm_switch_vif_chanctx()
4303 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_tx_last_beacon() local
4305 return mvm->ibss_manager; in iwl_mvm_tx_last_beacon()
4312 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_set_tim() local
4316 IWL_ERR(mvm, "Station is not associated to a vif\n"); in iwl_mvm_set_tim()
4320 return iwl_mvm_mac_ctxt_beacon_changed(mvm, mvm_sta->vif); in iwl_mvm_set_tim()
4330 static int __iwl_mvm_mac_testmode_cmd(struct iwl_mvm *mvm, in __iwl_mvm_mac_testmode_cmd() argument
4357 mvm->noa_duration = noa_duration; in __iwl_mvm_mac_testmode_cmd()
4358 mvm->noa_vif = vif; in __iwl_mvm_mac_testmode_cmd()
4360 return iwl_mvm_update_quotas(mvm, true, NULL); in __iwl_mvm_mac_testmode_cmd()
4369 return iwl_mvm_enable_beacon_filter(mvm, vif, 0); in __iwl_mvm_mac_testmode_cmd()
4370 return iwl_mvm_disable_beacon_filter(mvm, vif, 0); in __iwl_mvm_mac_testmode_cmd()
4380 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_testmode_cmd() local
4383 mutex_lock(&mvm->mutex); in iwl_mvm_mac_testmode_cmd()
4384 err = __iwl_mvm_mac_testmode_cmd(mvm, vif, data, len); in iwl_mvm_mac_testmode_cmd()
4385 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_testmode_cmd()
4405 static int iwl_mvm_schedule_client_csa(struct iwl_mvm *mvm, in iwl_mvm_schedule_client_csa() argument
4419 lockdep_assert_held(&mvm->mutex); in iwl_mvm_schedule_client_csa()
4425 return iwl_mvm_send_cmd_pdu(mvm, in iwl_mvm_schedule_client_csa()
4431 static int iwl_mvm_old_pre_chan_sw_sta(struct iwl_mvm *mvm, in iwl_mvm_old_pre_chan_sw_sta() argument
4452 iwl_mvm_csa_client_absent(mvm, vif); in iwl_mvm_old_pre_chan_sw_sta()
4455 int ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0); in iwl_mvm_old_pre_chan_sw_sta()
4461 iwl_mvm_schedule_csa_period(mvm, vif, vif->bss_conf.beacon_int, in iwl_mvm_old_pre_chan_sw_sta()
4472 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_pre_channel_switch() local
4477 mutex_lock(&mvm->mutex); in iwl_mvm_pre_channel_switch()
4481 IWL_DEBUG_MAC80211(mvm, "pre CSA to freq %d\n", in iwl_mvm_pre_channel_switch()
4484 iwl_fw_dbg_trigger_simple_stop(&mvm->fwrt, in iwl_mvm_pre_channel_switch()
4491 rcu_dereference_protected(mvm->csa_vif, in iwl_mvm_pre_channel_switch()
4492 lockdep_is_held(&mvm->mutex)); in iwl_mvm_pre_channel_switch()
4500 if (rcu_dereference_protected(mvm->csa_tx_blocked_vif, in iwl_mvm_pre_channel_switch()
4501 lockdep_is_held(&mvm->mutex))) { in iwl_mvm_pre_channel_switch()
4506 rcu_assign_pointer(mvm->csa_vif, vif); in iwl_mvm_pre_channel_switch()
4530 if (!fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_pre_channel_switch()
4532 ret = iwl_mvm_old_pre_chan_sw_sta(mvm, vif, chsw); in iwl_mvm_pre_channel_switch()
4536 iwl_mvm_schedule_client_csa(mvm, vif, chsw); in iwl_mvm_pre_channel_switch()
4548 ret = iwl_mvm_power_update_ps(mvm); in iwl_mvm_pre_channel_switch()
4553 iwl_mvm_teardown_tdls_peers(mvm); in iwl_mvm_pre_channel_switch()
4556 mutex_unlock(&mvm->mutex); in iwl_mvm_pre_channel_switch()
4565 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_channel_switch_rx_beacon() local
4576 if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_CS_MODIFY)) in iwl_mvm_channel_switch_rx_beacon()
4591 IWL_DEBUG_MAC80211(mvm, "Modify CSA on mac %d\n", mvmvif->id); in iwl_mvm_channel_switch_rx_beacon()
4593 WARN_ON(iwl_mvm_send_cmd_pdu(mvm, in iwl_mvm_channel_switch_rx_beacon()
4599 static void iwl_mvm_flush_no_vif(struct iwl_mvm *mvm, u32 queues, bool drop) in iwl_mvm_flush_no_vif() argument
4603 if (!iwl_mvm_has_new_tx_api(mvm)) { in iwl_mvm_flush_no_vif()
4605 mutex_lock(&mvm->mutex); in iwl_mvm_flush_no_vif()
4606 iwl_mvm_flush_tx_path(mvm, in iwl_mvm_flush_no_vif()
4607 iwl_mvm_flushable_queues(mvm) & queues, 0); in iwl_mvm_flush_no_vif()
4608 mutex_unlock(&mvm->mutex); in iwl_mvm_flush_no_vif()
4610 iwl_trans_wait_tx_queues_empty(mvm->trans, queues); in iwl_mvm_flush_no_vif()
4615 mutex_lock(&mvm->mutex); in iwl_mvm_flush_no_vif()
4616 for (i = 0; i < ARRAY_SIZE(mvm->fw_id_to_mac_id); i++) { in iwl_mvm_flush_no_vif()
4619 sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[i], in iwl_mvm_flush_no_vif()
4620 lockdep_is_held(&mvm->mutex)); in iwl_mvm_flush_no_vif()
4625 iwl_mvm_flush_sta_tids(mvm, i, 0xFF, 0); in iwl_mvm_flush_no_vif()
4627 iwl_mvm_wait_sta_queues_empty(mvm, in iwl_mvm_flush_no_vif()
4630 mutex_unlock(&mvm->mutex); in iwl_mvm_flush_no_vif()
4636 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_flush() local
4644 iwl_mvm_flush_no_vif(mvm, queues, drop); in iwl_mvm_mac_flush()
4652 flush_work(&mvm->add_stream_wk); in iwl_mvm_mac_flush()
4654 mutex_lock(&mvm->mutex); in iwl_mvm_mac_flush()
4658 for (i = 0; i < ARRAY_SIZE(mvm->fw_id_to_mac_id); i++) { in iwl_mvm_mac_flush()
4659 sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[i], in iwl_mvm_mac_flush()
4660 lockdep_is_held(&mvm->mutex)); in iwl_mvm_mac_flush()
4672 if (iwl_mvm_flush_sta(mvm, mvmsta, false, 0)) in iwl_mvm_mac_flush()
4673 IWL_ERR(mvm, "flush request fail\n"); in iwl_mvm_mac_flush()
4676 if (iwl_mvm_has_new_tx_api(mvm)) in iwl_mvm_mac_flush()
4677 iwl_mvm_wait_sta_queues_empty(mvm, mvmsta); in iwl_mvm_mac_flush()
4681 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_flush()
4686 if (!drop && !iwl_mvm_has_new_tx_api(mvm)) in iwl_mvm_mac_flush()
4687 iwl_trans_wait_tx_queues_empty(mvm->trans, msk); in iwl_mvm_mac_flush()
4693 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_get_survey() local
4702 if (!fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_get_survey()
4706 mutex_lock(&mvm->mutex); in iwl_mvm_mac_get_survey()
4708 if (iwl_mvm_firmware_running(mvm)) { in iwl_mvm_mac_get_survey()
4709 ret = iwl_mvm_request_statistics(mvm, false); in iwl_mvm_mac_get_survey()
4718 survey->time = mvm->accu_radio_stats.on_time_rf + in iwl_mvm_mac_get_survey()
4719 mvm->radio_stats.on_time_rf; in iwl_mvm_mac_get_survey()
4722 survey->time_rx = mvm->accu_radio_stats.rx_time + in iwl_mvm_mac_get_survey()
4723 mvm->radio_stats.rx_time; in iwl_mvm_mac_get_survey()
4726 survey->time_tx = mvm->accu_radio_stats.tx_time + in iwl_mvm_mac_get_survey()
4727 mvm->radio_stats.tx_time; in iwl_mvm_mac_get_survey()
4730 survey->time_scan = mvm->accu_radio_stats.on_time_scan + in iwl_mvm_mac_get_survey()
4731 mvm->radio_stats.on_time_scan; in iwl_mvm_mac_get_survey()
4736 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_get_survey()
4745 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_sta_statistics() local
4761 mutex_lock(&mvm->mutex); in iwl_mvm_mac_sta_statistics()
4766 if (iwl_mvm_request_statistics(mvm, false)) in iwl_mvm_mac_sta_statistics()
4778 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_sta_statistics()
4781 static void iwl_mvm_event_mlme_callback(struct iwl_mvm *mvm, in iwl_mvm_event_mlme_callback() argument
4789 iwl_fw_dbg_collect_trig(&(mvm)->fwrt, trig, _fmt); \ in iwl_mvm_event_mlme_callback()
4795 trig = iwl_fw_dbg_trigger_on(&mvm->fwrt, ieee80211_vif_to_wdev(vif), in iwl_mvm_event_mlme_callback()
4828 static void iwl_mvm_event_bar_rx_callback(struct iwl_mvm *mvm, in iwl_mvm_event_bar_rx_callback() argument
4835 trig = iwl_fw_dbg_trigger_on(&mvm->fwrt, ieee80211_vif_to_wdev(vif), in iwl_mvm_event_bar_rx_callback()
4845 iwl_fw_dbg_collect_trig(&mvm->fwrt, trig, in iwl_mvm_event_bar_rx_callback()
4855 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_event_callback() local
4859 iwl_mvm_event_mlme_callback(mvm, vif, event); in iwl_mvm_mac_event_callback()
4862 iwl_mvm_event_bar_rx_callback(mvm, vif, event); in iwl_mvm_mac_event_callback()
4865 iwl_mvm_event_frame_timeout_callback(mvm, vif, event->u.ba.sta, in iwl_mvm_mac_event_callback()
4873 void iwl_mvm_sync_rx_queues_internal(struct iwl_mvm *mvm, in iwl_mvm_sync_rx_queues_internal() argument
4877 u32 qmask = BIT(mvm->trans->num_rx_queues) - 1; in iwl_mvm_sync_rx_queues_internal()
4881 if (!iwl_mvm_has_new_rx_api(mvm)) in iwl_mvm_sync_rx_queues_internal()
4885 notif->cookie = mvm->queue_sync_cookie; in iwl_mvm_sync_rx_queues_internal()
4886 atomic_set(&mvm->queue_sync_counter, in iwl_mvm_sync_rx_queues_internal()
4887 mvm->trans->num_rx_queues); in iwl_mvm_sync_rx_queues_internal()
4890 ret = iwl_mvm_notify_rx_queue(mvm, qmask, (u8 *)notif, in iwl_mvm_sync_rx_queues_internal()
4893 IWL_ERR(mvm, "Failed to trigger RX queues sync (%d)\n", ret); in iwl_mvm_sync_rx_queues_internal()
4898 lockdep_assert_held(&mvm->mutex); in iwl_mvm_sync_rx_queues_internal()
4899 ret = wait_event_timeout(mvm->rx_sync_waitq, in iwl_mvm_sync_rx_queues_internal()
4900 atomic_read(&mvm->queue_sync_counter) == 0 || in iwl_mvm_sync_rx_queues_internal()
4901 iwl_mvm_is_radio_killed(mvm), in iwl_mvm_sync_rx_queues_internal()
4903 WARN_ON_ONCE(!ret && !iwl_mvm_is_radio_killed(mvm)); in iwl_mvm_sync_rx_queues_internal()
4907 atomic_set(&mvm->queue_sync_counter, 0); in iwl_mvm_sync_rx_queues_internal()
4909 mvm->queue_sync_cookie++; in iwl_mvm_sync_rx_queues_internal()
4914 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_sync_rx_queues() local
4920 mutex_lock(&mvm->mutex); in iwl_mvm_sync_rx_queues()
4921 iwl_mvm_sync_rx_queues_internal(mvm, &data, sizeof(data)); in iwl_mvm_sync_rx_queues()
4922 mutex_unlock(&mvm->mutex); in iwl_mvm_sync_rx_queues()
4930 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_get_ftm_responder_stats() local
4937 mutex_lock(&mvm->mutex); in iwl_mvm_mac_get_ftm_responder_stats()
4938 *stats = mvm->ftm_resp_stats; in iwl_mvm_mac_get_ftm_responder_stats()
4939 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_get_ftm_responder_stats()
4958 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_start_pmsr() local
4961 mutex_lock(&mvm->mutex); in iwl_mvm_start_pmsr()
4962 ret = iwl_mvm_ftm_start(mvm, vif, request); in iwl_mvm_start_pmsr()
4963 mutex_unlock(&mvm->mutex); in iwl_mvm_start_pmsr()
4972 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_abort_pmsr() local
4974 mutex_lock(&mvm->mutex); in iwl_mvm_abort_pmsr()
4975 iwl_mvm_ftm_abort(mvm, request); in iwl_mvm_abort_pmsr()
4976 mutex_unlock(&mvm->mutex); in iwl_mvm_abort_pmsr()
4993 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_can_aggregate() local
4999 if (!iwl_mvm_is_csum_supported(mvm)) in iwl_mvm_mac_can_aggregate()