Lines Matching refs:mvm
5 #include "mvm.h"
10 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
15 guard(mvm)(mvm);
17 iwl_mvm_mac_init_mvmvif(mvm, mvmvif);
19 mvmvif->mvm = mvm;
27 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))
33 ret = iwl_mvm_mac_ctxt_init(mvm, vif);
37 rcu_assign_pointer(mvm->vif_id_to_mac[mvmvif->id], vif);
47 ret = iwl_mvm_mld_mac_ctxt_add(mvm, vif);
52 ret = iwl_mvm_disable_beacon_filter(mvm, vif);
56 if (!mvm->bf_allowed_vif &&
58 mvm->bf_allowed_vif = mvmvif;
63 ret = iwl_mvm_add_link(mvm, vif, &vif->bss_conf);
71 mvm->p2p_device_vif = vif;
73 ret = iwl_mvm_power_update_mac(mvm);
77 iwl_mvm_tcm_add_vif(mvm, vif);
80 mvm->monitor_on = true;
81 ieee80211_hw_set(mvm->hw, RX_INCLUDES_FCS);
84 if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))
85 iwl_mvm_vif_dbgfs_add_link(mvm, vif);
87 if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) &&
89 !mvm->csme_vif && mvm->mei_registered) {
90 iwl_mei_set_nic_info(vif->addr, mvm->nvm_data->hw_addr);
92 mvm->csme_vif = vif;
95 if (vif->p2p || iwl_fw_lookup_cmd_ver(mvm->fw, PHY_CONTEXT_CMD, 1) < 5)
101 if (mvm->bf_allowed_vif == mvmvif) {
102 mvm->bf_allowed_vif = NULL;
108 iwl_mvm_mld_mac_ctxt_remove(mvm, vif);
115 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
119 iwl_mvm_prepare_mac_removal(mvm, vif);
123 iwl_mvm_tcm_rm_vif(mvm, vif);
125 guard(mvm)(mvm);
127 if (vif == mvm->csme_vif) {
129 mvm->csme_vif = NULL;
132 if (mvm->bf_allowed_vif == mvmvif) {
133 mvm->bf_allowed_vif = NULL;
139 memset(&mvm->ftm_resp_stats, 0, sizeof(mvm->ftm_resp_stats));
141 iwl_mvm_vif_dbgfs_rm_link(mvm, vif);
149 if (vif == mvm->noa_vif) {
150 mvm->noa_vif = NULL;
151 mvm->noa_duration = 0;
156 iwl_mvm_power_update_mac(mvm);
165 iwl_mvm_phy_ctxt_unref(mvm, mvmvif->deflink.phy_ctxt);
168 mvm->p2p_device_vif = NULL;
169 iwl_mvm_remove_link(mvm, vif, &vif->bss_conf);
171 iwl_mvm_disable_link(mvm, vif, &vif->bss_conf);
174 iwl_mvm_mld_mac_ctxt_remove(mvm, vif);
176 RCU_INIT_POINTER(mvm->vif_id_to_mac[mvmvif->id], NULL);
179 lockdep_is_held(&mvm->mutex));
185 mvm->monitor_on = false;
186 __clear_bit(IEEE80211_HW_RX_INCLUDES_FCS, mvm->hw->flags);
203 static void iwl_mvm_restart_mpdu_count(struct iwl_mvm *mvm,
209 lockdep_assert_held(&mvm->mutex);
218 for (int q = 0; q < mvm->trans->num_rx_queues; q++) {
226 IWL_DEBUG_STATS(mvm, "MPDU counters are cleared\n");
229 static int iwl_mvm_esr_mode_active(struct iwl_mvm *mvm,
240 iwl_mvm_update_smps_on_active_links(mvm, vif, IWL_MVM_SMPS_REQ_FW,
249 ret = iwl_mvm_phy_send_rlc(mvm, link->phy_ctxt, 2, 2);
263 iwl_mvm_request_periodic_system_statistics(mvm, true);
270 iwl_mvm_restart_mpdu_count(mvm, mvmvif);
276 __iwl_mvm_mld_assign_vif_chanctx(struct iwl_mvm *mvm,
283 struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id];
301 ret = iwl_mvm_mld_mac_ctxt_changed(mvm, vif, false);
303 IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr);
310 if (iwl_mvm_is_esr_supported(mvm->fwrt.trans) && n_active > 1) {
312 ret = iwl_mvm_esr_mode_active(mvm, vif);
314 IWL_ERR(mvm, "failed to activate ESR mode (%d)\n", ret);
315 iwl_mvm_request_periodic_system_statistics(mvm, false);
327 ret = iwl_mvm_link_changed(mvm, vif, link_conf, 0, false);
344 iwl_mvm_rs_rate_init(mvm, vif, mvmvif->ap_sta,
351 iwl_mvm_send_ap_tx_power_constraint_cmd(mvm, vif,
356 ret = iwl_mvm_link_changed(mvm, vif, link_conf,
367 iwl_mvm_power_update_mac(mvm);
370 ret = iwl_mvm_mld_add_snif_sta(mvm, vif, link_conf);
378 iwl_mvm_link_changed(mvm, vif, link_conf, LINK_CONTEXT_MODIFY_ACTIVE,
382 iwl_mvm_power_update_mac(mvm);
391 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
397 ret = iwl_mvm_esr_non_bss_link(mvm, vif, link_conf->link_id,
407 guard(mvm)(mvm);
408 return __iwl_mvm_mld_assign_vif_chanctx(mvm, vif, link_conf, ctx, false);
411 static int iwl_mvm_esr_mode_inactive(struct iwl_mvm *mvm,
422 iwl_mvm_update_smps_on_active_links(mvm, vif, IWL_MVM_SMPS_REQ_FW,
448 ret = iwl_mvm_phy_send_rlc(mvm, phy_ctxt, static_chains,
454 iwl_mvm_request_periodic_system_statistics(mvm, false);
457 iwl_mvm_restart_mpdu_count(mvm, mvmvif);
463 __iwl_mvm_mld_unassign_vif_chanctx(struct iwl_mvm *mvm,
482 iwl_mvm_modify_all_sta_disable_tx(mvm, mvmvif, true);
485 rcu_assign_pointer(mvm->csa_tx_blocked_vif, vif);
490 iwl_mvm_link_changed(mvm, vif, link_conf,
493 if (iwl_mvm_is_esr_supported(mvm->fwrt.trans) && n_active > 1) {
494 int ret = iwl_mvm_esr_mode_inactive(mvm, vif);
497 IWL_ERR(mvm, "failed to deactivate ESR mode (%d)\n",
502 iwl_mvm_mld_rm_snif_sta(mvm, vif);
507 iwl_mvm_power_update_mac(mvm);
516 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
518 mutex_lock(&mvm->mutex);
519 __iwl_mvm_mld_unassign_vif_chanctx(mvm, vif, link_conf, ctx, false);
523 iwl_mvm_remove_link(mvm, vif, link_conf);
524 iwl_mvm_add_link(mvm, vif, link_conf);
526 mutex_unlock(&mvm->mutex);
530 iwl_mvm_esr_non_bss_link(mvm, vif, link_conf->link_id, false);
561 iwl_mvm_send_ap_tx_power_constraint_cmd(struct iwl_mvm *mvm,
571 u32 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, cmd_id,
575 lockdep_assert_held(&mvm->mutex);
600 ret = iwl_mvm_send_cmd_pdu(mvm,
605 IWL_ERR(mvm,
614 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
618 guard(mvm)(mvm);
621 iwl_mvm_send_ap_tx_power_constraint_cmd(mvm, vif,
625 ret = iwl_mvm_mac_ctxt_beacon_changed(mvm, vif, link_conf);
630 ret = iwl_mvm_link_changed(mvm, vif, link_conf,
637 ret = iwl_mvm_mld_add_mcast_sta(mvm, vif, link_conf);
644 ret = iwl_mvm_mld_add_bcast_sta(mvm, vif, link_conf);
652 if (vif->p2p && mvm->p2p_device_vif)
653 iwl_mvm_mld_mac_ctxt_changed(mvm, mvm->p2p_device_vif, false);
655 iwl_mvm_bt_coex_vif_change(mvm);
658 if (iwl_mvm_phy_ctx_count(mvm) > 1)
659 iwl_mvm_teardown_tdls_peers(mvm);
661 iwl_mvm_ftm_restart_responder(mvm, vif, link_conf);
666 iwl_mvm_power_update_mac(mvm);
668 iwl_mvm_mld_rm_bcast_sta(mvm, vif, link_conf);
670 iwl_mvm_mld_rm_mcast_sta(mvm, vif, link_conf);
691 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
693 guard(mvm)(mvm);
695 iwl_mvm_stop_ap_ibss_common(mvm, vif);
698 if (vif->p2p && mvm->p2p_device_vif)
699 iwl_mvm_mld_mac_ctxt_changed(mvm, mvm->p2p_device_vif, false);
701 iwl_mvm_ftm_responder_clear(mvm, vif);
703 iwl_mvm_mld_rm_bcast_sta(mvm, vif, link_conf);
704 iwl_mvm_mld_rm_mcast_sta(mvm, vif, link_conf);
706 iwl_mvm_power_update_mac(mvm);
739 static bool iwl_mvm_esr_bw_criteria(struct iwl_mvm *mvm,
759 iwl_mvm_mld_link_info_changed_station(struct iwl_mvm *mvm,
783 IWL_DEBUG_MAC80211(mvm, "Associated in HE mode\n");
790 !iwl_mvm_esr_bw_criteria(mvm, vif, link_conf))
791 iwl_mvm_exit_esr(mvm, vif,
800 ret = iwl_mvm_link_changed(mvm, vif, link_conf, link_changes,
803 IWL_ERR(mvm, "failed to update link\n");
806 ret = iwl_mvm_mld_mac_ctxt_changed(mvm, vif, false);
808 IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr);
813 iwl_mvm_bss_info_changed_station_common(mvm, vif, link_conf, changes);
828 static void iwl_mvm_mld_vif_delete_all_stas(struct iwl_mvm *mvm,
834 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))
843 iwl_mvm_sec_key_remove_ap(mvm, vif, link, i);
844 ret = iwl_mvm_mld_rm_sta_id(mvm, link->ap_sta_id);
846 IWL_ERR(mvm, "failed to remove AP station\n");
852 static void iwl_mvm_mld_vif_cfg_changed_station(struct iwl_mvm *mvm,
868 ret = iwl_mvm_mld_mac_ctxt_changed(mvm, vif, false);
870 IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr);
879 iwl_mvm_request_statistics(mvm, true);
880 iwl_mvm_sf_update(mvm, vif, false);
881 iwl_mvm_power_vif_assoc(mvm, vif);
888 iwl_mvm_update_smps(mvm, vif,
900 if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) &&
917 iwl_mvm_protect_assoc(mvm, vif, 0, link_id);
920 iwl_mvm_sf_update(mvm, vif, false);
923 iwl_mvm_power_vif_assoc(mvm, vif);
925 iwl_mvm_mei_host_disassociated(mvm);
930 ret = iwl_mvm_sf_update(mvm, vif, false);
933 &mvm->status),
943 iwl_mvm_mld_vif_delete_all_stas(mvm, vif);
946 iwl_mvm_bss_info_changed_station_assoc(mvm, vif, changes);
950 ret = iwl_mvm_power_update_mac(mvm);
952 IWL_ERR(mvm, "failed to update power mode\n");
957 wiphy_delayed_work_queue(mvm->hw->wiphy,
962 iwl_mvm_mld_link_info_changed_ap_ibss(struct iwl_mvm *mvm,
985 iwl_mvm_link_changed(mvm, vif, link_conf,
987 IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr);
991 iwl_mvm_mac_ctxt_beacon_changed(mvm, vif, link_conf))
992 IWL_WARN(mvm, "Failed updating beacon data\n");
996 int ret = iwl_mvm_ftm_start_responder(mvm, vif, link_conf);
999 IWL_WARN(mvm, "Failed to enable FTM responder (%d)\n",
1009 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
1011 guard(mvm)(mvm);
1015 iwl_mvm_mld_link_info_changed_station(mvm, vif, link_conf,
1020 iwl_mvm_mld_link_info_changed_ap_ibss(mvm, vif, link_conf,
1025 iwl_mvm_update_mu_groups(mvm, vif);
1033 IWL_DEBUG_CALIB(mvm, "Changing TX Power to %d dBm\n",
1035 iwl_mvm_set_tx_power(mvm, vif, link_conf->txpower);
1043 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
1045 guard(mvm)(mvm);
1048 iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_SCHED, true);
1051 iwl_mvm_mld_vif_cfg_changed_station(mvm, vif, changes);
1073 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
1084 guard(mvm)(mvm);
1085 iwl_mvm_mld_mac_ctxt_changed(mvm, vif, false);
1094 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
1107 guard(mvm)(mvm);
1108 return iwl_mvm_link_changed(mvm, vif, &vif->bss_conf,
1115 static int iwl_mvm_mld_roc_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
1119 lockdep_assert_held(&mvm->mutex);
1122 ret = iwl_mvm_link_changed(mvm, vif, &vif->bss_conf, 0, false);
1126 ret = iwl_mvm_link_changed(mvm, vif, &vif->bss_conf,
1137 return iwl_mvm_mld_add_bcast_sta(mvm, vif, &vif->bss_conf);
1160 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
1168 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))
1189 mutex_lock(&mvm->mutex);
1192 err = iwl_mvm_disable_link(mvm, vif, &vif->bss_conf);
1202 err = iwl_mvm_disable_link(mvm, vif, link_conf);
1215 &mvm->status))
1218 err = iwl_mvm_add_link(mvm, vif, link_conf);
1227 err = iwl_mvm_add_link(mvm, vif, &vif->bss_conf);
1240 mutex_unlock(&mvm->mutex);
1254 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
1256 guard(mvm)(mvm);
1257 return iwl_mvm_mld_update_sta_links(mvm, vif, sta, old_links, new_links);
1260 bool iwl_mvm_vif_has_esr_cap(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
1264 lockdep_assert_held(&mvm->mutex);
1273 ext_capa = cfg80211_get_iftype_ext_capa(mvm->hw->wiphy,
1283 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
1289 guard(mvm)(mvm);
1292 if (n_links > iwl_mvm_max_active_links(mvm, vif))
1296 return iwl_mvm_is_esr_supported(mvm->fwrt.trans) &&
1297 iwl_mvm_vif_has_esr_cap(mvm, vif);
1324 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
1327 mutex_lock(&mvm->mutex);
1338 iwl_mvm_exit_esr(mvm, vif, IWL_MVM_ESR_EXIT_CSA, selected);
1339 mutex_unlock(&mvm->mutex);
1348 mutex_lock(&mvm->mutex);
1351 ret = iwl_mvm_pre_channel_switch(mvm, vif, chsw);
1352 mutex_unlock(&mvm->mutex);