Lines Matching refs:vif

88 				 struct ieee80211_vif *vif,
838 if (!sta && info->control.vif->type == NL80211_IFTYPE_STATION &&
841 iwl_mvm_vif_from_mac80211(info->control.vif);
858 rcu_dereference(info->control.vif->link_conf[link_id]);
966 iwl_mvm_ampdu_check_trigger(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
973 trig = iwl_fw_dbg_trigger_on(&mvm->fwrt, ieee80211_vif_to_wdev(vif),
1011 struct ieee80211_vif *vif,
1034 if (iwl_mvm_vif_from_mac80211(vif)->deflink.ap_sta_id ==
1037 u16 macid = iwl_mvm_vif_from_mac80211(vif)->id;
1041 mvmvif = iwl_mvm_vif_from_mac80211(vif);
1060 ret = iwl_mvm_sta_tx_agg_start(mvm, vif, sta, tid, ssn);
1063 ret = iwl_mvm_sta_tx_agg_stop(mvm, vif, sta, tid);
1067 ret = iwl_mvm_sta_tx_agg_flush(mvm, vif, sta, tid);
1070 ret = iwl_mvm_sta_tx_agg_oper(mvm, vif, sta, tid,
1085 iwl_mvm_ampdu_check_trigger(mvm, vif, sta, tid,
1094 struct ieee80211_vif *vif)
1097 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
1112 vif->driver_flags &= ~IEEE80211_VIF_EML_ACTIVE;
1135 struct ieee80211_vif *vif;
1139 vif = mvm_sta->vif;
1150 if (mvm_link_sta && !(vif->active_links & BIT(link_id))) {
1442 int iwl_mvm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
1450 cpu_to_le32(iwl_mvm_vif_from_mac80211(vif)->id),
1495 struct ieee80211_vif *vif,
1498 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
1504 if (vif->type == NL80211_IFTYPE_STATION) {
1520 iwl_mvm_mld_mac_ctxt_changed(mvm, vif, false);
1522 iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL);
1526 ret = iwl_mvm_enable_beacon_filter(mvm, vif);
1530 iwl_mvm_stop_session_protection(mvm, vif);
1532 } else if (vif->type == NL80211_IFTYPE_AP && mvmvif->csa_blocks_tx) {
1534 iwl_mvm_txq_from_mac80211(vif->txq);
1539 iwl_mvm_mac_itxq_xmit(hw, vif->txq);
1559 struct ieee80211_vif *vif,
1563 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
1584 iwl_mvm_remove_csa_period(mvm, vif);
1594 iwl_mvm_post_channel_switch(hw, vif, &vif->bss_conf);
1600 struct ieee80211_vif *vif;
1603 vif = container_of((void *)mvmvif, struct ieee80211_vif, drv_priv);
1606 ieee80211_chswitch_done(vif, false, 0);
1632 struct ieee80211_vif *vif)
1634 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
1639 ret = iwl_mvm_alloc_bcast_sta(mvm, vif);
1649 vif->type,
1659 struct ieee80211_vif *vif = iwl_mvm_get_bss_vif(mvm);
1662 iwl_mvm_unblock_esr(mvm, vif, IWL_MVM_ESR_BLOCKED_PREVENTION);
1670 struct ieee80211_vif *vif =
1675 iwl_mvm_int_mlo_scan(mvmvif->mvm, vif);
1685 struct ieee80211_vif *vif = iwl_mvm_get_bss_vif(mvm);
1688 iwl_mvm_unblock_esr(mvm, vif, IWL_MVM_ESR_BLOCKED_TPT);
1713 struct ieee80211_vif *vif)
1716 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
1731 ret = iwl_mvm_set_link_mapping(mvm, vif, &vif->bss_conf);
1748 ret = iwl_mvm_mac_ctxt_init(mvm, vif);
1752 rcu_assign_pointer(mvm->vif_id_to_mac[mvmvif->id], vif);
1755 if (vif->type == NL80211_IFTYPE_NAN) {
1771 if (vif->type == NL80211_IFTYPE_AP ||
1772 vif->type == NL80211_IFTYPE_ADHOC) {
1774 iwl_mvm_vif_dbgfs_add_link(mvm, vif);
1781 ret = iwl_mvm_mac_ctxt_add(mvm, vif);
1790 ret = iwl_mvm_disable_beacon_filter(mvm, vif);
1795 vif->type == NL80211_IFTYPE_STATION && !vif->p2p) {
1797 vif->driver_flags |= IEEE80211_VIF_BEACON_FILTER |
1801 if (vif->type == NL80211_IFTYPE_P2P_DEVICE)
1802 mvm->p2p_device_vif = vif;
1804 iwl_mvm_tcm_add_vif(mvm, vif);
1806 if (vif->type == NL80211_IFTYPE_MONITOR) {
1809 iwl_mvm_chandef_get_primary_80(&vif->bss_conf.chanreq.oper);
1813 iwl_mvm_vif_dbgfs_add_link(mvm, vif);
1816 vif->type == NL80211_IFTYPE_STATION && !vif->p2p &&
1818 iwl_mei_set_nic_info(vif->addr, mvm->nvm_data->hw_addr);
1819 iwl_mei_set_netdev(ieee80211_vif_to_wdev(vif)->netdev);
1820 mvm->csme_vif = vif;
1824 if (!ret && (vif->type == NL80211_IFTYPE_AP ||
1825 vif->type == NL80211_IFTYPE_ADHOC))
1826 ret = iwl_mvm_alloc_bcast_mcast_sta(mvm, vif);
1832 iwl_mvm_mac_ctxt_remove(mvm, vif);
1840 struct ieee80211_vif *vif)
1842 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
1844 if (vif->type == NL80211_IFTYPE_P2P_DEVICE) {
1869 struct ieee80211_vif *vif)
1872 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
1875 iwl_mvm_prepare_mac_removal(mvm, vif);
1877 if (!(vif->type == NL80211_IFTYPE_AP ||
1878 vif->type == NL80211_IFTYPE_ADHOC))
1879 iwl_mvm_tcm_rm_vif(mvm, vif);
1883 if (vif == mvm->csme_vif) {
1896 vif->driver_flags &= ~(IEEE80211_VIF_BEACON_FILTER |
1900 if (vif->bss_conf.ftm_responder)
1903 iwl_mvm_vif_dbgfs_rm_link(mvm, vif);
1909 if (vif->type == NL80211_IFTYPE_AP ||
1910 vif->type == NL80211_IFTYPE_ADHOC) {
1912 if (vif == mvm->noa_vif) {
1925 struct ieee80211_vif *vif)
1928 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
1930 if (iwl_mvm_mac_remove_interface_common(hw, vif))
1938 if (vif->type == NL80211_IFTYPE_P2P_DEVICE) {
1946 iwl_mvm_unset_link_mapping(mvm, vif, &vif->bss_conf);
1947 iwl_mvm_mac_ctxt_remove(mvm, vif);
1951 if (vif->type == NL80211_IFTYPE_MONITOR)
1955 if (vif->type == NL80211_IFTYPE_AP ||
1956 vif->type == NL80211_IFTYPE_ADHOC) {
1958 iwl_mvm_dealloc_bcast_sta(mvm, vif);
1970 struct ieee80211_vif *vif)
1986 if (vif->type != NL80211_IFTYPE_STATION ||
1987 !vif->cfg.assoc)
1991 memcpy(cmd->bssid, vif->bss_conf.bssid, ETH_ALEN);
2101 struct ieee80211_vif *vif,
2112 if (vif->type != NL80211_IFTYPE_STATION || !vif->cfg.assoc ||
2113 !vif->p2p)
2117 iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL);
2121 int iwl_mvm_update_mu_groups(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
2125 memcpy(cmd.membership_status, vif->bss_conf.mu_group.membership,
2127 memcpy(cmd.user_position, vif->bss_conf.mu_group.position,
2137 struct ieee80211_vif *vif)
2139 if (vif->bss_conf.mu_mimo_owner) {
2147 ieee80211_update_mu_groups(vif, 0,
2466 bool iwl_mvm_is_nic_ack_enabled(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
2475 own_he_cap = ieee80211_get_he_iftype_cap_vif(sband, vif);
2515 struct ieee80211_vif *vif, u8 sta_id)
2517 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
2521 .bss_color = vif->bss_conf.he_bss_color.color,
2522 .htc_trig_based_pkt_ext = vif->bss_conf.htc_trig_based_pkt_ext,
2524 cpu_to_le16(vif->bss_conf.frame_time_rts_th),
2598 if (vif->bss_conf.uora_exists) {
2602 vif->bss_conf.uora_ocw_range & 0x7;
2604 (vif->bss_conf.uora_ocw_range >> 3) & 0x7;
2607 if (!iwl_mvm_is_nic_ack_enabled(mvm, vif))
2610 if (vif->bss_conf.nontransmitted) {
2613 vif->bss_conf.transmitter_bssid);
2615 vif->bss_conf.bssid_indicator;
2616 sta_ctxt_cmd.bssid_index = vif->bss_conf.bssid_index;
2617 sta_ctxt_cmd.ema_ap = vif->bss_conf.ema_ap;
2619 vif->bss_conf.profile_periodicity;
2667 void iwl_mvm_protect_assoc(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
2687 iwl_mvm_schedule_session_protection(mvm, vif, 900,
2691 iwl_mvm_protect_session(mvm, vif, duration,
2697 struct ieee80211_vif *vif,
2700 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
2708 (changes & BSS_CHANGED_MU_GROUPS) && vif->bss_conf.mu_mimo_owner) {
2709 ret = iwl_mvm_update_mu_groups(mvm, vif);
2722 iwl_mvm_update_smps_on_active_links(mvm, vif, IWL_MVM_SMPS_REQ_TT,
2732 struct ieee80211_vif *vif,
2736 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
2743 iwl_mvm_stop_session_protection(mvm, vif);
2745 iwl_mvm_sf_update(mvm, vif, false);
2746 WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif));
2771 ret = iwl_mvm_enable_beacon_filter(mvm, vif);
2779 iwl_mvm_update_link_smps(vif, link_conf);
2783 struct ieee80211_vif *vif,
2787 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
2796 if (changes & BSS_CHANGED_ASSOC && vif->cfg.assoc) {
2797 if ((vif->bss_conf.he_support &&
2799 iwl_mvm_cfg_he_sta(mvm, vif, mvmvif->deflink.ap_sta_id);
2801 iwl_mvm_mac_ctxt_recalc_tsf_id(mvm, vif);
2806 vif->cfg.assoc &&
2807 (vif->bss_conf.he_support && !iwlwifi_mod_params.disable_11ax))
2808 iwl_mvm_cfg_he_sta(mvm, vif, mvmvif->deflink.ap_sta_id);
2819 ret = iwl_mvm_mac_ctxt_changed(mvm, vif, false, mvmvif->deflink.bssid);
2821 IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr);
2825 mvmvif->associated = vif->cfg.assoc;
2828 if (vif->cfg.assoc) {
2864 u32 dur = (11 * vif->bss_conf.beacon_int) / 10;
2865 iwl_mvm_protect_session(mvm, vif, dur, dur,
2869 !vif->bss_conf.dtim_period) {
2880 iwl_mvm_protect_assoc(mvm, vif, 0, 0);
2883 iwl_mvm_sf_update(mvm, vif, false);
2884 iwl_mvm_power_vif_assoc(mvm, vif);
2885 if (vif->p2p) {
2886 iwl_mvm_update_smps(mvm, vif,
2896 ret = iwl_mvm_sf_update(mvm, vif, false);
2904 * station has been added, but before the vif is set
2906 * then configure the vif. Since the vif is not
2913 iwl_mvm_sec_key_remove_ap(mvm, vif,
2920 ret = iwl_mvm_rm_sta_id(mvm, vif,
2935 ret = iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL);
2939 vif->addr);
2942 iwl_mvm_bss_info_changed_station_assoc(mvm, vif, changes);
2945 iwl_mvm_bss_info_changed_station_common(mvm, vif, &vif->bss_conf,
2950 struct ieee80211_vif *vif,
2954 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
2973 *ret = __iwl_mvm_mac_set_key(hw, SET_KEY, vif, NULL, key);
2978 if (vif->type == NL80211_IFTYPE_AP && !vif->p2p) {
2991 struct ieee80211_vif *vif,
2995 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
3005 if (vif->type == NL80211_IFTYPE_AP)
3006 iwl_mvm_mac_ctxt_recalc_tsf_id(mvm, vif);
3014 ret = iwl_mvm_mac_ctxt_add(mvm, vif);
3019 ret = iwl_mvm_mac_ctxt_beacon_changed(mvm, vif, link_conf);
3024 ret = iwl_mvm_mac_ctxt_beacon_changed(mvm, vif, link_conf);
3029 ret = iwl_mvm_mac_ctxt_add(mvm, vif);
3035 ret = iwl_mvm_binding_add_vif(mvm, vif);
3047 ret = iwl_mvm_add_mcast_sta(mvm, vif);
3054 ret = iwl_mvm_send_add_bcast_sta(mvm, vif);
3056 iwl_mvm_rm_mcast_sta(mvm, vif);
3064 ret = iwl_mvm_send_add_bcast_sta(mvm, vif);
3067 ret = iwl_mvm_add_mcast_sta(mvm, vif);
3069 iwl_mvm_send_rm_bcast_sta(mvm, vif);
3074 if (iwl_mvm_start_ap_ibss_common(hw, vif, &ret))
3081 /* Need to update the P2P Device MAC (only GO, IBSS is single vif) */
3082 if (vif->p2p && mvm->p2p_device_vif)
3091 iwl_mvm_ftm_restart_responder(mvm, vif, &vif->bss_conf);
3098 iwl_mvm_send_rm_bcast_sta(mvm, vif);
3099 iwl_mvm_rm_mcast_sta(mvm, vif);
3101 iwl_mvm_binding_remove_vif(mvm, vif);
3103 iwl_mvm_mac_ctxt_remove(mvm, vif);
3110 struct ieee80211_vif *vif,
3113 return iwl_mvm_start_ap_ibss(hw, vif, link_conf);
3117 struct ieee80211_vif *vif)
3119 return iwl_mvm_start_ap_ibss(hw, vif, &vif->bss_conf);
3124 struct ieee80211_vif *vif)
3126 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
3130 iwl_mvm_prepare_mac_removal(mvm, vif);
3133 if (rcu_access_pointer(mvm->csa_vif) == vif) {
3140 if (rcu_access_pointer(mvm->csa_tx_blocked_vif) == vif) {
3148 if (vif->type == NL80211_IFTYPE_AP && !vif->p2p) {
3158 struct ieee80211_vif *vif,
3165 iwl_mvm_stop_ap_ibss_common(mvm, vif);
3167 /* Need to update the P2P Device MAC (only GO, IBSS is single vif) */
3168 if (vif->p2p && mvm->p2p_device_vif)
3173 iwl_mvm_ftm_responder_clear(mvm, vif);
3184 iwl_mvm_rm_mcast_sta(mvm, vif);
3185 iwl_mvm_send_rm_bcast_sta(mvm, vif);
3187 iwl_mvm_rm_mcast_sta(mvm, vif);
3188 iwl_mvm_binding_remove_vif(mvm, vif);
3192 iwl_mvm_mac_ctxt_remove(mvm, vif);
3198 struct ieee80211_vif *vif,
3201 iwl_mvm_stop_ap_ibss(hw, vif, link_conf);
3205 struct ieee80211_vif *vif)
3207 iwl_mvm_stop_ap_ibss(hw, vif, &vif->bss_conf);
3212 struct ieee80211_vif *vif,
3216 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
3224 iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL))
3225 IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr);
3229 iwl_mvm_mac_ctxt_beacon_changed(mvm, vif, &vif->bss_conf))
3233 int ret = iwl_mvm_ftm_start_responder(mvm, vif, &vif->bss_conf);
3243 struct ieee80211_vif *vif,
3251 if (changes & BSS_CHANGED_IDLE && !vif->cfg.idle)
3254 switch (vif->type) {
3256 iwl_mvm_bss_info_changed_station(mvm, vif, bss_conf, changes);
3260 iwl_mvm_bss_info_changed_ap_ibss(mvm, vif, bss_conf, changes);
3264 iwl_mvm_update_mu_groups(mvm, vif);
3274 iwl_mvm_set_tx_power(mvm, vif, bss_conf->txpower);
3280 int iwl_mvm_mac_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
3291 ret = iwl_mvm_reg_scan_start(mvm, vif, &hw_req->req, &hw_req->ies);
3298 struct ieee80211_vif *vif)
3406 void iwl_mvm_mac_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
3432 if (!mvmsta->vif ||
3433 mvmsta->vif->type != NL80211_IFTYPE_AP) {
3466 struct ieee80211_vif *vif,
3503 static void iwl_mvm_check_uapsd(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
3511 mdata = &mvm->tcm.data[iwl_mvm_vif_from_mac80211(vif)->id];
3519 if (vif->p2p && !iwl_mvm_is_p2p_scm_uapsd_supported(mvm)) {
3520 vif->driver_flags &= ~IEEE80211_VIF_SUPPORTS_UAPSD;
3524 if (!vif->p2p &&
3526 vif->driver_flags &= ~IEEE80211_VIF_SUPPORTS_UAPSD;
3532 vif->driver_flags &= ~IEEE80211_VIF_SUPPORTS_UAPSD;
3537 vif->driver_flags |= IEEE80211_VIF_SUPPORTS_UAPSD;
3542 struct ieee80211_vif *vif, u8 *peer_addr,
3548 trig = iwl_fw_dbg_trigger_on(&mvm->fwrt, ieee80211_vif_to_wdev(vif),
3594 struct ieee80211_vif *vif,
3598 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
3624 struct ieee80211_vif *vif)
3629 if (vif->type != NL80211_IFTYPE_STATION)
3644 he_cap = ieee80211_get_he_iftype_cap_vif(sband, vif);
3656 struct ieee80211_vif *vif,
3660 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
3662 .ssid_len = vif->cfg.ssid_len,
3672 if (!vif->bss_conf.chanreq.oper.chan)
3675 conn_info.channel = vif->bss_conf.chanreq.oper.chan->hw_value;
3718 memcpy(conn_info.ssid, vif->cfg.ssid, vif->cfg.ssid_len);
3719 memcpy(conn_info.bssid, vif->bss_conf.bssid, ETH_ALEN);
3727 struct ieee80211_vif *vif,
3730 return iwl_mvm_mac_ctxt_changed(mvm, vif, force_assoc_off, NULL);
3734 struct ieee80211_vif *vif,
3746 return iwl_mvm_mac_sta_state_common(hw, vif, sta, old_state, new_state,
3752 * (2) if a link is valid in sta then it's valid in vif (can
3756 struct ieee80211_vif *vif,
3759 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
3764 link_conf_dereference_check(vif, link_id);
3771 iwl_mvm_rs_rate_init(mvm, vif, sta, conf, link_sta,
3779 struct ieee80211_vif *vif,
3792 for_each_sta_active_link(vif, sta, link_sta, link_id) {
3794 link_conf_dereference_protected(vif, link_id);
3813 struct ieee80211_vif *vif,
3817 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
3821 for_each_sta_active_link(vif, sta, link_sta, link_id) {
3823 link_conf_dereference_protected(vif, link_id);
3833 iwl_mvm_check_he_obss_narrow_bw_ru(hw, vif,
3842 struct ieee80211_vif *vif,
3846 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
3853 if (vif->type == NL80211_IFTYPE_STATION &&
3854 !iwl_mvm_vif_conf_from_sta(mvm, vif, sta))
3858 (vif->p2p ||
3865 ret = callbacks->add_sta(mvm, vif, sta);
3867 iwl_mvm_recalc_tdls_state(mvm, vif, true);
3868 iwl_mvm_tdls_check_trigger(mvm, vif, sta->addr,
3875 for_each_sta_active_link(vif, sta, link_sta, i)
3880 if (vif->type == NL80211_IFTYPE_STATION && !sta->tdls)
3894 iwl_mvm_rs_rate_init_all_links(mvm, vif, sta);
3902 struct ieee80211_vif *vif,
3906 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
3913 if (vif->type == NL80211_IFTYPE_AP) {
3914 iwl_mvm_vif_set_he_support(hw, vif, sta, false);
3916 callbacks->mac_ctxt_changed(mvm, vif, false);
3922 (vif->bss_conf.he_support &&
3924 iwl_mvm_cfg_he_sta(mvm, vif, mvm_sta->deflink.sta_id);
3925 } else if (vif->type == NL80211_IFTYPE_STATION) {
3926 iwl_mvm_vif_set_he_support(hw, vif, sta, true);
3928 callbacks->mac_ctxt_changed(mvm, vif, false);
3933 for_each_sta_active_link(vif, sta, link_sta, link_id) {
3935 link_conf_dereference_protected(vif, link_id);
3942 iwl_mvm_link_changed(mvm, vif, link_conf,
3950 iwl_mvm_rs_rate_init_all_links(mvm, vif, sta);
3952 return callbacks->update_sta(mvm, vif, sta);
3957 struct ieee80211_vif *vif,
3961 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
3971 iwl_mvm_tdls_check_trigger(mvm, vif, sta->addr,
3975 WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif));
3980 mvmvif->link_selection_res = vif->active_links;
3982 vif->active_links ? __ffs(vif->active_links) : 0;
3985 callbacks->mac_ctxt_changed(mvm, vif, false);
3986 iwl_mvm_mei_host_associated(mvm, vif, mvm_sta);
3991 iwl_mvm_block_esr(mvm, vif, IWL_MVM_ESR_BLOCKED_TPT, 0);
3994 iwl_mvm_block_esr(mvm, vif, IWL_MVM_ESR_BLOCKED_FW, 0);
3999 if (vif->type == NL80211_IFTYPE_STATION &&
4001 iwl_mvm_select_links(mvm, vif);
4010 int ret = callbacks->update_sta(mvm, vif, sta);
4016 iwl_mvm_rs_rate_init_all_links(mvm, vif, sta);
4023 struct ieee80211_vif *vif,
4027 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
4037 iwl_mvm_rs_rate_init_all_links(mvm, vif, sta);
4048 iwl_mvm_disable_beacon_filter(mvm, vif);
4059 if (ieee80211_vif_is_mld(vif) && mvmvif->esr_active)
4068 struct ieee80211_vif *vif,
4075 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
4110 iwl_mvm_reset_cca_40mhz_workaround(mvm, vif);
4123 for_each_sta_active_link(vif, sta, link_sta, link_id) {
4137 ret = iwl_mvm_sta_state_notexist_to_none(mvm, vif, sta,
4148 iwl_mvm_check_uapsd(mvm, vif, sta->addr);
4152 ret = iwl_mvm_sta_state_auth_to_assoc(hw, mvm, vif, sta,
4156 ret = iwl_mvm_sta_state_assoc_to_authorized(mvm, vif, sta,
4160 ret = iwl_mvm_sta_state_authorized_to_assoc(mvm, vif, sta,
4164 if (vif->type == NL80211_IFTYPE_AP) {
4166 callbacks->mac_ctxt_changed(mvm, vif, false);
4167 } else if (vif->type == NL80211_IFTYPE_STATION && !sta->tdls)
4168 iwl_mvm_stop_session_protection(mvm, vif);
4175 if (vif->type == NL80211_IFTYPE_STATION && !sta->tdls) {
4176 iwl_mvm_stop_session_protection(mvm, vif);
4179 ret = callbacks->rm_sta(mvm, vif, sta);
4181 iwl_mvm_recalc_tdls_state(mvm, vif, false);
4182 iwl_mvm_tdls_check_trigger(mvm, vif, sta->addr,
4217 void iwl_mvm_sta_rc_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
4225 iwl_mvm_rs_rate_init_all_links(mvm, vif, sta);
4227 if (vif->type == NL80211_IFTYPE_STATION &&
4229 iwl_mvm_sf_update(mvm, vif, false);
4233 struct ieee80211_vif *vif,
4238 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
4246 if (vif->type == NL80211_IFTYPE_P2P_DEVICE) {
4250 ret = iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL);
4258 struct ieee80211_vif *vif,
4264 iwl_mvm_protect_assoc(mvm, vif, info->duration, info->link_id);
4269 struct ieee80211_vif *vif,
4279 iwl_mvm_stop_session_protection(mvm, vif);
4284 struct ieee80211_vif *vif,
4294 if (!vif->cfg.idle) {
4299 ret = iwl_mvm_sched_scan_start(mvm, vif, req, ies, IWL_MVM_SCAN_SCHED);
4307 struct ieee80211_vif *vif)
4336 struct ieee80211_vif *vif,
4340 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
4358 } else if (vif->type == NL80211_IFTYPE_STATION) {
4378 if (vif->type == NL80211_IFTYPE_STATION)
4390 if (vif->type == NL80211_IFTYPE_STATION &&
4395 if ((vif->type == NL80211_IFTYPE_ADHOC ||
4396 vif->type == NL80211_IFTYPE_AP) && !sta) {
4503 ret = iwl_mvm_sec_key_add(mvm, vif, sta, key);
4505 ret = iwl_mvm_set_sta_key(mvm, vif, sta, key, key_offset);
4528 if (vif->type == NL80211_IFTYPE_STATION &&
4565 ret = iwl_mvm_sec_key_del(mvm, vif, sta, key);
4567 ret = iwl_mvm_remove_sta_key(mvm, vif, sta, key);
4577 struct ieee80211_vif *vif, struct ieee80211_sta *sta,
4584 ret = __iwl_mvm_mac_set_key(hw, cmd, vif, sta, key);
4591 struct ieee80211_vif *vif,
4601 iwl_mvm_update_tkip_key(mvm, vif, keyconf, sta, iv32, phase1key);
4641 struct ieee80211_vif *vif,
4645 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
4669 iwl_mvm_roc_duration_and_delay(vif, duration, &req_dur, &delay);
4681 memcpy(tail->node_addr, vif->addr, ETH_ALEN);
4692 te_data->vif = vif;
4756 static int iwl_mvm_roc_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
4762 ret = iwl_mvm_binding_add_vif(mvm, vif);
4769 return iwl_mvm_add_p2p_bcast_sta(mvm, vif);
4773 struct ieee80211_vif *vif,
4783 return iwl_mvm_roc_common(hw, vif, channel, duration, type, &ops);
4788 struct ieee80211_vif *vif,
4797 ret = iwl_mvm_send_aux_roc_cmd(mvm, channel, vif, duration);
4799 ret = iwl_mvm_roc_add_cmd(mvm, channel, vif, duration,
4810 struct ieee80211_vif *vif,
4813 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
4856 int iwl_mvm_roc_common(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
4874 ret = iwl_mvm_esr_non_bss_link(mvm, vif, 0, true);
4880 switch (vif->type) {
4887 ret = iwl_mvm_roc_station(mvm, channel, vif, duration);
4893 IWL_ERR(mvm, "ROC: Invalid vif type=%u\n", vif->type);
4899 ret = iwl_mvm_p2p_find_phy_ctxt(mvm, vif, channel);
4903 ret = ops->link(mvm, vif);
4907 ret = iwl_mvm_start_p2p_roc(mvm, vif, duration, type);
4915 struct ieee80211_vif *vif)
4921 iwl_mvm_stop_roc(mvm, vif);
4933 struct ieee80211_vif *vif)
4937 if (rcu_access_pointer(vif->bss_conf.chanctx_conf) == data->ctx &&
4938 vif->type == NL80211_IFTYPE_AP && vif->bss_conf.ftmr_params)
5069 struct ieee80211_vif *vif,
5075 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
5081 switch (vif->type) {
5110 struct ieee80211_vif *vif,
5115 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
5121 if (__iwl_mvm_assign_vif_chanctx_common(mvm, vif, ctx,
5125 ret = iwl_mvm_binding_add_vif(mvm, vif);
5139 if (vif->type == NL80211_IFTYPE_MONITOR) {
5145 ret = iwl_mvm_add_snif_sta(mvm, vif);
5152 if (vif->type == NL80211_IFTYPE_AP) {
5154 iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL);
5157 if (vif->type == NL80211_IFTYPE_STATION) {
5167 u32 duration = 5 * vif->bss_conf.beacon_int;
5172 iwl_mvm_protect_session(mvm, vif, duration, duration,
5173 vif->bss_conf.beacon_int / 2,
5183 iwl_mvm_binding_remove_vif(mvm, vif);
5192 struct ieee80211_vif *vif,
5200 ret = __iwl_mvm_assign_vif_chanctx(mvm, vif, link_conf, ctx, false);
5213 struct ieee80211_vif *vif,
5216 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
5222 switch (vif->type) {
5240 rcu_assign_pointer(mvm->csa_tx_blocked_vif, vif);
5251 struct ieee80211_vif *vif,
5256 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
5259 if (__iwl_mvm_unassign_vif_chanctx_common(mvm, vif, switching_chanctx))
5262 if (vif->type == NL80211_IFTYPE_MONITOR)
5263 iwl_mvm_rm_snif_sta(mvm, vif);
5266 if (vif->type == NL80211_IFTYPE_STATION && switching_chanctx) {
5267 disabled_vif = vif;
5270 iwl_mvm_mac_ctxt_changed(mvm, vif, true, NULL);
5274 iwl_mvm_binding_remove_vif(mvm, vif);
5285 struct ieee80211_vif *vif,
5292 __iwl_mvm_unassign_vif_chanctx(mvm, vif, link_conf, ctx, false);
5304 ops->__unassign_vif_chanctx(mvm, vifs[0].vif, vifs[0].link_conf,
5314 ret = ops->__assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].link_conf,
5337 if (ops->__assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].link_conf,
5363 ops->__unassign_vif_chanctx(mvm, vifs[0].vif, vifs[0].link_conf,
5366 ret = ops->__assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].link_conf,
5377 if (ops->__assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].link_conf,
5406 /* we only support a single-vif right now */
5451 if (!mvm_sta || !mvm_sta->vif) {
5452 IWL_ERR(mvm, "Station is not associated to a vif\n");
5456 return iwl_mvm_mac_ctxt_beacon_changed(mvm, mvm_sta->vif,
5457 &mvm_sta->vif->bss_conf);
5468 struct ieee80211_vif *vif,
5485 if (!vif || vif->type != NL80211_IFTYPE_AP || !vif->p2p ||
5486 !vif->bss_conf.enable_beacon ||
5491 if (noa_duration >= vif->bss_conf.beacon_int)
5495 mvm->noa_vif = vif;
5499 /* must be associated client vif - ignore authorized */
5500 if (!vif || vif->type != NL80211_IFTYPE_STATION ||
5501 !vif->cfg.assoc || !vif->bss_conf.dtim_period ||
5506 return iwl_mvm_enable_beacon_filter(mvm, vif);
5507 return iwl_mvm_disable_beacon_filter(mvm, vif);
5514 struct ieee80211_vif *vif,
5521 err = __iwl_mvm_mac_testmode_cmd(mvm, vif, data, len);
5528 void iwl_mvm_channel_switch(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
5542 struct ieee80211_vif *vif,
5545 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
5559 DIV_ROUND_UP(chsw->delay, vif->bss_conf.beacon_int);
5568 struct ieee80211_vif *vif,
5571 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
5584 ((vif->bss_conf.beacon_int * (chsw->count - 1) -
5588 iwl_mvm_csa_client_absent(mvm, vif);
5591 int ret = iwl_mvm_disable_beacon_filter(mvm, vif);
5597 iwl_mvm_schedule_csa_period(mvm, vif, vif->bss_conf.beacon_int,
5617 struct ieee80211_vif *vif,
5621 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
5634 ieee80211_vif_to_wdev(vif),
5637 switch (vif->type) {
5651 rcu_assign_pointer(mvm->csa_vif, vif);
5666 mvmtxq = iwl_mvm_txq_from_mac80211(vif->txq);
5689 if (!vif->cfg.assoc || !vif->bss_conf.dtim_period)
5693 hweight16(vif->valid_links) <= 1)
5702 chsw->count * vif->bss_conf.beacon_int >
5710 ret = iwl_mvm_old_pre_chan_sw_sta(mvm, vif, chsw);
5714 iwl_mvm_schedule_client_csa(mvm, vif, chsw);
5737 struct ieee80211_vif *vif,
5744 ret = iwl_mvm_pre_channel_switch(mvm, vif, chsw);
5751 struct ieee80211_vif *vif,
5755 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
5786 vif->link_conf[chsw->link_id]);
5790 iwl_mvm_abort_channel_switch(hw, vif, link_conf);
5791 ieee80211_chswitch_done(vif, false, 0);
5845 void iwl_mvm_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
5848 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
5856 if (!vif) {
5861 if (!drop && hweight16(vif->active_links) <= 1) {
5862 int link_id = vif->active_links ? __ffs(vif->active_links) : 0;
5866 vif->link_conf[link_id]);
5886 if (mvmsta->vif != vif)
5916 void iwl_mvm_mac_flush_sta(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
5926 for_each_sta_active_link(vif, sta, link_sta, link_id) {
6196 struct ieee80211_vif *vif,
6201 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
6218 if (!(vif->driver_flags & IEEE80211_VIF_BEACON_FILTER))
6221 if (!vif->cfg.assoc)
6249 struct ieee80211_vif *vif,
6269 struct ieee80211_vif *vif,
6283 iwl_mvm_event_mlme_callback_ini(mvm, vif, &event->u.mlme);
6287 trig = iwl_fw_dbg_trigger_on(&mvm->fwrt, ieee80211_vif_to_wdev(vif),
6321 struct ieee80211_vif *vif,
6327 trig = iwl_fw_dbg_trigger_on(&mvm->fwrt, ieee80211_vif_to_wdev(vif),
6344 struct ieee80211_vif *vif,
6351 iwl_mvm_event_mlme_callback(mvm, vif, event);
6354 iwl_mvm_event_bar_rx_callback(mvm, vif, event);
6357 iwl_mvm_event_frame_timeout_callback(mvm, vif, event->u.ba.sta,
6440 struct ieee80211_vif *vif,
6444 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
6446 if (vif->p2p || vif->type != NL80211_IFTYPE_AP ||
6447 !mvmvif->ap_ibss_active || !vif->bss_conf.ftm_responder)
6467 int iwl_mvm_start_pmsr(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
6474 ret = iwl_mvm_ftm_start(mvm, vif, request);
6480 void iwl_mvm_abort_pmsr(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
6517 struct ieee80211_vif *vif,