Lines Matching defs:mvm

5 #include "mvm.h"
10 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
15 mutex_lock(&mvm->mutex);
17 mvmvif->mvm = mvm;
25 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))
31 ret = iwl_mvm_mac_ctxt_init(mvm, vif);
35 rcu_assign_pointer(mvm->vif_id_to_mac[mvmvif->id], vif);
45 ret = iwl_mvm_mld_mac_ctxt_add(mvm, vif);
50 ret = iwl_mvm_disable_beacon_filter(mvm, vif);
54 if (!mvm->bf_allowed_vif &&
56 mvm->bf_allowed_vif = mvmvif;
61 ret = iwl_mvm_add_link(mvm, vif, &vif->bss_conf);
69 mvm->p2p_device_vif = vif;
71 ret = iwl_mvm_power_update_mac(mvm);
75 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;
98 if (mvm->bf_allowed_vif == mvmvif) {
99 mvm->bf_allowed_vif = NULL;
105 iwl_mvm_mld_mac_ctxt_remove(mvm, vif);
107 mutex_unlock(&mvm->mutex);
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 mutex_lock(&mvm->mutex);
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);
189 mutex_unlock(&mvm->mutex);
209 static int iwl_mvm_esr_mode_active(struct iwl_mvm *mvm,
220 iwl_mvm_update_smps_on_active_links(mvm, vif, IWL_MVM_SMPS_REQ_FW,
229 ret = iwl_mvm_phy_send_rlc(mvm, link->phy_ctxt, 2, 2);
240 __iwl_mvm_mld_assign_vif_chanctx(struct iwl_mvm *mvm,
247 struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id];
265 ret = iwl_mvm_mld_mac_ctxt_changed(mvm, vif, false);
267 IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr);
274 if (iwl_mvm_is_esr_supported(mvm->fwrt.trans) && n_active > 1) {
276 ret = iwl_mvm_esr_mode_active(mvm, vif);
278 IWL_ERR(mvm, "failed to activate ESR mode (%d)\n", ret);
290 ret = iwl_mvm_link_changed(mvm, vif, link_conf, 0, false);
305 !test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) {
312 iwl_mvm_rs_rate_init(mvm, vif, mvmvif->ap_sta,
319 ret = iwl_mvm_link_changed(mvm, vif, link_conf,
330 iwl_mvm_power_update_mac(mvm);
333 ret = iwl_mvm_mld_add_snif_sta(mvm, vif, link_conf);
341 iwl_mvm_link_changed(mvm, vif, link_conf, LINK_CONTEXT_MODIFY_ACTIVE,
345 iwl_mvm_power_update_mac(mvm);
354 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
357 mutex_lock(&mvm->mutex);
358 ret = __iwl_mvm_mld_assign_vif_chanctx(mvm, vif, link_conf, ctx, false);
359 mutex_unlock(&mvm->mutex);
364 static int iwl_mvm_esr_mode_inactive(struct iwl_mvm *mvm,
375 iwl_mvm_update_smps_on_active_links(mvm, vif, IWL_MVM_SMPS_REQ_FW,
401 ret = iwl_mvm_phy_send_rlc(mvm, phy_ctxt, static_chains,
411 __iwl_mvm_mld_unassign_vif_chanctx(struct iwl_mvm *mvm,
430 iwl_mvm_modify_all_sta_disable_tx(mvm, mvmvif, true);
433 rcu_assign_pointer(mvm->csa_tx_blocked_vif, vif);
438 iwl_mvm_link_changed(mvm, vif, link_conf,
441 if (iwl_mvm_is_esr_supported(mvm->fwrt.trans) && n_active > 1) {
442 int ret = iwl_mvm_esr_mode_inactive(mvm, vif);
445 IWL_ERR(mvm, "failed to deactivate ESR mode (%d)\n",
450 iwl_mvm_mld_rm_snif_sta(mvm, vif);
455 iwl_mvm_power_update_mac(mvm);
464 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
466 mutex_lock(&mvm->mutex);
467 __iwl_mvm_mld_unassign_vif_chanctx(mvm, vif, link_conf, ctx, false);
471 iwl_mvm_remove_link(mvm, vif, link_conf);
472 iwl_mvm_add_link(mvm, vif, link_conf);
474 mutex_unlock(&mvm->mutex);
481 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
485 mutex_lock(&mvm->mutex);
487 ret = iwl_mvm_mac_ctxt_beacon_changed(mvm, vif, link_conf);
492 ret = iwl_mvm_link_changed(mvm, vif, link_conf,
499 ret = iwl_mvm_mld_add_mcast_sta(mvm, vif, link_conf);
506 ret = iwl_mvm_mld_add_bcast_sta(mvm, vif, link_conf);
514 if (vif->p2p && mvm->p2p_device_vif)
515 iwl_mvm_mld_mac_ctxt_changed(mvm, mvm->p2p_device_vif, false);
517 iwl_mvm_bt_coex_vif_change(mvm);
520 if (iwl_mvm_phy_ctx_count(mvm) > 1)
521 iwl_mvm_teardown_tdls_peers(mvm);
523 iwl_mvm_ftm_restart_responder(mvm, vif, link_conf);
528 iwl_mvm_power_update_mac(mvm);
530 iwl_mvm_mld_rm_bcast_sta(mvm, vif, link_conf);
532 iwl_mvm_mld_rm_mcast_sta(mvm, vif, link_conf);
534 mutex_unlock(&mvm->mutex);
555 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
557 mutex_lock(&mvm->mutex);
559 iwl_mvm_stop_ap_ibss_common(mvm, vif);
562 if (vif->p2p && mvm->p2p_device_vif)
563 iwl_mvm_mld_mac_ctxt_changed(mvm, mvm->p2p_device_vif, false);
565 iwl_mvm_ftm_responder_clear(mvm, vif);
567 iwl_mvm_mld_rm_bcast_sta(mvm, vif, link_conf);
568 iwl_mvm_mld_rm_mcast_sta(mvm, vif, link_conf);
570 iwl_mvm_power_update_mac(mvm);
571 mutex_unlock(&mvm->mutex);
617 void iwl_mvm_mld_select_links(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
622 u32 max_active_links = iwl_mvm_max_active_links(mvm, vif);
727 iwl_mvm_mld_link_info_changed_station(struct iwl_mvm *mvm,
751 IWL_DEBUG_MAC80211(mvm, "Associated in HE mode\n");
760 ret = iwl_mvm_link_changed(mvm, vif, link_conf, link_changes,
763 IWL_ERR(mvm, "failed to update link\n");
766 ret = iwl_mvm_mld_mac_ctxt_changed(mvm, vif, false);
768 IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr);
771 iwl_mvm_mld_select_links(mvm, vif, true);
776 iwl_mvm_bss_info_changed_station_common(mvm, vif, link_conf, changes);
791 static void iwl_mvm_mld_vif_delete_all_stas(struct iwl_mvm *mvm,
797 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))
806 iwl_mvm_sec_key_remove_ap(mvm, vif, link, i);
807 ret = iwl_mvm_mld_rm_sta_id(mvm, link->ap_sta_id);
809 IWL_ERR(mvm, "failed to remove AP station\n");
815 static void iwl_mvm_mld_vif_cfg_changed_station(struct iwl_mvm *mvm,
831 ret = iwl_mvm_mld_mac_ctxt_changed(mvm, vif, false);
833 IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr);
840 iwl_mvm_request_statistics(mvm, true);
841 iwl_mvm_sf_update(mvm, vif, false);
842 iwl_mvm_power_vif_assoc(mvm, vif);
849 iwl_mvm_update_smps(mvm, vif,
861 if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) &&
878 iwl_mvm_protect_assoc(mvm, vif, 0, link_id);
881 iwl_mvm_sf_update(mvm, vif, false);
884 iwl_mvm_power_vif_assoc(mvm, vif);
886 iwl_mvm_mei_host_disassociated(mvm);
891 ret = iwl_mvm_sf_update(mvm, vif, false);
894 &mvm->status),
904 iwl_mvm_mld_vif_delete_all_stas(mvm, vif);
907 iwl_mvm_bss_info_changed_station_assoc(mvm, vif, changes);
911 ret = iwl_mvm_power_update_mac(mvm);
913 IWL_ERR(mvm, "failed to update power mode\n");
918 iwl_mvm_mld_link_info_changed_ap_ibss(struct iwl_mvm *mvm,
941 iwl_mvm_link_changed(mvm, vif, link_conf,
943 IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr);
947 iwl_mvm_mac_ctxt_beacon_changed(mvm, vif, link_conf))
948 IWL_WARN(mvm, "Failed updating beacon data\n");
952 int ret = iwl_mvm_ftm_start_responder(mvm, vif, link_conf);
955 IWL_WARN(mvm, "Failed to enable FTM responder (%d)\n",
965 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
967 mutex_lock(&mvm->mutex);
971 iwl_mvm_mld_link_info_changed_station(mvm, vif, link_conf,
976 iwl_mvm_mld_link_info_changed_ap_ibss(mvm, vif, link_conf,
981 iwl_mvm_update_mu_groups(mvm, vif);
989 IWL_DEBUG_CALIB(mvm, "Changing TX Power to %d dBm\n",
991 iwl_mvm_set_tx_power(mvm, vif, link_conf->txpower);
994 mutex_unlock(&mvm->mutex);
1001 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
1003 mutex_lock(&mvm->mutex);
1006 iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_SCHED, true);
1009 iwl_mvm_mld_vif_cfg_changed_station(mvm, vif, changes);
1011 mutex_unlock(&mvm->mutex);
1033 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
1044 mutex_lock(&mvm->mutex);
1045 iwl_mvm_mld_mac_ctxt_changed(mvm, vif, false);
1046 mutex_unlock(&mvm->mutex);
1055 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
1070 mutex_lock(&mvm->mutex);
1071 ret = iwl_mvm_link_changed(mvm, vif, &vif->bss_conf,
1074 mutex_unlock(&mvm->mutex);
1080 static int iwl_mvm_mld_roc_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
1084 lockdep_assert_held(&mvm->mutex);
1087 ret = iwl_mvm_link_changed(mvm, vif, &vif->bss_conf, 0, false);
1091 ret = iwl_mvm_link_changed(mvm, vif, &vif->bss_conf,
1102 return iwl_mvm_mld_add_bcast_sta(mvm, vif, &vif->bss_conf);
1125 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
1133 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))
1154 mutex_lock(&mvm->mutex);
1157 err = iwl_mvm_disable_link(mvm, vif, &vif->bss_conf);
1167 err = iwl_mvm_disable_link(mvm, vif, link_conf);
1180 &mvm->status))
1183 err = iwl_mvm_add_link(mvm, vif, link_conf);
1192 err = iwl_mvm_add_link(mvm, vif, &vif->bss_conf);
1197 mutex_unlock(&mvm->mutex);
1211 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
1214 mutex_lock(&mvm->mutex);
1215 ret = iwl_mvm_mld_update_sta_links(mvm, vif, sta, old_links, new_links);
1216 mutex_unlock(&mvm->mutex);
1226 int iwl_mvm_mld_get_primary_link(struct iwl_mvm *mvm,
1271 static bool iwl_mvm_can_enter_esr(struct iwl_mvm *mvm,
1276 int primary_link = iwl_mvm_mld_get_primary_link(mvm, vif,
1288 ext_capa = cfg80211_get_iftype_ext_capa(mvm->hw->wiphy,
1305 ret = iwl_mvm_bt_coex_calculate_esr_mode(mvm, vif, link_id,
1320 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
1327 mutex_lock(&mvm->mutex);
1330 if (n_links > iwl_mvm_max_active_links(mvm, vif)) {
1336 if (iwl_mvm_is_esr_supported(mvm->fwrt.trans))
1337 ret = iwl_mvm_can_enter_esr(mvm, vif, desired_links);
1339 mutex_unlock(&mvm->mutex);