Lines Matching +full:mcast +full:- +full:groups
1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
3 * Copyright (C) 2012-2014, 2018-2023 Intel Corporation
4 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
5 * Copyright (C) 2016-2017 Intel Deutschland GmbH
19 #include "iwl-drv.h"
20 #include "iwl-op-mode.h"
21 #include "iwl-io.h"
24 #include "time-event.h"
25 #include "iwl-eeprom-parse.h"
26 #include "iwl-phy-db.h"
28 #include "fw/error-dump.h"
29 #include "iwl-prph.h"
30 #include "iwl-nvm-parse.h"
31 #include "time-sync.h"
72 .max_bursts_exponent = -1, /* all supported */
96 memset(mvm->phy_ctxts, 0, sizeof(mvm->phy_ctxts)); in iwl_mvm_reset_phy_ctxts()
98 mvm->phy_ctxts[i].id = i; in iwl_mvm_reset_phy_ctxts()
99 mvm->phy_ctxts[i].ref = 0; in iwl_mvm_reset_phy_ctxts()
116 lockdep_assert_held(&mvm->mutex); in iwl_mvm_get_regdomain()
127 u32 status = le32_to_cpu(resp->status); in iwl_mvm_get_regdomain()
132 resp_ver = iwl_fw_lookup_notif_ver(mvm->fw, IWL_ALWAYS_LONG_GROUP, in iwl_mvm_get_regdomain()
136 regd = iwl_parse_nvm_mcc_info(mvm->trans->dev, mvm->cfg, in iwl_mvm_get_regdomain()
137 __le32_to_cpu(resp->n_channels), in iwl_mvm_get_regdomain()
138 resp->channels, in iwl_mvm_get_regdomain()
139 __le16_to_cpu(resp->mcc), in iwl_mvm_get_regdomain()
140 __le16_to_cpu(resp->geo_info), in iwl_mvm_get_regdomain()
141 le32_to_cpu(resp->cap), resp_ver); in iwl_mvm_get_regdomain()
143 src_id = resp->source_id; in iwl_mvm_get_regdomain()
151 regd->alpha2, regd->alpha2[0], regd->alpha2[1], src_id); in iwl_mvm_get_regdomain()
152 mvm->lar_regdom_set = true; in iwl_mvm_get_regdomain()
153 mvm->mcc_src = src_id; in iwl_mvm_get_regdomain()
155 iwl_mei_set_country_code(__le16_to_cpu(resp->mcc)); in iwl_mvm_get_regdomain()
174 regulatory_set_wiphy_regd(mvm->hw->wiphy, regd); in iwl_mvm_update_changed_regdom()
183 return iwl_mvm_get_regdomain(mvm->hw->wiphy, "ZZ", in iwl_mvm_get_current_regdomain()
196 wiphy_dereference(mvm->hw->wiphy, mvm->hw->wiphy->regd); in iwl_mvm_init_fw_regd()
199 return -ENOENT; in iwl_mvm_init_fw_regd()
202 used_src = mvm->mcc_src; in iwl_mvm_init_fw_regd()
211 regd = iwl_mvm_get_regdomain(mvm->hw->wiphy, r->alpha2, used_src, in iwl_mvm_init_fw_regd()
214 return -EIO; in iwl_mvm_init_fw_regd()
218 ret = regulatory_set_wiphy_regd_sync(mvm->hw->wiphy, regd); in iwl_mvm_init_fw_regd()
284 struct ieee80211_hw *hw = mvm->hw; in iwl_mvm_mac_setup_register()
293 bool unified = fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
297 u8 sec_key_ver = iwl_fw_lookup_cmd_ver(mvm->fw, sec_key_id, 0); in iwl_mvm_mac_setup_register()
318 if (mvm->mld_api_is_used && mvm->nvm_data->sku_cap_11be_enable && in iwl_mvm_mac_setup_register()
321 hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_MLO; in iwl_mvm_mac_setup_register()
326 if (!mvm->mld_api_is_used) in iwl_mvm_mac_setup_register()
332 if (!(hw->wiphy->flags & WIPHY_FLAG_SUPPORTS_MLO)) in iwl_mvm_mac_setup_register()
336 * On older devices, enabling TX A-MSDU occasionally leads to in iwl_mvm_mac_setup_register()
342 * support A-MSDU until moving the mac80211 iTXQs, just leave it in iwl_mvm_mac_setup_register()
346 if (mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_9000) in iwl_mvm_mac_setup_register()
358 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
367 return -EINVAL; in iwl_mvm_mac_setup_register()
370 if (mvm->trans->num_rx_queues > 1) in iwl_mvm_mac_setup_register()
373 if (mvm->trans->max_skb_frags) in iwl_mvm_mac_setup_register()
374 hw->netdev_features = NETIF_F_HIGHDMA | NETIF_F_SG; in iwl_mvm_mac_setup_register()
376 hw->queues = IEEE80211_NUM_ACS; in iwl_mvm_mac_setup_register()
377 hw->offchannel_tx_hw_queue = IWL_MVM_OFFCHANNEL_QUEUE; in iwl_mvm_mac_setup_register()
378 hw->radiotap_mcs_details |= IEEE80211_RADIOTAP_MCS_HAVE_FEC | in iwl_mvm_mac_setup_register()
380 hw->radiotap_vht_details |= IEEE80211_RADIOTAP_VHT_KNOWN_STBC | in iwl_mvm_mac_setup_register()
383 hw->radiotap_timestamp.units_pos = in iwl_mvm_mac_setup_register()
387 hw->radiotap_timestamp.accuracy = 22; in iwl_mvm_mac_setup_register()
390 hw->rate_control_algorithm = RS_NAME; in iwl_mvm_mac_setup_register()
392 hw->uapsd_queues = IWL_MVM_UAPSD_QUEUES; in iwl_mvm_mac_setup_register()
393 hw->uapsd_max_sp_len = IWL_UAPSD_MAX_SP; in iwl_mvm_mac_setup_register()
394 hw->max_tx_fragments = mvm->trans->max_skb_frags; in iwl_mvm_mac_setup_register()
396 BUILD_BUG_ON(ARRAY_SIZE(mvm->ciphers) < ARRAY_SIZE(mvm_ciphers) + 6); in iwl_mvm_mac_setup_register()
397 memcpy(mvm->ciphers, mvm_ciphers, sizeof(mvm_ciphers)); in iwl_mvm_mac_setup_register()
398 hw->wiphy->n_cipher_suites = ARRAY_SIZE(mvm_ciphers); in iwl_mvm_mac_setup_register()
399 hw->wiphy->cipher_suites = mvm->ciphers; in iwl_mvm_mac_setup_register()
402 mvm->ciphers[hw->wiphy->n_cipher_suites] = in iwl_mvm_mac_setup_register()
404 hw->wiphy->n_cipher_suites++; in iwl_mvm_mac_setup_register()
405 mvm->ciphers[hw->wiphy->n_cipher_suites] = in iwl_mvm_mac_setup_register()
407 hw->wiphy->n_cipher_suites++; in iwl_mvm_mac_setup_register()
418 mvm->ciphers[hw->wiphy->n_cipher_suites] = WLAN_CIPHER_SUITE_AES_CMAC; in iwl_mvm_mac_setup_register()
419 hw->wiphy->n_cipher_suites++; in iwl_mvm_mac_setup_register()
421 mvm->ciphers[hw->wiphy->n_cipher_suites] = in iwl_mvm_mac_setup_register()
423 hw->wiphy->n_cipher_suites++; in iwl_mvm_mac_setup_register()
424 mvm->ciphers[hw->wiphy->n_cipher_suites] = in iwl_mvm_mac_setup_register()
426 hw->wiphy->n_cipher_suites++; in iwl_mvm_mac_setup_register()
429 wiphy_ext_feature_set(hw->wiphy, in iwl_mvm_mac_setup_register()
431 wiphy_ext_feature_set(hw->wiphy, in iwl_mvm_mac_setup_register()
434 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
436 wiphy_ext_feature_set(hw->wiphy, in iwl_mvm_mac_setup_register()
438 hw->wiphy->pmsr_capa = &iwl_mvm_pmsr_capa; in iwl_mvm_mac_setup_register()
442 fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
444 wiphy_ext_feature_set(hw->wiphy, in iwl_mvm_mac_setup_register()
446 else if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
448 wiphy_ext_feature_set(hw->wiphy, in iwl_mvm_mac_setup_register()
451 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
453 hw->wiphy->hw_timestamp_max_peers = 1; in iwl_mvm_mac_setup_register()
456 hw->wiphy->features |= in iwl_mvm_mac_setup_register()
461 hw->sta_data_size = sizeof(struct iwl_mvm_sta); in iwl_mvm_mac_setup_register()
462 hw->vif_data_size = sizeof(struct iwl_mvm_vif); in iwl_mvm_mac_setup_register()
463 hw->chanctx_data_size = sizeof(u16); in iwl_mvm_mac_setup_register()
464 hw->txq_data_size = sizeof(struct iwl_mvm_txq); in iwl_mvm_mac_setup_register()
466 hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | in iwl_mvm_mac_setup_register()
473 hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; in iwl_mvm_mac_setup_register()
474 wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_VHT_IBSS); in iwl_mvm_mac_setup_register()
481 wiphy_ext_feature_set(hw->wiphy, in iwl_mvm_mac_setup_register()
483 hw->wiphy->features |= NL80211_FEATURE_HT_IBSS; in iwl_mvm_mac_setup_register()
485 hw->wiphy->regulatory_flags |= REGULATORY_ENABLE_RELAX_NO_IR; in iwl_mvm_mac_setup_register()
487 hw->wiphy->regulatory_flags |= REGULATORY_WIPHY_SELF_MANAGED; in iwl_mvm_mac_setup_register()
489 hw->wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG | in iwl_mvm_mac_setup_register()
492 hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD; in iwl_mvm_mac_setup_register()
493 hw->wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH; in iwl_mvm_mac_setup_register()
494 hw->wiphy->flags |= WIPHY_FLAG_SPLIT_SCAN_6GHZ; in iwl_mvm_mac_setup_register()
496 hw->wiphy->iface_combinations = iwl_mvm_iface_combinations; in iwl_mvm_mac_setup_register()
497 hw->wiphy->n_iface_combinations = in iwl_mvm_mac_setup_register()
500 hw->wiphy->max_remain_on_channel_duration = 10000; in iwl_mvm_mac_setup_register()
501 hw->max_listen_interval = IWL_CONN_MAX_LISTEN_INTERVAL; in iwl_mvm_mac_setup_register()
504 memcpy(mvm->addresses[0].addr, mvm->nvm_data->hw_addr, ETH_ALEN); in iwl_mvm_mac_setup_register()
505 hw->wiphy->addresses = mvm->addresses; in iwl_mvm_mac_setup_register()
506 hw->wiphy->n_addresses = 1; in iwl_mvm_mac_setup_register()
509 num_mac = (mvm->nvm_data->n_hw_addrs > 1) ? in iwl_mvm_mac_setup_register()
510 min(IWL_MVM_MAX_ADDRESSES, mvm->nvm_data->n_hw_addrs) : 1; in iwl_mvm_mac_setup_register()
513 memcpy(mvm->addresses[i].addr, mvm->addresses[i-1].addr, in iwl_mvm_mac_setup_register()
515 mvm->addresses[i].addr[5]++; in iwl_mvm_mac_setup_register()
516 hw->wiphy->n_addresses++; in iwl_mvm_mac_setup_register()
521 hw->wiphy->max_scan_ie_len = iwl_mvm_max_scan_ie_len(mvm); in iwl_mvm_mac_setup_register()
523 hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX; in iwl_mvm_mac_setup_register()
529 if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_UMAC_SCAN)) in iwl_mvm_mac_setup_register()
530 mvm->max_scans = IWL_MVM_MAX_UMAC_SCANS; in iwl_mvm_mac_setup_register()
532 mvm->max_scans = IWL_MVM_MAX_LMAC_SCANS; in iwl_mvm_mac_setup_register()
534 if (mvm->nvm_data->bands[NL80211_BAND_2GHZ].n_channels) in iwl_mvm_mac_setup_register()
535 hw->wiphy->bands[NL80211_BAND_2GHZ] = in iwl_mvm_mac_setup_register()
536 &mvm->nvm_data->bands[NL80211_BAND_2GHZ]; in iwl_mvm_mac_setup_register()
537 if (mvm->nvm_data->bands[NL80211_BAND_5GHZ].n_channels) { in iwl_mvm_mac_setup_register()
538 hw->wiphy->bands[NL80211_BAND_5GHZ] = in iwl_mvm_mac_setup_register()
539 &mvm->nvm_data->bands[NL80211_BAND_5GHZ]; in iwl_mvm_mac_setup_register()
541 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
543 fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
545 hw->wiphy->bands[NL80211_BAND_5GHZ]->vht_cap.cap |= in iwl_mvm_mac_setup_register()
548 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
550 mvm->nvm_data->bands[NL80211_BAND_6GHZ].n_channels) in iwl_mvm_mac_setup_register()
551 hw->wiphy->bands[NL80211_BAND_6GHZ] = in iwl_mvm_mac_setup_register()
552 &mvm->nvm_data->bands[NL80211_BAND_6GHZ]; in iwl_mvm_mac_setup_register()
554 hw->wiphy->hw_version = mvm->trans->hw_id; in iwl_mvm_mac_setup_register()
557 hw->wiphy->flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT; in iwl_mvm_mac_setup_register()
559 hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; in iwl_mvm_mac_setup_register()
561 hw->wiphy->max_sched_scan_reqs = 1; in iwl_mvm_mac_setup_register()
562 hw->wiphy->max_sched_scan_ssids = PROBE_OPTION_MAX; in iwl_mvm_mac_setup_register()
563 hw->wiphy->max_match_sets = iwl_umac_scan_get_max_profiles(mvm->fw); in iwl_mvm_mac_setup_register()
565 hw->wiphy->max_sched_scan_ie_len = in iwl_mvm_mac_setup_register()
566 SCAN_OFFLOAD_PROBE_REQ_SIZE - 24 - 2; in iwl_mvm_mac_setup_register()
567 hw->wiphy->max_sched_scan_plans = IWL_MAX_SCHED_SCAN_PLANS; in iwl_mvm_mac_setup_register()
568 hw->wiphy->max_sched_scan_plan_interval = U16_MAX; in iwl_mvm_mac_setup_register()
574 hw->wiphy->max_sched_scan_plan_iterations = 254; in iwl_mvm_mac_setup_register()
576 hw->wiphy->features |= NL80211_FEATURE_P2P_GO_CTWIN | in iwl_mvm_mac_setup_register()
584 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
586 hw->wiphy->features |= NL80211_FEATURE_TX_POWER_INSERTION; in iwl_mvm_mac_setup_register()
587 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
589 hw->wiphy->features |= NL80211_FEATURE_QUIET; in iwl_mvm_mac_setup_register()
591 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
593 hw->wiphy->features |= in iwl_mvm_mac_setup_register()
596 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
598 hw->wiphy->features |= NL80211_FEATURE_WFA_TPC_IE_IN_PROBES; in iwl_mvm_mac_setup_register()
600 if (iwl_fw_lookup_cmd_ver(mvm->fw, WOWLAN_KEK_KCK_MATERIAL, in iwl_mvm_mac_setup_register()
602 hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK; in iwl_mvm_mac_setup_register()
604 if (fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
606 wiphy_ext_feature_set(hw->wiphy, in iwl_mvm_mac_setup_register()
608 wiphy_ext_feature_set(hw->wiphy, in iwl_mvm_mac_setup_register()
613 u8 scan_ver = iwl_fw_lookup_cmd_ver(mvm->fw, SCAN_REQ_UMAC, 0); in iwl_mvm_mac_setup_register()
615 wiphy_ext_feature_set(hw->wiphy, in iwl_mvm_mac_setup_register()
617 wiphy_ext_feature_set(hw->wiphy, in iwl_mvm_mac_setup_register()
619 wiphy_ext_feature_set(hw->wiphy, in iwl_mvm_mac_setup_register()
624 wiphy_ext_feature_set(hw->wiphy, in iwl_mvm_mac_setup_register()
628 hw->wiphy->iftype_ext_capab = NULL; in iwl_mvm_mac_setup_register()
629 hw->wiphy->num_iftype_ext_capab = 0; in iwl_mvm_mac_setup_register()
631 if (mvm->nvm_data->sku_cap_11ax_enable && in iwl_mvm_mac_setup_register()
633 hw->wiphy->iftype_ext_capab = add_iftypes_ext_capa; in iwl_mvm_mac_setup_register()
634 hw->wiphy->num_iftype_ext_capab = in iwl_mvm_mac_setup_register()
635 ARRAY_SIZE(add_iftypes_ext_capa) - 1; in iwl_mvm_mac_setup_register()
641 if (iwl_fw_lookup_cmd_ver(mvm->fw, in iwl_mvm_mac_setup_register()
645 IWL_DEBUG_INFO(mvm->trans, "Timing measurement supported\n"); in iwl_mvm_mac_setup_register()
647 if (!hw->wiphy->iftype_ext_capab) { in iwl_mvm_mac_setup_register()
648 hw->wiphy->num_iftype_ext_capab = 1; in iwl_mvm_mac_setup_register()
649 hw->wiphy->iftype_ext_capab = add_iftypes_ext_capa + in iwl_mvm_mac_setup_register()
650 ARRAY_SIZE(add_iftypes_ext_capa) - 1; in iwl_mvm_mac_setup_register()
652 hw->wiphy->iftype_ext_capab = add_iftypes_ext_capa + 1; in iwl_mvm_mac_setup_register()
656 mvm->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD; in iwl_mvm_mac_setup_register()
659 if ((unified || mvm->fw->img[IWL_UCODE_WOWLAN].num_sec) && in iwl_mvm_mac_setup_register()
660 mvm->trans->ops->d3_suspend && in iwl_mvm_mac_setup_register()
661 mvm->trans->ops->d3_resume && in iwl_mvm_mac_setup_register()
662 device_can_wakeup(mvm->trans->dev)) { in iwl_mvm_mac_setup_register()
663 mvm->wowlan.flags |= WIPHY_WOWLAN_MAGIC_PKT | in iwl_mvm_mac_setup_register()
668 mvm->wowlan.flags |= WIPHY_WOWLAN_SUPPORTS_GTK_REKEY | in iwl_mvm_mac_setup_register()
672 mvm->wowlan.n_patterns = IWL_WOWLAN_MAX_PATTERNS; in iwl_mvm_mac_setup_register()
673 mvm->wowlan.pattern_min_len = IWL_WOWLAN_MIN_PATTERN_LEN; in iwl_mvm_mac_setup_register()
674 mvm->wowlan.pattern_max_len = IWL_WOWLAN_MAX_PATTERN_LEN; in iwl_mvm_mac_setup_register()
675 mvm->wowlan.max_nd_match_sets = in iwl_mvm_mac_setup_register()
676 iwl_umac_scan_get_max_profiles(mvm->fw); in iwl_mvm_mac_setup_register()
677 hw->wiphy->wowlan = &mvm->wowlan; in iwl_mvm_mac_setup_register()
685 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
688 hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS; in iwl_mvm_mac_setup_register()
692 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
695 hw->wiphy->features |= NL80211_FEATURE_TDLS_CHANNEL_SWITCH; in iwl_mvm_mac_setup_register()
698 hw->netdev_features |= mvm->cfg->features; in iwl_mvm_mac_setup_register()
700 hw->netdev_features &= ~IWL_CSUM_NETIF_FLAGS_MASK; in iwl_mvm_mac_setup_register()
702 if (mvm->cfg->vht_mu_mimo_supported) in iwl_mvm_mac_setup_register()
703 wiphy_ext_feature_set(hw->wiphy, in iwl_mvm_mac_setup_register()
706 if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_PROTECTED_TWT)) in iwl_mvm_mac_setup_register()
707 wiphy_ext_feature_set(hw->wiphy, in iwl_mvm_mac_setup_register()
712 hw->wiphy->available_antennas_tx = iwl_mvm_get_valid_tx_ant(mvm); in iwl_mvm_mac_setup_register()
713 hw->wiphy->available_antennas_rx = iwl_mvm_get_valid_rx_ant(mvm); in iwl_mvm_mac_setup_register()
715 ret = ieee80211_register_hw(mvm->hw); in iwl_mvm_mac_setup_register()
734 ieee80211_free_txskb(mvm->hw, skb); in iwl_mvm_tx_skb()
741 struct ieee80211_sta *sta = control->sta; in iwl_mvm_mac_tx()
743 struct ieee80211_hdr *hdr = (void *)skb->data; in iwl_mvm_mac_tx()
744 bool offchannel = IEEE80211_SKB_CB(skb)->flags & in iwl_mvm_mac_tx()
746 u32 link_id = u32_get_bits(info->control.flags, in iwl_mvm_mac_tx()
751 IWL_DEBUG_DROP(mvm, "Dropping - RF/CT KILL\n"); in iwl_mvm_mac_tx()
756 !test_bit(IWL_MVM_STATUS_ROC_RUNNING, &mvm->status) && in iwl_mvm_mac_tx()
757 !test_bit(IWL_MVM_STATUS_ROC_AUX_RUNNING, &mvm->status)) in iwl_mvm_mac_tx()
764 if (ieee80211_is_mgmt(hdr->frame_control)) in iwl_mvm_mac_tx()
767 /* If there is no sta, and it's not offchannel - send through AP */ in iwl_mvm_mac_tx()
768 if (!sta && info->control.vif->type == NL80211_IFTYPE_STATION && in iwl_mvm_mac_tx()
771 iwl_mvm_vif_from_mac80211(info->control.vif); in iwl_mvm_mac_tx()
772 u8 ap_sta_id = READ_ONCE(mvmvif->deflink.ap_sta_id); in iwl_mvm_mac_tx()
774 if (ap_sta_id < mvm->fw->ucode_capa.num_stations) { in iwl_mvm_mac_tx()
776 sta = rcu_dereference(mvm->fw_id_to_mac_id[ap_sta_id]); in iwl_mvm_mac_tx()
783 !ieee80211_is_probe_resp(hdr->frame_control)) { in iwl_mvm_mac_tx()
786 rcu_dereference(tmp_sta->link[link_id]); in iwl_mvm_mac_tx()
788 rcu_dereference(info->control.vif->link_conf[link_id]); in iwl_mvm_mac_tx()
796 memcpy(mgmt->da, link_sta->addr, ETH_ALEN); in iwl_mvm_mac_tx()
797 memcpy(mgmt->sa, link_conf->addr, ETH_ALEN); in iwl_mvm_mac_tx()
798 memcpy(mgmt->bssid, link_conf->bssid, ETH_ALEN); in iwl_mvm_mac_tx()
817 * mvmtxq->tx_request logic: in iwl_mvm_mac_itxq_xmit()
832 if (atomic_fetch_add_unless(&mvmtxq->tx_request, 1, 2)) in iwl_mvm_mac_itxq_xmit()
838 &mvmtxq->state) && in iwl_mvm_mac_itxq_xmit()
840 &mvmtxq->state) && in iwl_mvm_mac_itxq_xmit()
841 !test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status))) { in iwl_mvm_mac_itxq_xmit()
845 if (txq->sta) in iwl_mvm_mac_itxq_xmit()
848 txq->sta->addr, in iwl_mvm_mac_itxq_xmit()
849 txq->tid); in iwl_mvm_mac_itxq_xmit()
853 iwl_mvm_tx_skb(mvm, skb, txq->sta); in iwl_mvm_mac_itxq_xmit()
855 } while (atomic_dec_return(&mvmtxq->tx_request)); in iwl_mvm_mac_itxq_xmit()
865 if (likely(test_bit(IWL_MVM_TXQ_STATE_READY, &mvmtxq->state)) || in iwl_mvm_mac_wake_tx_queue()
866 !txq->sta) { in iwl_mvm_mac_wake_tx_queue()
875 spin_lock_bh(&mvm->add_stream_lock); in iwl_mvm_mac_wake_tx_queue()
877 if (list_empty(&mvmtxq->list) && in iwl_mvm_mac_wake_tx_queue()
879 !test_bit(IWL_MVM_TXQ_STATE_READY, &mvmtxq->state)) { in iwl_mvm_mac_wake_tx_queue()
880 list_add_tail(&mvmtxq->list, &mvm->add_stream_txqs); in iwl_mvm_mac_wake_tx_queue()
881 schedule_work(&mvm->add_stream_wk); in iwl_mvm_mac_wake_tx_queue()
883 spin_unlock_bh(&mvm->add_stream_lock); in iwl_mvm_mac_wake_tx_queue()
890 iwl_fw_dbg_collect_trig(&(_mvm)->fwrt, _trig, _fmt); \
901 trig = iwl_fw_dbg_trigger_on(&mvm->fwrt, ieee80211_vif_to_wdev(vif), in iwl_mvm_ampdu_check_trigger()
906 ba_trig = (void *)trig->data; in iwl_mvm_ampdu_check_trigger()
911 struct iwl_mvm_tid_data *tid_data = &mvmsta->tid_data[tid]; in iwl_mvm_ampdu_check_trigger()
913 CHECK_BA_TRIGGER(mvm, trig, ba_trig->tx_ba_start, tid, in iwl_mvm_ampdu_check_trigger()
915 sta->addr, tid, tid_data->ssn); in iwl_mvm_ampdu_check_trigger()
919 CHECK_BA_TRIGGER(mvm, trig, ba_trig->tx_ba_stop, tid, in iwl_mvm_ampdu_check_trigger()
921 sta->addr, tid); in iwl_mvm_ampdu_check_trigger()
924 CHECK_BA_TRIGGER(mvm, trig, ba_trig->rx_ba_start, tid, in iwl_mvm_ampdu_check_trigger()
926 sta->addr, tid, rx_ba_ssn); in iwl_mvm_ampdu_check_trigger()
929 CHECK_BA_TRIGGER(mvm, trig, ba_trig->rx_ba_stop, tid, in iwl_mvm_ampdu_check_trigger()
931 sta->addr, tid); in iwl_mvm_ampdu_check_trigger()
944 struct ieee80211_sta *sta = params->sta; in iwl_mvm_mac_ampdu_action()
945 enum ieee80211_ampdu_mlme_action action = params->action; in iwl_mvm_mac_ampdu_action()
946 u16 tid = params->tid; in iwl_mvm_mac_ampdu_action()
947 u16 *ssn = ¶ms->ssn; in iwl_mvm_mac_ampdu_action()
948 u16 buf_size = params->buf_size; in iwl_mvm_mac_ampdu_action()
949 bool amsdu = params->amsdu; in iwl_mvm_mac_ampdu_action()
950 u16 timeout = params->timeout; in iwl_mvm_mac_ampdu_action()
952 IWL_DEBUG_HT(mvm, "A-MPDU action on addr %pM tid %d: action %d\n", in iwl_mvm_mac_ampdu_action()
953 sta->addr, tid, action); in iwl_mvm_mac_ampdu_action()
955 if (!(mvm->nvm_data->sku_cap_11n_enable)) in iwl_mvm_mac_ampdu_action()
956 return -EACCES; in iwl_mvm_mac_ampdu_action()
958 mutex_lock(&mvm->mutex); in iwl_mvm_mac_ampdu_action()
962 if (iwl_mvm_vif_from_mac80211(vif)->deflink.ap_sta_id == in iwl_mvm_mac_ampdu_action()
963 iwl_mvm_sta_from_mac80211(sta)->deflink.sta_id) { in iwl_mvm_mac_ampdu_action()
965 u16 macid = iwl_mvm_vif_from_mac80211(vif)->id; in iwl_mvm_mac_ampdu_action()
966 struct iwl_mvm_tcm_mac *mdata = &mvm->tcm.data[macid]; in iwl_mvm_mac_ampdu_action()
968 mdata->opened_rx_ba_sessions = true; in iwl_mvm_mac_ampdu_action()
970 cancel_delayed_work(&mvmvif->uapsd_nonagg_detected_wk); in iwl_mvm_mac_ampdu_action()
973 ret = -EINVAL; in iwl_mvm_mac_ampdu_action()
985 ret = -EINVAL; in iwl_mvm_mac_ampdu_action()
1003 ret = -EINVAL; in iwl_mvm_mac_ampdu_action()
1016 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_ampdu_action()
1029 mvmvif->uploaded = false; in iwl_mvm_cleanup_iterator()
1031 spin_lock_bh(&mvm->time_event_lock); in iwl_mvm_cleanup_iterator()
1032 iwl_mvm_te_clear_data(mvm, &mvmvif->time_event_data); in iwl_mvm_cleanup_iterator()
1033 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_cleanup_iterator()
1035 memset(&mvmvif->bf_data, 0, sizeof(mvmvif->bf_data)); in iwl_mvm_cleanup_iterator()
1038 mvmvif->link[link_id]->ap_sta_id = IWL_MVM_INVALID_STA; in iwl_mvm_cleanup_iterator()
1039 mvmvif->link[link_id]->fw_link_id = IWL_MVM_FW_LINK_ID_INVALID; in iwl_mvm_cleanup_iterator()
1040 mvmvif->link[link_id]->phy_ctxt = NULL; in iwl_mvm_cleanup_iterator()
1041 mvmvif->link[link_id]->active = 0; in iwl_mvm_cleanup_iterator()
1042 mvmvif->link[link_id]->igtk = NULL; in iwl_mvm_cleanup_iterator()
1045 probe_data = rcu_dereference_protected(mvmvif->deflink.probe_resp_data, in iwl_mvm_cleanup_iterator()
1046 lockdep_is_held(&mvm->mutex)); in iwl_mvm_cleanup_iterator()
1049 RCU_INIT_POINTER(mvmvif->deflink.probe_resp_data, NULL); in iwl_mvm_cleanup_iterator()
1056 mvm->cur_aid = 0; in iwl_mvm_restart_cleanup()
1058 mvm->scan_status = 0; in iwl_mvm_restart_cleanup()
1059 mvm->ps_disabled = false; in iwl_mvm_restart_cleanup()
1060 mvm->rfkill_safe_init_done = false; in iwl_mvm_restart_cleanup()
1064 ieee80211_remain_on_channel_expired(mvm->hw); in iwl_mvm_restart_cleanup()
1072 ieee80211_iterate_interfaces(mvm->hw, 0, iwl_mvm_cleanup_iterator, mvm); in iwl_mvm_restart_cleanup()
1074 mvm->p2p_device_vif = NULL; in iwl_mvm_restart_cleanup()
1077 memset(mvm->fw_key_table, 0, sizeof(mvm->fw_key_table)); in iwl_mvm_restart_cleanup()
1078 memset(&mvm->last_bt_notif, 0, sizeof(mvm->last_bt_notif)); in iwl_mvm_restart_cleanup()
1079 memset(&mvm->last_bt_ci_cmd, 0, sizeof(mvm->last_bt_ci_cmd)); in iwl_mvm_restart_cleanup()
1081 ieee80211_wake_queues(mvm->hw); 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()
1087 mvm->beacon_inject_active = false; in iwl_mvm_restart_cleanup()
1098 lockdep_assert_held(&mvm->mutex); in __iwl_mvm_mac_start()
1104 if (mvm->mei_nvm_data) { in __iwl_mvm_mac_start()
1106 kfree(mvm->mei_nvm_data); in __iwl_mvm_mac_start()
1107 mvm->mei_nvm_data = NULL; in __iwl_mvm_mac_start()
1112 * allocated on mvm->nvm_data. Keep a pointer in temp_nvm_data in __iwl_mvm_mac_start()
1117 mvm->temp_nvm_data = mvm->nvm_data; in __iwl_mvm_mac_start()
1118 mvm->nvm_data = NULL; in __iwl_mvm_mac_start()
1121 if (test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status)) { in __iwl_mvm_mac_start()
1124 * so later code will - from now on - see that we're doing it. in __iwl_mvm_mac_start()
1126 set_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status); in __iwl_mvm_mac_start()
1127 clear_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status); in __iwl_mvm_mac_start()
1133 iwl_dbg_tlv_time_point(&mvm->fwrt, IWL_FW_INI_TIME_POINT_POST_INIT, in __iwl_mvm_mac_start()
1135 iwl_dbg_tlv_time_point(&mvm->fwrt, IWL_FW_INI_TIME_POINT_PERIODIC, in __iwl_mvm_mac_start()
1138 mvm->last_reset_or_resume_time_jiffies = jiffies; in __iwl_mvm_mac_start()
1140 if (ret && test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { in __iwl_mvm_mac_start()
1141 /* Something went wrong - we need to finish some cleanup in __iwl_mvm_mac_start()
1145 clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status); in __iwl_mvm_mac_start()
1157 mutex_lock(&mvm->mutex); in iwl_mvm_mac_start()
1160 if (!test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status) && in iwl_mvm_mac_start()
1167 set_bit(IWL_MVM_STATUS_STARTING, &mvm->status); in iwl_mvm_mac_start()
1176 * In PLDR sync PCI re-enumeration is needed. no point to retry in iwl_mvm_mac_start()
1179 if (mvm->pldr_sync) { in iwl_mvm_mac_start()
1181 iwl_trans_pcie_remove(mvm->trans, true); in iwl_mvm_mac_start()
1187 clear_bit(IWL_MVM_STATUS_STARTING, &mvm->status); in iwl_mvm_mac_start()
1189 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_start()
1200 mutex_lock(&mvm->mutex); in iwl_mvm_restart_complete()
1202 clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status); in iwl_mvm_restart_complete()
1217 mutex_unlock(&mvm->mutex); in iwl_mvm_restart_complete()
1236 lockdep_assert_held(&mvm->mutex); in __iwl_mvm_mac_stop()
1243 memset(&mvm->accu_radio_stats, 0, sizeof(mvm->accu_radio_stats)); in __iwl_mvm_mac_stop()
1247 if (!iwl_mvm_has_new_station_api(mvm->fw)) in __iwl_mvm_mac_stop()
1262 if (test_and_clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) || in __iwl_mvm_mac_stop()
1264 &mvm->status)) in __iwl_mvm_mac_stop()
1265 ieee80211_iterate_interfaces(mvm->hw, 0, in __iwl_mvm_mac_stop()
1271 if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_UMAC_SCAN)) { in __iwl_mvm_mac_stop()
1274 for (i = 0; i < mvm->max_scans; i++) { in __iwl_mvm_mac_stop()
1275 if (WARN_ONCE(mvm->scan_uid_status[i], in __iwl_mvm_mac_stop()
1278 mvm->scan_uid_status[i] = 0; in __iwl_mvm_mac_stop()
1287 flush_work(&mvm->async_handlers_wk); in iwl_mvm_mac_stop()
1288 flush_work(&mvm->add_stream_wk); in iwl_mvm_mac_stop()
1298 clear_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status); in iwl_mvm_mac_stop()
1300 cancel_delayed_work_sync(&mvm->cs_tx_unblock_dwork); in iwl_mvm_mac_stop()
1301 cancel_delayed_work_sync(&mvm->scan_timeout_dwork); in iwl_mvm_mac_stop()
1307 flush_work(&mvm->roc_done_wk); in iwl_mvm_mac_stop()
1311 mutex_lock(&mvm->mutex); in iwl_mvm_mac_stop()
1313 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_stop()
1319 cancel_work_sync(&mvm->async_handlers_wk); in iwl_mvm_mac_stop()
1326 lockdep_assert_held(&mvm->mutex); in iwl_mvm_get_free_phy_ctxt()
1329 if (!mvm->phy_ctxts[i].ref) in iwl_mvm_get_free_phy_ctxt()
1330 return &mvm->phy_ctxts[i]; in iwl_mvm_get_free_phy_ctxt()
1344 cpu_to_le32(iwl_mvm_vif_from_mac80211(vif)->id), in iwl_mvm_set_tx_power()
1347 u8 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, cmd_id, in iwl_mvm_set_tx_power()
1357 else if (fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_set_tx_power()
1360 else if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_set_tx_power()
1379 mutex_lock(&mvm->mutex); in iwl_mvm_post_channel_switch()
1381 if (vif->type == NL80211_IFTYPE_STATION) { in iwl_mvm_post_channel_switch()
1384 mvmvif->csa_bcn_pending = false; in iwl_mvm_post_channel_switch()
1386 mvmvif->deflink.ap_sta_id); in iwl_mvm_post_channel_switch()
1389 ret = -EIO; in iwl_mvm_post_channel_switch()
1394 if (mvm->mld_api_is_used) in iwl_mvm_post_channel_switch()
1399 if (!fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_post_channel_switch()
1409 mvmvif->ps_disabled = false; in iwl_mvm_post_channel_switch()
1414 if (mvmvif->csa_failed) in iwl_mvm_post_channel_switch()
1415 ret = -EIO; in iwl_mvm_post_channel_switch()
1416 mutex_unlock(&mvm->mutex); in iwl_mvm_post_channel_switch()
1427 .mac_id = cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id, in iwl_mvm_abort_channel_switch()
1428 mvmvif->color)), in iwl_mvm_abort_channel_switch()
1437 if (iwl_fw_lookup_notif_ver(mvm->fw, MAC_CONF_GROUP, in iwl_mvm_abort_channel_switch()
1441 IWL_DEBUG_MAC80211(mvm, "Abort CSA on mac %d\n", mvmvif->id); in iwl_mvm_abort_channel_switch()
1443 mutex_lock(&mvm->mutex); in iwl_mvm_abort_channel_switch()
1444 if (!fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_abort_channel_switch()
1452 mvmvif->csa_failed = true; in iwl_mvm_abort_channel_switch()
1453 mutex_unlock(&mvm->mutex); in iwl_mvm_abort_channel_switch()
1477 if (chandef->width == NL80211_CHAN_WIDTH_320) in iwl_mvm_chandef_get_primary_80()
1479 else if (chandef->width == NL80211_CHAN_WIDTH_160) in iwl_mvm_chandef_get_primary_80()
1485 data_start = chandef->center_freq1 - bw / 2; in iwl_mvm_chandef_get_primary_80()
1487 control_start = chandef->chan->center_freq - 10; in iwl_mvm_chandef_get_primary_80()
1489 return (control_start - data_start) / 80; in iwl_mvm_chandef_get_primary_80()
1498 lockdep_assert_held(&mvm->mutex); in iwl_mvm_alloc_bcast_mcast_sta()
1506 /* Only queue for this station is the mcast queue, in iwl_mvm_alloc_bcast_mcast_sta()
1509 return iwl_mvm_allocate_int_sta(mvm, &mvmvif->deflink.mcast_sta, 0, in iwl_mvm_alloc_bcast_mcast_sta()
1510 vif->type, in iwl_mvm_alloc_bcast_mcast_sta()
1521 mutex_lock(&mvm->mutex); in iwl_mvm_mac_add_interface()
1523 mvmvif->mvm = mvm; in iwl_mvm_mac_add_interface()
1526 mvmvif->link[0] = &mvmvif->deflink; in iwl_mvm_mac_add_interface()
1535 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) in iwl_mvm_mac_add_interface()
1536 mvmvif->deflink.beacon_stats.accu_num_beacons += in iwl_mvm_mac_add_interface()
1537 mvmvif->deflink.beacon_stats.num_beacons; in iwl_mvm_mac_add_interface()
1544 rcu_assign_pointer(mvm->vif_id_to_mac[mvmvif->id], vif); in iwl_mvm_mac_add_interface()
1547 if (vif->type == NL80211_IFTYPE_NAN) { in iwl_mvm_mac_add_interface()
1563 if (vif->type == NL80211_IFTYPE_AP || in iwl_mvm_mac_add_interface()
1564 vif->type == NL80211_IFTYPE_ADHOC) { in iwl_mvm_mac_add_interface()
1570 mvmvif->features |= hw->netdev_features; in iwl_mvm_mac_add_interface()
1585 if (!mvm->bf_allowed_vif && in iwl_mvm_mac_add_interface()
1586 vif->type == NL80211_IFTYPE_STATION && !vif->p2p) { in iwl_mvm_mac_add_interface()
1587 mvm->bf_allowed_vif = mvmvif; in iwl_mvm_mac_add_interface()
1588 vif->driver_flags |= IEEE80211_VIF_BEACON_FILTER | in iwl_mvm_mac_add_interface()
1597 if (vif->type == NL80211_IFTYPE_P2P_DEVICE) { in iwl_mvm_mac_add_interface()
1599 mvmvif->deflink.phy_ctxt = iwl_mvm_get_free_phy_ctxt(mvm); in iwl_mvm_mac_add_interface()
1600 if (!mvmvif->deflink.phy_ctxt) { in iwl_mvm_mac_add_interface()
1601 ret = -ENOSPC; in iwl_mvm_mac_add_interface()
1605 iwl_mvm_phy_ctxt_ref(mvm, mvmvif->deflink.phy_ctxt); in iwl_mvm_mac_add_interface()
1616 mvm->p2p_device_vif = vif; in iwl_mvm_mac_add_interface()
1620 INIT_DELAYED_WORK(&mvmvif->csa_work, in iwl_mvm_mac_add_interface()
1623 if (vif->type == NL80211_IFTYPE_MONITOR) { in iwl_mvm_mac_add_interface()
1624 mvm->monitor_on = true; in iwl_mvm_mac_add_interface()
1625 mvm->monitor_p80 = in iwl_mvm_mac_add_interface()
1626 iwl_mvm_chandef_get_primary_80(&vif->bss_conf.chandef); in iwl_mvm_mac_add_interface()
1631 if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) && in iwl_mvm_mac_add_interface()
1632 vif->type == NL80211_IFTYPE_STATION && !vif->p2p && in iwl_mvm_mac_add_interface()
1633 !mvm->csme_vif && mvm->mei_registered) { in iwl_mvm_mac_add_interface()
1634 iwl_mei_set_nic_info(vif->addr, mvm->nvm_data->hw_addr); in iwl_mvm_mac_add_interface()
1635 iwl_mei_set_netdev(ieee80211_vif_to_wdev(vif)->netdev); in iwl_mvm_mac_add_interface()
1636 mvm->csme_vif = vif; in iwl_mvm_mac_add_interface()
1640 if (!ret && (vif->type == NL80211_IFTYPE_AP || in iwl_mvm_mac_add_interface()
1641 vif->type == NL80211_IFTYPE_ADHOC)) in iwl_mvm_mac_add_interface()
1649 iwl_mvm_phy_ctxt_unref(mvm, mvmvif->deflink.phy_ctxt); in iwl_mvm_mac_add_interface()
1651 if (mvm->bf_allowed_vif == mvmvif) { in iwl_mvm_mac_add_interface()
1652 mvm->bf_allowed_vif = NULL; in iwl_mvm_mac_add_interface()
1653 vif->driver_flags &= ~(IEEE80211_VIF_BEACON_FILTER | in iwl_mvm_mac_add_interface()
1657 mvmvif->deflink.phy_ctxt = NULL; in iwl_mvm_mac_add_interface()
1660 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_add_interface()
1668 if (vif->type == NL80211_IFTYPE_P2P_DEVICE) { in iwl_mvm_prepare_mac_removal()
1674 flush_work(&mvm->roc_done_wk); in iwl_mvm_prepare_mac_removal()
1679 * both - MLD and non-MLD modes. Returns true if removing the interface
1691 if (!(vif->type == NL80211_IFTYPE_AP || in iwl_mvm_mac_remove_interface_common()
1692 vif->type == NL80211_IFTYPE_ADHOC)) in iwl_mvm_mac_remove_interface_common()
1695 mutex_lock(&mvm->mutex); in iwl_mvm_mac_remove_interface_common()
1697 if (vif == mvm->csme_vif) { in iwl_mvm_mac_remove_interface_common()
1699 mvm->csme_vif = NULL; in iwl_mvm_mac_remove_interface_common()
1702 probe_data = rcu_dereference_protected(mvmvif->deflink.probe_resp_data, in iwl_mvm_mac_remove_interface_common()
1703 lockdep_is_held(&mvm->mutex)); in iwl_mvm_mac_remove_interface_common()
1704 RCU_INIT_POINTER(mvmvif->deflink.probe_resp_data, NULL); in iwl_mvm_mac_remove_interface_common()
1708 if (mvm->bf_allowed_vif == mvmvif) { in iwl_mvm_mac_remove_interface_common()
1709 mvm->bf_allowed_vif = NULL; in iwl_mvm_mac_remove_interface_common()
1710 vif->driver_flags &= ~(IEEE80211_VIF_BEACON_FILTER | in iwl_mvm_mac_remove_interface_common()
1714 if (vif->bss_conf.ftm_responder) in iwl_mvm_mac_remove_interface_common()
1715 memset(&mvm->ftm_resp_stats, 0, sizeof(mvm->ftm_resp_stats)); in iwl_mvm_mac_remove_interface_common()
1723 if (vif->type == NL80211_IFTYPE_AP || in iwl_mvm_mac_remove_interface_common()
1724 vif->type == NL80211_IFTYPE_ADHOC) { in iwl_mvm_mac_remove_interface_common()
1726 if (vif == mvm->noa_vif) { in iwl_mvm_mac_remove_interface_common()
1727 mvm->noa_vif = NULL; in iwl_mvm_mac_remove_interface_common()
1728 mvm->noa_duration = 0; in iwl_mvm_mac_remove_interface_common()
1747 if (vif->type == NL80211_IFTYPE_P2P_DEVICE) { in iwl_mvm_mac_remove_interface()
1748 mvm->p2p_device_vif = NULL; in iwl_mvm_mac_remove_interface()
1751 iwl_mvm_phy_ctxt_unref(mvm, mvmvif->deflink.phy_ctxt); in iwl_mvm_mac_remove_interface()
1752 mvmvif->deflink.phy_ctxt = NULL; in iwl_mvm_mac_remove_interface()
1757 RCU_INIT_POINTER(mvm->vif_id_to_mac[mvmvif->id], NULL); in iwl_mvm_mac_remove_interface()
1759 if (vif->type == NL80211_IFTYPE_MONITOR) in iwl_mvm_mac_remove_interface()
1760 mvm->monitor_on = false; in iwl_mvm_mac_remove_interface()
1763 if (vif->type == NL80211_IFTYPE_AP || in iwl_mvm_mac_remove_interface()
1764 vif->type == NL80211_IFTYPE_ADHOC) { in iwl_mvm_mac_remove_interface()
1765 iwl_mvm_dealloc_int_sta(mvm, &mvmvif->deflink.mcast_sta); in iwl_mvm_mac_remove_interface()
1769 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_remove_interface()
1781 struct iwl_mvm *mvm = data->mvm; in iwl_mvm_mc_iface_iterator()
1782 struct iwl_mcast_filter_cmd *cmd = mvm->mcast_filter_cmd; in iwl_mvm_mc_iface_iterator()
1790 /* if we don't have free ports, mcast frames will be dropped */ in iwl_mvm_mc_iface_iterator()
1791 if (WARN_ON_ONCE(data->port_id >= MAX_PORT_ID_NUM)) in iwl_mvm_mc_iface_iterator()
1794 if (vif->type != NL80211_IFTYPE_STATION || in iwl_mvm_mc_iface_iterator()
1795 !vif->cfg.assoc) in iwl_mvm_mc_iface_iterator()
1798 cmd->port_id = data->port_id++; in iwl_mvm_mc_iface_iterator()
1799 memcpy(cmd->bssid, vif->bss_conf.bssid, ETH_ALEN); in iwl_mvm_mc_iface_iterator()
1800 len = roundup(sizeof(*cmd) + cmd->count * ETH_ALEN, 4); in iwl_mvm_mc_iface_iterator()
1807 IWL_ERR(mvm, "mcast filter cmd error. ret=%d\n", ret); in iwl_mvm_mc_iface_iterator()
1817 lockdep_assert_held(&mvm->mutex); in iwl_mvm_recalc_multicast()
1819 if (WARN_ON_ONCE(!mvm->mcast_filter_cmd)) in iwl_mvm_recalc_multicast()
1823 mvm->hw, IEEE80211_IFACE_ITER_NORMAL, in iwl_mvm_recalc_multicast()
1833 * Note that the CPU is still faster - but with this we'll in iwl_mvm_recalc_multicast()
1840 IWL_ERR(mvm, "Failed to synchronize multicast groups update\n"); in iwl_mvm_recalc_multicast()
1865 cmd->pass_all = 1; in iwl_mvm_prepare_multicast()
1870 IWL_DEBUG_MAC80211(mvm, "mcast addr (%d): %pM\n", in iwl_mvm_prepare_multicast()
1871 cmd->count, addr->addr); in iwl_mvm_prepare_multicast()
1872 memcpy(&cmd->addr_list[cmd->count * ETH_ALEN], in iwl_mvm_prepare_multicast()
1873 addr->addr, ETH_ALEN); in iwl_mvm_prepare_multicast()
1874 cmd->count++; in iwl_mvm_prepare_multicast()
1887 mutex_lock(&mvm->mutex); in iwl_mvm_configure_filter()
1890 kfree(mvm->mcast_filter_cmd); in iwl_mvm_configure_filter()
1891 mvm->mcast_filter_cmd = cmd; in iwl_mvm_configure_filter()
1897 cmd->pass_all = !!(*total_flags & FIF_ALLMULTI); in iwl_mvm_configure_filter()
1899 if (cmd->pass_all) in iwl_mvm_configure_filter()
1900 cmd->count = 0; in iwl_mvm_configure_filter()
1904 mutex_unlock(&mvm->mutex); in iwl_mvm_configure_filter()
1920 if (vif->type != NL80211_IFTYPE_STATION || !vif->cfg.assoc || in iwl_mvm_config_iface_filter()
1921 !vif->p2p) in iwl_mvm_config_iface_filter()
1924 mutex_lock(&mvm->mutex); in iwl_mvm_config_iface_filter()
1926 mutex_unlock(&mvm->mutex); in iwl_mvm_config_iface_filter()
1933 memcpy(cmd.membership_status, vif->bss_conf.mu_group.membership, in iwl_mvm_update_mu_groups()
1935 memcpy(cmd.user_position, vif->bss_conf.mu_group.position, in iwl_mvm_update_mu_groups()
1947 if (vif->bss_conf.mu_mimo_owner) { in iwl_mvm_mu_mimo_iface_iterator()
1951 * MU-MIMO Group Id action frame is little endian. We treat in iwl_mvm_mu_mimo_iface_iterator()
1956 (u8 *)¬if->membership_status, in iwl_mvm_mu_mimo_iface_iterator()
1957 (u8 *)¬if->user_position); in iwl_mvm_mu_mimo_iface_iterator()
1965 struct iwl_mu_group_mgmt_notif *notif = (void *)pkt->data; in iwl_mvm_mu_mimo_grp_notif()
1968 mvm->hw, IEEE80211_IFACE_ITER_NORMAL, in iwl_mvm_mu_mimo_grp_notif()
1981 (BIT(IEEE80211_PPE_THRES_INFO_PPET_SIZE) - 1); in iwl_mvm_he_get_ppe_val()
1989 residue_bits = 8 - bit_num; in iwl_mvm_he_get_ppe_val()
1992 (BIT(IEEE80211_PPE_THRES_INFO_PPET_SIZE - residue_bits) - 1)) << in iwl_mvm_he_get_ppe_val()
1994 res += (ppe[byte_num] >> bit_num) & (BIT(residue_bits) - 1); in iwl_mvm_he_get_ppe_val()
2013 IWL_DEBUG_INFO(mvm, "Got NSS = %d - trimming to %d\n", nss, in iwl_mvm_parse_ppe()
2024 bw < ARRAY_SIZE(pkt_ext->pkt_ext_qam_th[i]); in iwl_mvm_parse_ppe()
2030 * isn't present - it should inherit the thresholds from the last in iwl_mvm_parse_ppe()
2032 * this inheritance - continue in this case in iwl_mvm_parse_ppe()
2047 pkt_ext->pkt_ext_qam_th[i][bw][0] = low_th; in iwl_mvm_parse_ppe()
2048 pkt_ext->pkt_ext_qam_th[i][bw][1] = high_th; in iwl_mvm_parse_ppe()
2058 u8 nss = (link_sta->he_cap.ppe_thres[0] & in iwl_mvm_set_pkt_ext_from_he_ppe()
2060 u8 *ppe = &link_sta->he_cap.ppe_thres[0]; in iwl_mvm_set_pkt_ext_from_he_ppe()
2075 int low_th = -1; in iwl_mvm_set_pkt_ext_from_nominal_padding()
2076 int high_th = -1; in iwl_mvm_set_pkt_ext_from_nominal_padding()
2097 return -EINVAL; in iwl_mvm_set_pkt_ext_from_nominal_padding()
2104 bw < ARRAY_SIZE(pkt_ext->pkt_ext_qam_th[i]); in iwl_mvm_set_pkt_ext_from_nominal_padding()
2106 pkt_ext->pkt_ext_qam_th[i][bw][0] = low_th; in iwl_mvm_set_pkt_ext_from_nominal_padding()
2107 pkt_ext->pkt_ext_qam_th[i][bw][1] = high_th; in iwl_mvm_set_pkt_ext_from_nominal_padding()
2122 for (bw = 0; bw < ARRAY_SIZE(pkt_ext->pkt_ext_qam_th[i]); in iwl_mvm_get_optimal_ppe_info()
2124 u8 *qam_th = &pkt_ext->pkt_ext_qam_th[i][bw][0]; in iwl_mvm_get_optimal_ppe_info()
2148 return -EINVAL; in iwl_mvm_set_sta_pkt_ext()
2151 * 9-262ac of 80211.ax/D3.0. in iwl_mvm_set_sta_pkt_ext()
2156 if (link_sta->eht_cap.has_eht) { in iwl_mvm_set_sta_pkt_ext()
2158 u8_get_bits(link_sta->eht_cap.eht_cap_elem.phy_cap_info[5], in iwl_mvm_set_sta_pkt_ext()
2161 /* If PPE Thresholds exists, parse them into a FW-familiar in iwl_mvm_set_sta_pkt_ext()
2164 if (link_sta->eht_cap.eht_cap_elem.phy_cap_info[5] & in iwl_mvm_set_sta_pkt_ext()
2166 u8 nss = (link_sta->eht_cap.eht_ppe_thres[0] & in iwl_mvm_set_sta_pkt_ext()
2168 u8 *ppe = &link_sta->eht_cap.eht_ppe_thres[0]; in iwl_mvm_set_sta_pkt_ext()
2177 /* EHT PPE Thresholds doesn't exist - set the API according to in iwl_mvm_set_sta_pkt_ext()
2180 } else if (link_sta->he_cap.he_cap_elem.phy_cap_info[6] & in iwl_mvm_set_sta_pkt_ext()
2190 /* According to the requirements, for MCSs 12-13 the in iwl_mvm_set_sta_pkt_ext()
2196 /* if PPE Thresholds doesn't present in both EHT IE and HE IE - in iwl_mvm_set_sta_pkt_ext()
2203 } else if (link_sta->he_cap.has_he) { in iwl_mvm_set_sta_pkt_ext()
2204 /* If PPE Thresholds exist, parse them into a FW-familiar format. */ in iwl_mvm_set_sta_pkt_ext()
2205 if (link_sta->he_cap.he_cap_elem.phy_cap_info[6] & in iwl_mvm_set_sta_pkt_ext()
2209 /* PPE Thresholds doesn't exist - set the API PPE values in iwl_mvm_set_sta_pkt_ext()
2214 u8_get_bits(link_sta->he_cap.he_cap_elem.phy_cap_info[9], in iwl_mvm_set_sta_pkt_ext()
2226 bw < ARRAY_SIZE(*pkt_ext->pkt_ext_qam_th[i]); in iwl_mvm_set_sta_pkt_ext()
2229 &pkt_ext->pkt_ext_qam_th[i][bw][0]; in iwl_mvm_set_sta_pkt_ext()
2253 &link_info->queue_params[i].mu_edca_param_rec; in iwl_mvm_set_fw_mu_edca_params()
2256 if (!link_info->queue_params[i].mu_edca) { in iwl_mvm_set_fw_mu_edca_params()
2262 cpu_to_le16(mu_edca->ecw_min_max & 0xf); in iwl_mvm_set_fw_mu_edca_params()
2264 cpu_to_le16((mu_edca->ecw_min_max & 0xf0) >> 4); in iwl_mvm_set_fw_mu_edca_params()
2266 cpu_to_le16(mu_edca->aifsn & 0xf); in iwl_mvm_set_fw_mu_edca_params()
2268 cpu_to_le16(mu_edca->mu_edca_timer); in iwl_mvm_set_fw_mu_edca_params()
2282 sband = mvm->hw->wiphy->bands[NL80211_BAND_2GHZ]; in iwl_mvm_is_nic_ack_enabled()
2285 return (own_he_cap && (own_he_cap->he_cap_elem.mac_cap_info[2] & in iwl_mvm_is_nic_ack_enabled()
2293 &link_sta->he_cap.he_cap_elem.mac_cap_info[0]; in iwl_mvm_get_sta_htc_flags()
2329 .bss_color = vif->bss_conf.he_bss_color.color, in iwl_mvm_cfg_he_sta()
2330 .htc_trig_based_pkt_ext = vif->bss_conf.htc_trig_based_pkt_ext, in iwl_mvm_cfg_he_sta()
2332 cpu_to_le16(vif->bss_conf.frame_time_rts_th), in iwl_mvm_cfg_he_sta()
2336 u8 ver = iwl_fw_lookup_cmd_ver(mvm->fw, cmd_id, 2); in iwl_mvm_cfg_he_sta()
2343 if (!fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_MBSSID_HE)) in iwl_mvm_cfg_he_sta()
2367 sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_ctxt_cmd.sta_id]); in iwl_mvm_cfg_he_sta()
2374 if (!sta->deflink.he_cap.has_he) { in iwl_mvm_cfg_he_sta()
2381 /* Block 26-tone RU OFDMA transmissions */ in iwl_mvm_cfg_he_sta()
2382 if (mvmvif->deflink.he_ru_2mhz_block) in iwl_mvm_cfg_he_sta()
2386 sta_ctxt_cmd.htc_flags = iwl_mvm_get_sta_htc_flags(sta, &sta->deflink); in iwl_mvm_cfg_he_sta()
2389 if (!iwl_mvm_set_sta_pkt_ext(mvm, &sta->deflink, &sta_ctxt_cmd.pkt_ext)) in iwl_mvm_cfg_he_sta()
2392 if (sta->deflink.he_cap.he_cap_elem.mac_cap_info[2] & in iwl_mvm_cfg_he_sta()
2396 if (sta->deflink.he_cap.he_cap_elem.mac_cap_info[2] & in iwl_mvm_cfg_he_sta()
2402 if (iwl_mvm_set_fw_mu_edca_params(mvm, &mvmvif->deflink, in iwl_mvm_cfg_he_sta()
2406 if (vif->bss_conf.uora_exists) { in iwl_mvm_cfg_he_sta()
2410 vif->bss_conf.uora_ocw_range & 0x7; in iwl_mvm_cfg_he_sta()
2412 (vif->bss_conf.uora_ocw_range >> 3) & 0x7; in iwl_mvm_cfg_he_sta()
2418 if (vif->bss_conf.nontransmitted) { in iwl_mvm_cfg_he_sta()
2421 vif->bss_conf.transmitter_bssid); in iwl_mvm_cfg_he_sta()
2423 vif->bss_conf.bssid_indicator; in iwl_mvm_cfg_he_sta()
2424 sta_ctxt_cmd.bssid_index = vif->bss_conf.bssid_index; in iwl_mvm_cfg_he_sta()
2425 sta_ctxt_cmd.ema_ap = vif->bss_conf.ema_ap; in iwl_mvm_cfg_he_sta()
2427 vif->bss_conf.profile_periodicity; in iwl_mvm_cfg_he_sta()
2458 BUILD_BUG_ON(sizeof(sta_ctxt_cmd) - in iwl_mvm_cfg_he_sta()
2460 sizeof(sta_ctxt_cmd_v2) - in iwl_mvm_cfg_he_sta()
2466 sizeof(sta_ctxt_cmd) - in iwl_mvm_cfg_he_sta()
2493 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_protect_assoc()
2502 /* Handle association common part to MLD and non-MLD modes */
2510 /* The firmware tracks the MU-MIMO group on its own. in iwl_mvm_bss_info_changed_station_assoc()
2513 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) && in iwl_mvm_bss_info_changed_station_assoc()
2514 (changes & BSS_CHANGED_MU_GROUPS) && vif->bss_conf.mu_mimo_owner) { in iwl_mvm_bss_info_changed_station_assoc()
2518 "failed to update VHT MU_MIMO groups\n"); in iwl_mvm_bss_info_changed_station_assoc()
2524 mvmvif->bf_data.ave_beacon_signal = 0; in iwl_mvm_bss_info_changed_station_assoc()
2529 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_bss_info_changed_station_assoc()
2534 /* Execute the common part for MLD and non-MLD modes */
2567 mvmvif->bf_data.last_cqm_event = 0; in iwl_mvm_bss_info_changed_station_common()
2568 if (mvmvif->bf_data.bf_enabled) { in iwl_mvm_bss_info_changed_station_common()
2592 * Re-calculate the tsf id, as the leader-follower relations depend in iwl_mvm_bss_info_changed_station()
2596 if (changes & BSS_CHANGED_ASSOC && vif->cfg.assoc) { in iwl_mvm_bss_info_changed_station()
2597 if ((vif->bss_conf.he_support && in iwl_mvm_bss_info_changed_station()
2599 (vif->bss_conf.eht_support && in iwl_mvm_bss_info_changed_station()
2601 iwl_mvm_cfg_he_sta(mvm, vif, mvmvif->deflink.ap_sta_id); in iwl_mvm_bss_info_changed_station()
2607 if (changes & BSS_CHANGED_QOS && mvmvif->associated && in iwl_mvm_bss_info_changed_station()
2608 vif->cfg.assoc && in iwl_mvm_bss_info_changed_station()
2609 ((vif->bss_conf.he_support && in iwl_mvm_bss_info_changed_station()
2611 (vif->bss_conf.eht_support && in iwl_mvm_bss_info_changed_station()
2613 iwl_mvm_cfg_he_sta(mvm, vif, mvmvif->deflink.ap_sta_id); in iwl_mvm_bss_info_changed_station()
2621 if (changes & BSS_CHANGED_BSSID && !mvmvif->associated) in iwl_mvm_bss_info_changed_station()
2622 memcpy(mvmvif->deflink.bssid, bss_conf->bssid, ETH_ALEN); in iwl_mvm_bss_info_changed_station()
2624 ret = iwl_mvm_mac_ctxt_changed(mvm, vif, false, mvmvif->deflink.bssid); in iwl_mvm_bss_info_changed_station()
2626 IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr); in iwl_mvm_bss_info_changed_station()
2629 memcpy(mvmvif->deflink.bssid, bss_conf->bssid, ETH_ALEN); in iwl_mvm_bss_info_changed_station()
2630 mvmvif->associated = vif->cfg.assoc; in iwl_mvm_bss_info_changed_station()
2633 if (vif->cfg.assoc) { in iwl_mvm_bss_info_changed_station()
2636 memset(&mvmvif->deflink.beacon_stats, 0, in iwl_mvm_bss_info_changed_station()
2637 sizeof(mvmvif->deflink.beacon_stats)); in iwl_mvm_bss_info_changed_station()
2647 &mvm->status) && in iwl_mvm_bss_info_changed_station()
2648 !fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_bss_info_changed_station()
2668 u32 dur = (11 * vif->bss_conf.beacon_int) / 10; in iwl_mvm_bss_info_changed_station()
2672 &mvm->status) && in iwl_mvm_bss_info_changed_station()
2673 !vif->bss_conf.dtim_period) { in iwl_mvm_bss_info_changed_station()
2689 if (vif->p2p) { in iwl_mvm_bss_info_changed_station()
2694 } else if (mvmvif->deflink.ap_sta_id != IWL_MVM_INVALID_STA) { in iwl_mvm_bss_info_changed_station()
2697 * If update fails - SF might be running in associated in iwl_mvm_bss_info_changed_station()
2698 * mode while disassociated - which is forbidden. in iwl_mvm_bss_info_changed_station()
2703 &mvm->status), in iwl_mvm_bss_info_changed_station()
2709 * to associated), mac80211 will re-add the station and in iwl_mvm_bss_info_changed_station()
2715 &mvm->status)) { in iwl_mvm_bss_info_changed_station()
2718 &mvmvif->deflink, 0); in iwl_mvm_bss_info_changed_station()
2725 mvmvif->deflink.ap_sta_id); in iwl_mvm_bss_info_changed_station()
2730 mvmvif->deflink.ap_sta_id = IWL_MVM_INVALID_STA; in iwl_mvm_bss_info_changed_station()
2743 vif->addr); in iwl_mvm_bss_info_changed_station()
2749 iwl_mvm_bss_info_changed_station_common(mvm, vif, &vif->bss_conf, in iwl_mvm_bss_info_changed_station()
2761 lockdep_assert_held(&mvm->mutex); in iwl_mvm_start_ap_ibss_common()
2763 mvmvif->ap_assoc_sta_count = 0; in iwl_mvm_start_ap_ibss_common()
2766 mvmvif->ap_ibss_active = true; in iwl_mvm_start_ap_ibss_common()
2769 for (i = 0; i < ARRAY_SIZE(mvmvif->ap_early_keys); i++) { in iwl_mvm_start_ap_ibss_common()
2770 struct ieee80211_key_conf *key = mvmvif->ap_early_keys[i]; in iwl_mvm_start_ap_ibss_common()
2775 mvmvif->ap_early_keys[i] = NULL; in iwl_mvm_start_ap_ibss_common()
2782 if (vif->type == NL80211_IFTYPE_AP && !vif->p2p) { in iwl_mvm_start_ap_ibss_common()
2785 iwl_mvm_send_low_latency_cmd(mvm, true, mvmvif->id); in iwl_mvm_start_ap_ibss_common()
2802 mutex_lock(&mvm->mutex); in iwl_mvm_start_ap_ibss()
2805 * Re-calculate the tsf id, as the leader-follower relations depend on in iwl_mvm_start_ap_ibss()
2809 if (vif->type == NL80211_IFTYPE_AP) in iwl_mvm_start_ap_ibss()
2816 if (mvm->trans->trans_cfg->device_family > IWL_DEVICE_FAMILY_22000) { in iwl_mvm_start_ap_ibss()
2845 * For older FWs adding the mcast sta before the bcast station may in iwl_mvm_start_ap_ibss()
2850 if (fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_STA_TYPE)) { in iwl_mvm_start_ap_ibss()
2886 if (vif->p2p && mvm->p2p_device_vif) in iwl_mvm_start_ap_ibss()
2887 iwl_mvm_mac_ctxt_changed(mvm, mvm->p2p_device_vif, false, NULL); in iwl_mvm_start_ap_ibss()
2895 iwl_mvm_ftm_restart_responder(mvm, vif, &vif->bss_conf); in iwl_mvm_start_ap_ibss()
2901 mvmvif->ap_ibss_active = false; in iwl_mvm_start_ap_ibss()
2909 mutex_unlock(&mvm->mutex); in iwl_mvm_start_ap_ibss()
2923 return iwl_mvm_start_ap_ibss(hw, vif, &vif->bss_conf); in iwl_mvm_start_ibss()
2926 /* Common part for MLD and non-MLD ops */
2932 lockdep_assert_held(&mvm->mutex); in iwl_mvm_stop_ap_ibss_common()
2937 if (rcu_access_pointer(mvm->csa_vif) == vif) { in iwl_mvm_stop_ap_ibss_common()
2939 &mvmvif->time_event_data); in iwl_mvm_stop_ap_ibss_common()
2940 RCU_INIT_POINTER(mvm->csa_vif, NULL); in iwl_mvm_stop_ap_ibss_common()
2941 mvmvif->csa_countdown = false; in iwl_mvm_stop_ap_ibss_common()
2944 if (rcu_access_pointer(mvm->csa_tx_blocked_vif) == vif) { in iwl_mvm_stop_ap_ibss_common()
2945 RCU_INIT_POINTER(mvm->csa_tx_blocked_vif, NULL); in iwl_mvm_stop_ap_ibss_common()
2946 mvm->csa_tx_block_bcn_timeout = 0; in iwl_mvm_stop_ap_ibss_common()
2949 mvmvif->ap_ibss_active = false; in iwl_mvm_stop_ap_ibss_common()
2950 mvm->ap_last_beacon_gp2 = 0; in iwl_mvm_stop_ap_ibss_common()
2952 if (vif->type == NL80211_IFTYPE_AP && !vif->p2p) { in iwl_mvm_stop_ap_ibss_common()
2955 iwl_mvm_send_low_latency_cmd(mvm, false, mvmvif->id); in iwl_mvm_stop_ap_ibss_common()
2967 mutex_lock(&mvm->mutex); in iwl_mvm_stop_ap_ibss()
2972 if (vif->p2p && mvm->p2p_device_vif) in iwl_mvm_stop_ap_ibss()
2973 iwl_mvm_mac_ctxt_changed(mvm, mvm->p2p_device_vif, false, NULL); in iwl_mvm_stop_ap_ibss()
2981 * For older FWs removing the mcast sta before the bcast station may in iwl_mvm_stop_ap_ibss()
2987 if (!fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_STA_TYPE)) in iwl_mvm_stop_ap_ibss()
2990 if (fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_STA_TYPE)) in iwl_mvm_stop_ap_ibss()
2998 mutex_unlock(&mvm->mutex); in iwl_mvm_stop_ap_ibss()
3011 iwl_mvm_stop_ap_ibss(hw, vif, &vif->bss_conf); in iwl_mvm_stop_ibss()
3023 if (!mvmvif->ap_ibss_active) in iwl_mvm_bss_info_changed_ap_ibss()
3029 IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr); in iwl_mvm_bss_info_changed_ap_ibss()
3033 iwl_mvm_mac_ctxt_beacon_changed(mvm, vif, &vif->bss_conf)) in iwl_mvm_bss_info_changed_ap_ibss()
3037 int ret = iwl_mvm_ftm_start_responder(mvm, vif, &vif->bss_conf); in iwl_mvm_bss_info_changed_ap_ibss()
3069 mutex_lock(&mvm->mutex); in iwl_mvm_bss_info_changed_common()
3071 if (changes & BSS_CHANGED_IDLE && !vif->cfg.idle) in iwl_mvm_bss_info_changed_common()
3074 switch (vif->type) { in iwl_mvm_bss_info_changed_common()
3076 callbacks->bss_info_changed_sta(mvm, vif, bss_conf, changes); in iwl_mvm_bss_info_changed_common()
3080 callbacks->bss_info_changed_ap_ibss(mvm, vif, bss_conf, in iwl_mvm_bss_info_changed_common()
3094 bss_conf->txpower); in iwl_mvm_bss_info_changed_common()
3095 iwl_mvm_set_tx_power(mvm, vif, bss_conf->txpower); in iwl_mvm_bss_info_changed_common()
3098 mutex_unlock(&mvm->mutex); in iwl_mvm_bss_info_changed_common()
3107 if (hw_req->req.n_channels == 0 || in iwl_mvm_mac_hw_scan()
3108 hw_req->req.n_channels > mvm->fw->ucode_capa.n_scan_channels) in iwl_mvm_mac_hw_scan()
3109 return -EINVAL; in iwl_mvm_mac_hw_scan()
3111 mutex_lock(&mvm->mutex); in iwl_mvm_mac_hw_scan()
3112 ret = iwl_mvm_reg_scan_start(mvm, vif, &hw_req->req, &hw_req->ies); in iwl_mvm_mac_hw_scan()
3113 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_hw_scan()
3123 mutex_lock(&mvm->mutex); in iwl_mvm_mac_cancel_hw_scan()
3132 if (mvm->scan_status & IWL_MVM_SCAN_REGULAR) in iwl_mvm_mac_cancel_hw_scan()
3135 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_cancel_hw_scan()
3178 * If we have TVQM then we get too high queue numbers - luckily in __iwl_mvm_mac_sta_notify()
3185 spin_lock_bh(&mvmsta->lock); in __iwl_mvm_mac_sta_notify()
3186 for (tid = 0; tid < ARRAY_SIZE(mvmsta->tid_data); tid++) { in __iwl_mvm_mac_sta_notify()
3187 struct iwl_mvm_tid_data *tid_data = &mvmsta->tid_data[tid]; in __iwl_mvm_mac_sta_notify()
3189 if (tid_data->txq_id == IWL_MVM_INVALID_QUEUE) in __iwl_mvm_mac_sta_notify()
3192 __set_bit(tid_data->txq_id, &txqs); in __iwl_mvm_mac_sta_notify()
3206 iwl_trans_freeze_txq_timer(mvm->trans, txqs, true); in __iwl_mvm_mac_sta_notify()
3214 if (WARN_ON(mvmsta->deflink.sta_id == IWL_MVM_INVALID_STA)) in __iwl_mvm_mac_sta_notify()
3218 iwl_trans_freeze_txq_timer(mvm->trans, txqs, false); in __iwl_mvm_mac_sta_notify()
3224 spin_unlock_bh(&mvmsta->lock); in __iwl_mvm_mac_sta_notify()
3236 struct iwl_mvm_pm_state_notification *notif = (void *)pkt->data; in iwl_mvm_sta_pm_notif()
3239 bool sleeping = (notif->type != IWL_MVM_PM_EVENT_AWAKE); in iwl_mvm_sta_pm_notif()
3241 if (WARN_ON(notif->sta_id >= mvm->fw->ucode_capa.num_stations)) in iwl_mvm_sta_pm_notif()
3245 sta = rcu_dereference(mvm->fw_id_to_mac_id[notif->sta_id]); in iwl_mvm_sta_pm_notif()
3253 if (!mvmsta->vif || in iwl_mvm_sta_pm_notif()
3254 mvmsta->vif->type != NL80211_IFTYPE_AP) { in iwl_mvm_sta_pm_notif()
3259 if (mvmsta->sleeping != sleeping) { in iwl_mvm_sta_pm_notif()
3260 mvmsta->sleeping = sleeping; in iwl_mvm_sta_pm_notif()
3261 __iwl_mvm_mac_sta_notify(mvm->hw, in iwl_mvm_sta_pm_notif()
3268 switch (notif->type) { in iwl_mvm_sta_pm_notif()
3296 * so here we already invalidate our internal RCU-protected in iwl_mvm_sta_pre_rcu_remove()
3301 * Since there's mvm->mutex here, no need to have RCU lock for in iwl_mvm_sta_pre_rcu_remove()
3302 * mvm_sta->link access. in iwl_mvm_sta_pre_rcu_remove()
3304 mutex_lock(&mvm->mutex); in iwl_mvm_sta_pre_rcu_remove()
3305 for (link_id = 0; link_id < ARRAY_SIZE(mvm_sta->link); link_id++) { in iwl_mvm_sta_pre_rcu_remove()
3309 if (!mvm_sta->link[link_id]) in iwl_mvm_sta_pre_rcu_remove()
3312 link_sta = rcu_dereference_protected(mvm_sta->link[link_id], in iwl_mvm_sta_pre_rcu_remove()
3313 lockdep_is_held(&mvm->mutex)); in iwl_mvm_sta_pre_rcu_remove()
3314 sta_id = link_sta->sta_id; in iwl_mvm_sta_pre_rcu_remove()
3315 if (sta == rcu_access_pointer(mvm->fw_id_to_mac_id[sta_id])) { in iwl_mvm_sta_pre_rcu_remove()
3316 RCU_INIT_POINTER(mvm->fw_id_to_mac_id[sta_id], in iwl_mvm_sta_pre_rcu_remove()
3317 ERR_PTR(-ENOENT)); in iwl_mvm_sta_pre_rcu_remove()
3318 RCU_INIT_POINTER(mvm->fw_id_to_link_sta[sta_id], NULL); in iwl_mvm_sta_pre_rcu_remove()
3321 mutex_unlock(&mvm->mutex); in iwl_mvm_sta_pre_rcu_remove()
3329 if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { in iwl_mvm_check_uapsd()
3332 mdata = &mvm->tcm.data[iwl_mvm_vif_from_mac80211(vif)->id]; in iwl_mvm_check_uapsd()
3333 ewma_rate_init(&mdata->uapsd_nonagg_detect.rate); in iwl_mvm_check_uapsd()
3334 mdata->opened_rx_ba_sessions = false; in iwl_mvm_check_uapsd()
3337 if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_UAPSD_SUPPORT)) in iwl_mvm_check_uapsd()
3340 if (vif->p2p && !iwl_mvm_is_p2p_scm_uapsd_supported(mvm)) { in iwl_mvm_check_uapsd()
3341 vif->driver_flags &= ~IEEE80211_VIF_SUPPORTS_UAPSD; in iwl_mvm_check_uapsd()
3345 if (!vif->p2p && in iwl_mvm_check_uapsd()
3347 vif->driver_flags &= ~IEEE80211_VIF_SUPPORTS_UAPSD; in iwl_mvm_check_uapsd()
3352 if (ether_addr_equal(mvm->uapsd_noagg_bssids[i].addr, bssid)) { in iwl_mvm_check_uapsd()
3353 vif->driver_flags &= ~IEEE80211_VIF_SUPPORTS_UAPSD; in iwl_mvm_check_uapsd()
3358 vif->driver_flags |= IEEE80211_VIF_SUPPORTS_UAPSD; in iwl_mvm_check_uapsd()
3369 trig = iwl_fw_dbg_trigger_on(&mvm->fwrt, ieee80211_vif_to_wdev(vif), in iwl_mvm_tdls_check_trigger()
3374 tdls_trig = (void *)trig->data; in iwl_mvm_tdls_check_trigger()
3376 if (!(tdls_trig->action_bitmap & BIT(action))) in iwl_mvm_tdls_check_trigger()
3379 if (tdls_trig->peer_mode && in iwl_mvm_tdls_check_trigger()
3380 memcmp(tdls_trig->peer, peer_addr, ETH_ALEN) != 0) in iwl_mvm_tdls_check_trigger()
3383 iwl_fw_dbg_collect_trig(&mvm->fwrt, trig, in iwl_mvm_tdls_check_trigger()
3401 ies = rcu_dereference(bss->ies); in iwl_mvm_check_he_obss_narrow_bw_ru_iter()
3402 elem = cfg80211_find_elem(WLAN_EID_EXT_CAPABILITY, ies->data, in iwl_mvm_check_he_obss_narrow_bw_ru_iter()
3403 ies->len); in iwl_mvm_check_he_obss_narrow_bw_ru_iter()
3405 if (!elem || elem->datalen < 10 || in iwl_mvm_check_he_obss_narrow_bw_ru_iter()
3406 !(elem->data[10] & in iwl_mvm_check_he_obss_narrow_bw_ru_iter()
3408 data->tolerated = false; in iwl_mvm_check_he_obss_narrow_bw_ru_iter()
3424 if (WARN_ON_ONCE(!link_conf->chandef.chan || in iwl_mvm_check_he_obss_narrow_bw_ru()
3425 !mvmvif->link[link_id])) in iwl_mvm_check_he_obss_narrow_bw_ru()
3428 if (!(link_conf->chandef.chan->flags & IEEE80211_CHAN_RADAR)) { in iwl_mvm_check_he_obss_narrow_bw_ru()
3429 mvmvif->link[link_id]->he_ru_2mhz_block = false; in iwl_mvm_check_he_obss_narrow_bw_ru()
3433 cfg80211_bss_iter(hw->wiphy, &link_conf->chandef, in iwl_mvm_check_he_obss_narrow_bw_ru()
3439 * tolerate 26-tone RU UL OFDMA transmissions using HE TB PPDU. in iwl_mvm_check_he_obss_narrow_bw_ru()
3441 mvmvif->link[link_id]->he_ru_2mhz_block = !iter_data.tolerated; in iwl_mvm_check_he_obss_narrow_bw_ru()
3450 if (vif->type != NL80211_IFTYPE_STATION) in iwl_mvm_reset_cca_40mhz_workaround()
3453 if (!mvm->cca_40mhz_workaround) in iwl_mvm_reset_cca_40mhz_workaround()
3457 mvm->cca_40mhz_workaround--; in iwl_mvm_reset_cca_40mhz_workaround()
3458 if (mvm->cca_40mhz_workaround) in iwl_mvm_reset_cca_40mhz_workaround()
3461 sband = mvm->hw->wiphy->bands[NL80211_BAND_2GHZ]; in iwl_mvm_reset_cca_40mhz_workaround()
3463 sband->ht_cap.cap |= IEEE80211_HT_CAP_SUP_WIDTH_20_40; in iwl_mvm_reset_cca_40mhz_workaround()
3471 he->he_cap_elem.phy_cap_info[0] |= in iwl_mvm_reset_cca_40mhz_workaround()
3483 .ssid_len = vif->cfg.ssid_len, in iwl_mvm_mei_host_associated()
3486 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) in iwl_mvm_mei_host_associated()
3489 if (!mvm->mei_registered) in iwl_mvm_mei_host_associated()
3493 if (!vif->bss_conf.chandef.chan) in iwl_mvm_mei_host_associated()
3496 conn_info.channel = vif->bss_conf.chandef.chan->hw_value; in iwl_mvm_mei_host_associated()
3498 switch (mvm_sta->pairwise_cipher) { in iwl_mvm_mei_host_associated()
3519 switch (mvmvif->rekey_data.akm) { in iwl_mvm_mei_host_associated()
3539 memcpy(conn_info.ssid, vif->cfg.ssid, vif->cfg.ssid_len); in iwl_mvm_mei_host_associated()
3540 memcpy(conn_info.bssid, vif->bss_conf.bssid, ETH_ALEN); in iwl_mvm_mei_host_associated()
3589 if (!conf || !link_sta || !mvmvif->link[link_id]->phy_ctxt) in iwl_mvm_rs_rate_init_all_links()
3593 mvmvif->link[link_id]->phy_ctxt->channel->band); in iwl_mvm_rs_rate_init_all_links()
3606 /* Beacon interval check - firmware will crash if the beacon in iwl_mvm_vif_conf_from_sta()
3620 if (link_conf->beacon_int < IWL_MVM_MIN_BEACON_INTERVAL_TU) { in iwl_mvm_vif_conf_from_sta()
3623 link_conf->beacon_int, link_sta->addr); in iwl_mvm_vif_conf_from_sta()
3627 link_conf->he_support = link_sta->he_cap.has_he; in iwl_mvm_vif_conf_from_sta()
3646 if (!link_conf || !mvmvif->link[link_id]) in iwl_mvm_vif_set_he_support()
3649 link_conf->he_support = link_sta->he_cap.has_he; in iwl_mvm_vif_set_he_support()
3652 mvmvif->link[link_id]->he_ru_2mhz_block = false; in iwl_mvm_vif_set_he_support()
3653 if (link_sta->he_cap.has_he) in iwl_mvm_vif_set_he_support()
3672 lockdep_assert_held(&mvm->mutex); in iwl_mvm_sta_state_notexist_to_none()
3674 if (vif->type == NL80211_IFTYPE_STATION && in iwl_mvm_sta_state_notexist_to_none()
3676 return -EINVAL; in iwl_mvm_sta_state_notexist_to_none()
3678 if (sta->tdls && in iwl_mvm_sta_state_notexist_to_none()
3679 (vif->p2p || in iwl_mvm_sta_state_notexist_to_none()
3683 return -EBUSY; in iwl_mvm_sta_state_notexist_to_none()
3686 ret = callbacks->add_sta(mvm, vif, sta); in iwl_mvm_sta_state_notexist_to_none()
3687 if (sta->tdls && ret == 0) { in iwl_mvm_sta_state_notexist_to_none()
3689 iwl_mvm_tdls_check_trigger(mvm, vif, sta->addr, in iwl_mvm_sta_state_notexist_to_none()
3694 link_sta->agg.max_rc_amsdu_len = 1; in iwl_mvm_sta_state_notexist_to_none()
3698 if (vif->type == NL80211_IFTYPE_STATION && !sta->tdls) in iwl_mvm_sta_state_notexist_to_none()
3699 mvmvif->ap_sta = sta; in iwl_mvm_sta_state_notexist_to_none()
3716 lockdep_assert_held(&mvm->mutex); in iwl_mvm_sta_state_auth_to_assoc()
3718 if (vif->type == NL80211_IFTYPE_AP) { in iwl_mvm_sta_state_auth_to_assoc()
3720 mvmvif->ap_assoc_sta_count++; in iwl_mvm_sta_state_auth_to_assoc()
3721 callbacks->mac_ctxt_changed(mvm, vif, false); in iwl_mvm_sta_state_auth_to_assoc()
3726 if (!mvm->mld_api_is_used && in iwl_mvm_sta_state_auth_to_assoc()
3727 ((vif->bss_conf.he_support && in iwl_mvm_sta_state_auth_to_assoc()
3729 (vif->bss_conf.eht_support && in iwl_mvm_sta_state_auth_to_assoc()
3731 iwl_mvm_cfg_he_sta(mvm, vif, mvm_sta->deflink.sta_id); in iwl_mvm_sta_state_auth_to_assoc()
3732 } else if (vif->type == NL80211_IFTYPE_STATION) { in iwl_mvm_sta_state_auth_to_assoc()
3735 callbacks->mac_ctxt_changed(mvm, vif, false); in iwl_mvm_sta_state_auth_to_assoc()
3737 if (!mvm->mld_api_is_used) in iwl_mvm_sta_state_auth_to_assoc()
3745 return -EINVAL; in iwl_mvm_sta_state_auth_to_assoc()
3746 if (!mvmvif->link[link_id]) in iwl_mvm_sta_state_auth_to_assoc()
3759 return callbacks->update_sta(mvm, vif, sta); in iwl_mvm_sta_state_auth_to_assoc()
3771 lockdep_assert_held(&mvm->mutex); in iwl_mvm_sta_state_assoc_to_authorized()
3777 if (sta->tdls) { in iwl_mvm_sta_state_assoc_to_authorized()
3778 iwl_mvm_tdls_check_trigger(mvm, vif, sta->addr, in iwl_mvm_sta_state_assoc_to_authorized()
3784 mvmvif->authorized = 1; in iwl_mvm_sta_state_assoc_to_authorized()
3786 callbacks->mac_ctxt_changed(mvm, vif, false); in iwl_mvm_sta_state_assoc_to_authorized()
3790 mvm_sta->authorized = true; in iwl_mvm_sta_state_assoc_to_authorized()
3806 lockdep_assert_held(&mvm->mutex); in iwl_mvm_sta_state_authorized_to_assoc()
3808 mvmsta->authorized = false; in iwl_mvm_sta_state_authorized_to_assoc()
3815 if (!sta->tdls) { in iwl_mvm_sta_state_authorized_to_assoc()
3820 mvmvif->authorized = 0; in iwl_mvm_sta_state_authorized_to_assoc()
3829 /* Common part for MLD and non-MLD modes */
3844 IWL_DEBUG_MAC80211(mvm, "station %pM state change %d->%d\n", in iwl_mvm_mac_sta_state_common()
3845 sta->addr, old_state, new_state); in iwl_mvm_mac_sta_state_common()
3857 * Drop any still-queued deferred-frame before removing the STA, and in iwl_mvm_mac_sta_state_common()
3862 flush_work(&mvm->add_stream_wk); in iwl_mvm_mac_sta_state_common()
3876 kfree(mvm_sta->dup_data); in iwl_mvm_mac_sta_state_common()
3879 mutex_lock(&mvm->mutex); in iwl_mvm_mac_sta_state_common()
3883 if (WARN_ON_ONCE(!mvmvif->link[link_id]->phy_ctxt)) { in iwl_mvm_mac_sta_state_common()
3884 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_sta_state_common()
3886 &mvm->status) ? 0 : -EINVAL; in iwl_mvm_mac_sta_state_common()
3891 mvm_sta->sta_state = new_state; in iwl_mvm_mac_sta_state_common()
3905 mvm->last_ebs_successful = true; in iwl_mvm_mac_sta_state_common()
3906 iwl_mvm_check_uapsd(mvm, vif, sta->addr); in iwl_mvm_mac_sta_state_common()
3922 if (vif->type == NL80211_IFTYPE_AP) { in iwl_mvm_mac_sta_state_common()
3923 mvmvif->ap_assoc_sta_count--; in iwl_mvm_mac_sta_state_common()
3924 callbacks->mac_ctxt_changed(mvm, vif, false); in iwl_mvm_mac_sta_state_common()
3925 } else if (vif->type == NL80211_IFTYPE_STATION && !sta->tdls) in iwl_mvm_mac_sta_state_common()
3933 if (vif->type == NL80211_IFTYPE_STATION && !sta->tdls) { in iwl_mvm_mac_sta_state_common()
3935 mvmvif->ap_sta = NULL; in iwl_mvm_mac_sta_state_common()
3937 ret = callbacks->rm_sta(mvm, vif, sta); in iwl_mvm_mac_sta_state_common()
3938 if (sta->tdls) { in iwl_mvm_mac_sta_state_common()
3940 iwl_mvm_tdls_check_trigger(mvm, vif, sta->addr, in iwl_mvm_mac_sta_state_common()
3946 &mvm->status))) in iwl_mvm_mac_sta_state_common()
3949 ret = -EIO; in iwl_mvm_mac_sta_state_common()
3952 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_sta_state_common()
3954 if (sta->tdls && ret == 0) { in iwl_mvm_mac_sta_state_common()
3970 mvm->rts_threshold = value; in iwl_mvm_mac_set_rts_threshold()
3985 if (vif->type == NL80211_IFTYPE_STATION && in iwl_mvm_sta_rc_update()
3998 mvmvif->deflink.queue_params[ac] = *params; in iwl_mvm_mac_conf_tx()
4004 if (vif->type == NL80211_IFTYPE_P2P_DEVICE) { in iwl_mvm_mac_conf_tx()
4007 mutex_lock(&mvm->mutex); in iwl_mvm_mac_conf_tx()
4009 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_conf_tx()
4021 mutex_lock(&mvm->mutex); in iwl_mvm_mac_mgd_prepare_tx()
4022 iwl_mvm_protect_assoc(mvm, vif, info->duration); in iwl_mvm_mac_mgd_prepare_tx()
4023 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_mgd_prepare_tx()
4033 if (info->success) in iwl_mvm_mac_mgd_complete_tx()
4036 mutex_lock(&mvm->mutex); in iwl_mvm_mac_mgd_complete_tx()
4038 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_mgd_complete_tx()
4050 mutex_lock(&mvm->mutex); in iwl_mvm_mac_sched_scan_start()
4052 if (!vif->cfg.idle) { in iwl_mvm_mac_sched_scan_start()
4053 ret = -EBUSY; in iwl_mvm_mac_sched_scan_start()
4060 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_sched_scan_start()
4070 mutex_lock(&mvm->mutex); in iwl_mvm_mac_sched_scan_stop()
4080 if (!(mvm->scan_status & IWL_MVM_SCAN_SCHED)) { in iwl_mvm_mac_sched_scan_stop()
4081 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_sched_scan_stop()
4086 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_sched_scan_stop()
4102 int keyidx = key->keyidx; in __iwl_mvm_mac_set_key()
4104 u8 sec_key_ver = iwl_fw_lookup_cmd_ver(mvm->fw, sec_key_id, 0); in __iwl_mvm_mac_set_key()
4111 switch (key->cipher) { in __iwl_mvm_mac_set_key()
4113 if (!mvm->trans->trans_cfg->gen2) { in __iwl_mvm_mac_set_key()
4114 key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; in __iwl_mvm_mac_set_key()
4115 key->flags |= IEEE80211_KEY_FLAG_PUT_IV_SPACE; in __iwl_mvm_mac_set_key()
4116 } else if (vif->type == NL80211_IFTYPE_STATION) { in __iwl_mvm_mac_set_key()
4117 key->flags |= IEEE80211_KEY_FLAG_PUT_MIC_SPACE; in __iwl_mvm_mac_set_key()
4120 return -EOPNOTSUPP; in __iwl_mvm_mac_set_key()
4127 key->flags |= IEEE80211_KEY_FLAG_PUT_IV_SPACE; in __iwl_mvm_mac_set_key()
4136 if (vif->type == NL80211_IFTYPE_STATION) in __iwl_mvm_mac_set_key()
4139 return -EOPNOTSUPP; in __iwl_mvm_mac_set_key()
4143 return -EOPNOTSUPP; in __iwl_mvm_mac_set_key()
4148 if (vif->type == NL80211_IFTYPE_STATION && in __iwl_mvm_mac_set_key()
4150 rcu_assign_pointer(mvmvif->bcn_prot.keys[keyidx - 6], in __iwl_mvm_mac_set_key()
4153 if ((vif->type == NL80211_IFTYPE_ADHOC || in __iwl_mvm_mac_set_key()
4154 vif->type == NL80211_IFTYPE_AP) && !sta) { in __iwl_mvm_mac_set_key()
4156 * GTK on AP interface is a TX-only key, return 0; in __iwl_mvm_mac_set_key()
4157 * on IBSS they're per-station and because we're lazy in __iwl_mvm_mac_set_key()
4161 * Except, of course, beacon protection - it must be in __iwl_mvm_mac_set_key()
4165 (key->cipher == WLAN_CIPHER_SUITE_AES_CMAC || in __iwl_mvm_mac_set_key()
4166 key->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 || in __iwl_mvm_mac_set_key()
4167 key->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256)) { in __iwl_mvm_mac_set_key()
4168 ret = -EOPNOTSUPP; in __iwl_mvm_mac_set_key()
4172 if (key->cipher != WLAN_CIPHER_SUITE_GCMP && in __iwl_mvm_mac_set_key()
4173 key->cipher != WLAN_CIPHER_SUITE_GCMP_256 && in __iwl_mvm_mac_set_key()
4175 key->hw_key_idx = STA_KEY_IDX_INVALID; in __iwl_mvm_mac_set_key()
4180 if (!mvmvif->ap_ibss_active) { in __iwl_mvm_mac_set_key()
4182 i < ARRAY_SIZE(mvmvif->ap_early_keys); in __iwl_mvm_mac_set_key()
4184 if (!mvmvif->ap_early_keys[i]) { in __iwl_mvm_mac_set_key()
4185 mvmvif->ap_early_keys[i] = key; in __iwl_mvm_mac_set_key()
4190 if (i >= ARRAY_SIZE(mvmvif->ap_early_keys)) in __iwl_mvm_mac_set_key()
4191 ret = -ENOSPC; in __iwl_mvm_mac_set_key()
4202 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) && in __iwl_mvm_mac_set_key()
4203 key->hw_key_idx == STA_KEY_IDX_INVALID) { in __iwl_mvm_mac_set_key()
4210 if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) && in __iwl_mvm_mac_set_key()
4212 key->flags & IEEE80211_KEY_FLAG_PAIRWISE && in __iwl_mvm_mac_set_key()
4213 (key->cipher == WLAN_CIPHER_SUITE_CCMP || in __iwl_mvm_mac_set_key()
4214 key->cipher == WLAN_CIPHER_SUITE_GCMP || in __iwl_mvm_mac_set_key()
4215 key->cipher == WLAN_CIPHER_SUITE_GCMP_256)) { in __iwl_mvm_mac_set_key()
4219 WARN_ON(rcu_access_pointer(mvmsta->ptk_pn[keyidx])); in __iwl_mvm_mac_set_key()
4221 mvm->trans->num_rx_queues), in __iwl_mvm_mac_set_key()
4224 ret = -ENOMEM; in __iwl_mvm_mac_set_key()
4230 for (q = 0; q < mvm->trans->num_rx_queues; q++) in __iwl_mvm_mac_set_key()
4231 memcpy(ptk_pn->q[q].pn[tid], in __iwl_mvm_mac_set_key()
4236 rcu_assign_pointer(mvmsta->ptk_pn[keyidx], ptk_pn); in __iwl_mvm_mac_set_key()
4240 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) in __iwl_mvm_mac_set_key()
4241 key_offset = key->hw_key_idx; in __iwl_mvm_mac_set_key()
4245 if (mvmsta && key->flags & IEEE80211_KEY_FLAG_PAIRWISE) in __iwl_mvm_mac_set_key()
4246 mvmsta->pairwise_cipher = key->cipher; in __iwl_mvm_mac_set_key()
4249 sta ? sta->addr : NULL, key->keyidx); in __iwl_mvm_mac_set_key()
4258 key->hw_key_idx = STA_KEY_IDX_INVALID; in __iwl_mvm_mac_set_key()
4260 RCU_INIT_POINTER(mvmsta->ptk_pn[keyidx], NULL); in __iwl_mvm_mac_set_key()
4270 ret = -EOPNOTSUPP; in __iwl_mvm_mac_set_key()
4277 if (vif->type == NL80211_IFTYPE_STATION && in __iwl_mvm_mac_set_key()
4279 RCU_INIT_POINTER(mvmvif->bcn_prot.keys[keyidx - 6], in __iwl_mvm_mac_set_key()
4282 ret = -ENOENT; in __iwl_mvm_mac_set_key()
4283 for (i = 0; i < ARRAY_SIZE(mvmvif->ap_early_keys); i++) { in __iwl_mvm_mac_set_key()
4284 if (mvmvif->ap_early_keys[i] == key) { in __iwl_mvm_mac_set_key()
4285 mvmvif->ap_early_keys[i] = NULL; in __iwl_mvm_mac_set_key()
4290 /* found in pending list - don't do anything else */ in __iwl_mvm_mac_set_key()
4294 if (key->hw_key_idx == STA_KEY_IDX_INVALID) { in __iwl_mvm_mac_set_key()
4300 key->flags & IEEE80211_KEY_FLAG_PAIRWISE && in __iwl_mvm_mac_set_key()
4301 (key->cipher == WLAN_CIPHER_SUITE_CCMP || in __iwl_mvm_mac_set_key()
4302 key->cipher == WLAN_CIPHER_SUITE_GCMP || in __iwl_mvm_mac_set_key()
4303 key->cipher == WLAN_CIPHER_SUITE_GCMP_256)) { in __iwl_mvm_mac_set_key()
4305 mvmsta->ptk_pn[keyidx], in __iwl_mvm_mac_set_key()
4306 lockdep_is_held(&mvm->mutex)); in __iwl_mvm_mac_set_key()
4307 RCU_INIT_POINTER(mvmsta->ptk_pn[keyidx], NULL); in __iwl_mvm_mac_set_key()
4319 ret = -EINVAL; in __iwl_mvm_mac_set_key()
4332 mutex_lock(&mvm->mutex); in iwl_mvm_mac_set_key()
4334 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_set_key()
4347 if (keyconf->hw_key_idx == STA_KEY_IDX_INVALID) in iwl_mvm_mac_update_tkip_key()
4363 if (WARN_ON(pkt->hdr.cmd != HOT_SPOT_CMD)) in iwl_mvm_rx_aux_roc()
4371 resp = (void *)pkt->data; in iwl_mvm_rx_aux_roc()
4375 resp->status, resp->event_unique_id); in iwl_mvm_rx_aux_roc()
4377 te_data->uid = le32_to_cpu(resp->event_unique_id); in iwl_mvm_rx_aux_roc()
4378 IWL_DEBUG_TE(mvm, "TIME_EVENT_CMD response - UID = 0x%x\n", in iwl_mvm_rx_aux_roc()
4379 te_data->uid); in iwl_mvm_rx_aux_roc()
4381 spin_lock_bh(&mvm->time_event_lock); in iwl_mvm_rx_aux_roc()
4382 list_add_tail(&te_data->list, &mvm->aux_roc_te_list); in iwl_mvm_rx_aux_roc()
4383 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_rx_aux_roc()
4400 struct iwl_mvm_time_event_data *te_data = &mvmvif->hs_time_event_data; in iwl_mvm_send_aux_roc_cmd()
4403 u32 dtim_interval = vif->bss_conf.dtim_period * in iwl_mvm_send_aux_roc_cmd()
4404 vif->bss_conf.beacon_int; in iwl_mvm_send_aux_roc_cmd()
4410 .sta_id_and_color = cpu_to_le32(mvm->aux_sta.sta_id), in iwl_mvm_send_aux_roc_cmd()
4414 u16 len = sizeof(aux_roc_req) - iwl_mvm_chan_info_padding(mvm); in iwl_mvm_send_aux_roc_cmd()
4417 iwl_mvm_set_chan_info(mvm, &aux_roc_req.channel_info, channel->hw_value, in iwl_mvm_send_aux_roc_cmd()
4418 iwl_mvm_phy_band_from_nl80211(channel->band), in iwl_mvm_send_aux_roc_cmd()
4423 tail->apply_time = cpu_to_le32(iwl_mvm_get_systime(mvm)); in iwl_mvm_send_aux_roc_cmd()
4432 * remain off-channel for the max duration. in iwl_mvm_send_aux_roc_cmd()
4434 * like the delay to be for 2-3 dtim intervals, in case there are in iwl_mvm_send_aux_roc_cmd()
4437 if (vif->cfg.assoc) { in iwl_mvm_send_aux_roc_cmd()
4439 /* We cannot remain off-channel longer than the DTIM interval */ in iwl_mvm_send_aux_roc_cmd()
4441 req_dur = dtim_interval - AUX_ROC_SAFETY_BUFFER; in iwl_mvm_send_aux_roc_cmd()
4443 req_dur = dtim_interval - in iwl_mvm_send_aux_roc_cmd()
4448 tail->duration = cpu_to_le32(req_dur); in iwl_mvm_send_aux_roc_cmd()
4449 tail->apply_time_max_delay = cpu_to_le32(delay); in iwl_mvm_send_aux_roc_cmd()
4453 channel->hw_value, req_dur); in iwl_mvm_send_aux_roc_cmd()
4459 memcpy(tail->node_addr, vif->addr, ETH_ALEN); in iwl_mvm_send_aux_roc_cmd()
4461 lockdep_assert_held(&mvm->mutex); in iwl_mvm_send_aux_roc_cmd()
4463 spin_lock_bh(&mvm->time_event_lock); in iwl_mvm_send_aux_roc_cmd()
4465 if (WARN_ON(te_data->id == HOT_SPOT_CMD)) { in iwl_mvm_send_aux_roc_cmd()
4466 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_send_aux_roc_cmd()
4467 return -EIO; in iwl_mvm_send_aux_roc_cmd()
4470 te_data->vif = vif; in iwl_mvm_send_aux_roc_cmd()
4471 te_data->duration = duration; in iwl_mvm_send_aux_roc_cmd()
4472 te_data->id = HOT_SPOT_CMD; in iwl_mvm_send_aux_roc_cmd()
4474 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_send_aux_roc_cmd()
4485 iwl_init_notification_wait(&mvm->notif_wait, &wait_time_event, in iwl_mvm_send_aux_roc_cmd()
4495 iwl_remove_notification(&mvm->notif_wait, &wait_time_event); in iwl_mvm_send_aux_roc_cmd()
4500 res = iwl_wait_notification(&mvm->notif_wait, &wait_time_event, 1); in iwl_mvm_send_aux_roc_cmd()
4506 spin_lock_bh(&mvm->time_event_lock); in iwl_mvm_send_aux_roc_cmd()
4508 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_send_aux_roc_cmd()
4518 lockdep_assert_held(&mvm->mutex); in iwl_mvm_add_aux_sta_for_hs20()
4520 if (!fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_add_aux_sta_for_hs20()
4523 return -EINVAL; in iwl_mvm_add_aux_sta_for_hs20()
4526 if (iwl_mvm_has_new_station_api(mvm->fw)) { in iwl_mvm_add_aux_sta_for_hs20()
4541 lockdep_assert_held(&mvm->mutex); in iwl_mvm_roc_switch_binding()
4550 iwl_mvm_phy_ctxt_unref(mvm, mvmvif->deflink.phy_ctxt); in iwl_mvm_roc_switch_binding()
4553 mvmvif->deflink.phy_ctxt = new_phy_ctxt; in iwl_mvm_roc_switch_binding()
4574 /* Execute the common part for MLD and non-MLD modes */
4588 IWL_DEBUG_MAC80211(mvm, "enter (%d, %d, %d)\n", channel->hw_value, in iwl_mvm_roc_common()
4595 flush_work(&mvm->roc_done_wk); in iwl_mvm_roc_common()
4597 mutex_lock(&mvm->mutex); in iwl_mvm_roc_common()
4599 switch (vif->type) { in iwl_mvm_roc_common()
4601 lmac_id = iwl_mvm_get_lmac_id(mvm, channel->band); in iwl_mvm_roc_common()
4604 ret = ops->add_aux_sta_for_hs20(mvm, lmac_id); in iwl_mvm_roc_common()
4613 IWL_ERR(mvm, "vif isn't P2P_DEVICE: %d\n", vif->type); in iwl_mvm_roc_common()
4614 ret = -EINVAL; in iwl_mvm_roc_common()
4619 phy_ctxt = &mvm->phy_ctxts[i]; in iwl_mvm_roc_common()
4620 if (phy_ctxt->ref == 0 || mvmvif->deflink.phy_ctxt == phy_ctxt) in iwl_mvm_roc_common()
4623 if (phy_ctxt->ref && channel == phy_ctxt->channel) { in iwl_mvm_roc_common()
4624 ret = ops->switch_phy_ctxt(mvm, vif, phy_ctxt); in iwl_mvm_roc_common()
4628 iwl_mvm_phy_ctxt_ref(mvm, mvmvif->deflink.phy_ctxt); in iwl_mvm_roc_common()
4634 if (channel == mvmvif->deflink.phy_ctxt->channel) in iwl_mvm_roc_common()
4640 * Check if the remain-on-channel is on a different band and that in iwl_mvm_roc_common()
4642 * so, we'll need to release and then re-configure here, since we in iwl_mvm_roc_common()
4646 fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_roc_common()
4648 mvmvif->deflink.phy_ctxt->channel->band != chandef.chan->band; in iwl_mvm_roc_common()
4650 if (mvmvif->deflink.phy_ctxt->ref == 1 && !band_change_removal) { in iwl_mvm_roc_common()
4655 ret = iwl_mvm_phy_ctxt_changed(mvm, mvmvif->deflink.phy_ctxt, in iwl_mvm_roc_common()
4667 ret = -ENOSPC; in iwl_mvm_roc_common()
4678 ret = ops->switch_phy_ctxt(mvm, vif, phy_ctxt); in iwl_mvm_roc_common()
4682 iwl_mvm_phy_ctxt_ref(mvm, mvmvif->deflink.phy_ctxt); in iwl_mvm_roc_common()
4690 mutex_unlock(&mvm->mutex); in iwl_mvm_roc_common()
4702 mutex_lock(&mvm->mutex); in iwl_mvm_cancel_roc()
4704 mutex_unlock(&mvm->mutex); in iwl_mvm_cancel_roc()
4720 if (rcu_access_pointer(vif->bss_conf.chanctx_conf) == data->ctx && in iwl_mvm_ftm_responder_chanctx_iter()
4721 vif->type == NL80211_IFTYPE_AP && vif->bss_conf.ftmr_params) in iwl_mvm_ftm_responder_chanctx_iter()
4722 data->responder = true; in iwl_mvm_ftm_responder_chanctx_iter()
4733 ieee80211_iterate_active_interfaces_atomic(mvm->hw, in iwl_mvm_is_ftm_responder_chanctx()
4743 u16 *phy_ctxt_id = (u16 *)ctx->drv_priv; in __iwl_mvm_add_chanctx()
4746 struct cfg80211_chan_def *def = responder ? &ctx->def : &ctx->min_def; in __iwl_mvm_add_chanctx()
4749 lockdep_assert_held(&mvm->mutex); in __iwl_mvm_add_chanctx()
4755 ret = -ENOSPC; in __iwl_mvm_add_chanctx()
4760 ctx->rx_chains_static, in __iwl_mvm_add_chanctx()
4761 ctx->rx_chains_dynamic); in __iwl_mvm_add_chanctx()
4768 *phy_ctxt_id = phy_ctxt->id; in __iwl_mvm_add_chanctx()
4779 mutex_lock(&mvm->mutex); in iwl_mvm_add_chanctx()
4781 mutex_unlock(&mvm->mutex); in iwl_mvm_add_chanctx()
4789 u16 *phy_ctxt_id = (u16 *)ctx->drv_priv; in __iwl_mvm_remove_chanctx()
4790 struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id]; in __iwl_mvm_remove_chanctx()
4792 lockdep_assert_held(&mvm->mutex); in __iwl_mvm_remove_chanctx()
4802 mutex_lock(&mvm->mutex); in iwl_mvm_remove_chanctx()
4804 mutex_unlock(&mvm->mutex); in iwl_mvm_remove_chanctx()
4811 u16 *phy_ctxt_id = (u16 *)ctx->drv_priv; in iwl_mvm_change_chanctx()
4812 struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id]; in iwl_mvm_change_chanctx()
4814 struct cfg80211_chan_def *def = responder ? &ctx->def : &ctx->min_def; in iwl_mvm_change_chanctx()
4816 if (WARN_ONCE((phy_ctxt->ref > 1) && in iwl_mvm_change_chanctx()
4822 phy_ctxt->ref, changed)) in iwl_mvm_change_chanctx()
4825 mutex_lock(&mvm->mutex); in iwl_mvm_change_chanctx()
4829 if (phy_ctxt->width == def->width) in iwl_mvm_change_chanctx()
4833 if (phy_ctxt->width <= NL80211_CHAN_WIDTH_20 && in iwl_mvm_change_chanctx()
4834 def->width <= NL80211_CHAN_WIDTH_20) in iwl_mvm_change_chanctx()
4840 ctx->rx_chains_static, in iwl_mvm_change_chanctx()
4841 ctx->rx_chains_dynamic); in iwl_mvm_change_chanctx()
4844 mutex_unlock(&mvm->mutex); in iwl_mvm_change_chanctx()
4848 * This function executes the common part for MLD and non-MLD modes.
4859 u16 *phy_ctxt_id = (u16 *)ctx->drv_priv; in __iwl_mvm_assign_vif_chanctx_common()
4860 struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id]; in __iwl_mvm_assign_vif_chanctx_common()
4863 lockdep_assert_held(&mvm->mutex); in __iwl_mvm_assign_vif_chanctx_common()
4865 mvmvif->deflink.phy_ctxt = phy_ctxt; in __iwl_mvm_assign_vif_chanctx_common()
4867 switch (vif->type) { in __iwl_mvm_assign_vif_chanctx_common()
4871 mvmvif->ap_ibss_active = true; in __iwl_mvm_assign_vif_chanctx_common()
4886 mvmvif->ps_disabled = true; in __iwl_mvm_assign_vif_chanctx_common()
4889 *ret = -EINVAL; in __iwl_mvm_assign_vif_chanctx_common()
4905 return -EINVAL; in __iwl_mvm_assign_vif_chanctx()
4925 if (vif->type == NL80211_IFTYPE_MONITOR) { in __iwl_mvm_assign_vif_chanctx()
4926 mvmvif->monitor_active = true; in __iwl_mvm_assign_vif_chanctx()
4938 if (vif->type == NL80211_IFTYPE_AP) { in __iwl_mvm_assign_vif_chanctx()
4943 if (vif->type == NL80211_IFTYPE_STATION) { in __iwl_mvm_assign_vif_chanctx()
4945 mvmvif->csa_bcn_pending = false; in __iwl_mvm_assign_vif_chanctx()
4949 mvmvif->csa_bcn_pending = true; in __iwl_mvm_assign_vif_chanctx()
4951 if (!fw_has_capa(&mvm->fw->ucode_capa, in __iwl_mvm_assign_vif_chanctx()
4953 u32 duration = 3 * vif->bss_conf.beacon_int; in __iwl_mvm_assign_vif_chanctx()
4959 vif->bss_conf.beacon_int / 2, in __iwl_mvm_assign_vif_chanctx()
4973 mvmvif->deflink.phy_ctxt = NULL; in __iwl_mvm_assign_vif_chanctx()
4985 mutex_lock(&mvm->mutex); in iwl_mvm_assign_vif_chanctx()
4987 mutex_unlock(&mvm->mutex); in iwl_mvm_assign_vif_chanctx()
4993 * This function executes the common part for MLD and non-MLD modes.
5004 lockdep_assert_held(&mvm->mutex); in __iwl_mvm_unassign_vif_chanctx_common()
5006 &mvmvif->time_event_data); in __iwl_mvm_unassign_vif_chanctx_common()
5008 switch (vif->type) { in __iwl_mvm_unassign_vif_chanctx_common()
5012 mvmvif->monitor_active = false; in __iwl_mvm_unassign_vif_chanctx_common()
5013 mvmvif->ps_disabled = false; in __iwl_mvm_unassign_vif_chanctx_common()
5017 if (!switching_chanctx || !mvmvif->ap_ibss_active) in __iwl_mvm_unassign_vif_chanctx_common()
5020 mvmvif->csa_countdown = false; in __iwl_mvm_unassign_vif_chanctx_common()
5026 rcu_assign_pointer(mvm->csa_tx_blocked_vif, vif); in __iwl_mvm_unassign_vif_chanctx_common()
5028 mvmvif->ap_ibss_active = false; in __iwl_mvm_unassign_vif_chanctx_common()
5048 if (vif->type == NL80211_IFTYPE_MONITOR) in __iwl_mvm_unassign_vif_chanctx()
5052 if (vif->type == NL80211_IFTYPE_STATION && switching_chanctx) { in __iwl_mvm_unassign_vif_chanctx()
5054 if (!fw_has_capa(&mvm->fw->ucode_capa, in __iwl_mvm_unassign_vif_chanctx()
5063 if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD) && in __iwl_mvm_unassign_vif_chanctx()
5066 mvmvif->deflink.phy_ctxt = NULL; in __iwl_mvm_unassign_vif_chanctx()
5077 mutex_lock(&mvm->mutex); in iwl_mvm_unassign_vif_chanctx()
5079 mutex_unlock(&mvm->mutex); in iwl_mvm_unassign_vif_chanctx()
5089 mutex_lock(&mvm->mutex); in iwl_mvm_switch_vif_chanctx_swap()
5090 ops->__unassign_vif_chanctx(mvm, vifs[0].vif, vifs[0].link_conf, in iwl_mvm_switch_vif_chanctx_swap()
5100 ret = ops->__assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].link_conf, in iwl_mvm_switch_vif_chanctx_swap()
5108 /* we don't support TDLS during DCM - can be caused by channel switch */ in iwl_mvm_switch_vif_chanctx_swap()
5123 if (ops->__assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].link_conf, in iwl_mvm_switch_vif_chanctx_swap()
5136 mutex_unlock(&mvm->mutex); in iwl_mvm_switch_vif_chanctx_swap()
5148 mutex_lock(&mvm->mutex); in iwl_mvm_switch_vif_chanctx_reassign()
5149 ops->__unassign_vif_chanctx(mvm, vifs[0].vif, vifs[0].link_conf, in iwl_mvm_switch_vif_chanctx_reassign()
5152 ret = ops->__assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].link_conf, in iwl_mvm_switch_vif_chanctx_reassign()
5163 if (ops->__assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].link_conf, in iwl_mvm_switch_vif_chanctx_reassign()
5176 mutex_unlock(&mvm->mutex); in iwl_mvm_switch_vif_chanctx_reassign()
5181 /* Execute the common part for both MLD and non-MLD modes */
5192 /* we only support a single-vif right now */ in iwl_mvm_switch_vif_chanctx_common()
5194 return -EOPNOTSUPP; in iwl_mvm_switch_vif_chanctx_common()
5204 ret = -EOPNOTSUPP; in iwl_mvm_switch_vif_chanctx_common()
5228 return mvm->ibss_manager; in iwl_mvm_tx_last_beacon()
5237 if (!mvm_sta || !mvm_sta->vif) { in iwl_mvm_set_tim()
5239 return -EINVAL; in iwl_mvm_set_tim()
5242 return iwl_mvm_mac_ctxt_beacon_changed(mvm, mvm_sta->vif, in iwl_mvm_set_tim()
5243 &mvm_sta->vif->bss_conf); in iwl_mvm_set_tim()
5267 return -EINVAL; in __iwl_mvm_mac_testmode_cmd()
5271 if (!vif || vif->type != NL80211_IFTYPE_AP || !vif->p2p || in __iwl_mvm_mac_testmode_cmd()
5272 !vif->bss_conf.enable_beacon || in __iwl_mvm_mac_testmode_cmd()
5274 return -EINVAL; in __iwl_mvm_mac_testmode_cmd()
5277 if (noa_duration >= vif->bss_conf.beacon_int) in __iwl_mvm_mac_testmode_cmd()
5278 return -EINVAL; in __iwl_mvm_mac_testmode_cmd()
5280 mvm->noa_duration = noa_duration; in __iwl_mvm_mac_testmode_cmd()
5281 mvm->noa_vif = vif; in __iwl_mvm_mac_testmode_cmd()
5285 /* must be associated client vif - ignore authorized */ in __iwl_mvm_mac_testmode_cmd()
5286 if (!vif || vif->type != NL80211_IFTYPE_STATION || in __iwl_mvm_mac_testmode_cmd()
5287 !vif->cfg.assoc || !vif->bss_conf.dtim_period || in __iwl_mvm_mac_testmode_cmd()
5289 return -EINVAL; in __iwl_mvm_mac_testmode_cmd()
5296 return -EOPNOTSUPP; in __iwl_mvm_mac_testmode_cmd()
5306 mutex_lock(&mvm->mutex); in iwl_mvm_mac_testmode_cmd()
5308 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_testmode_cmd()
5333 .mac_id = cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id, in iwl_mvm_schedule_client_csa()
5334 mvmvif->color)), in iwl_mvm_schedule_client_csa()
5336 .tsf = cpu_to_le32(chsw->timestamp), in iwl_mvm_schedule_client_csa()
5337 .cs_count = chsw->count, in iwl_mvm_schedule_client_csa()
5338 .cs_mode = chsw->block_tx, in iwl_mvm_schedule_client_csa()
5341 lockdep_assert_held(&mvm->mutex); in iwl_mvm_schedule_client_csa()
5343 if (chsw->delay) in iwl_mvm_schedule_client_csa()
5345 DIV_ROUND_UP(chsw->delay, vif->bss_conf.beacon_int); in iwl_mvm_schedule_client_csa()
5366 if (chsw->count <= 1) in iwl_mvm_old_pre_chan_sw_sta()
5369 apply_time = chsw->device_timestamp + in iwl_mvm_old_pre_chan_sw_sta()
5370 ((vif->bss_conf.beacon_int * (chsw->count - 1) - in iwl_mvm_old_pre_chan_sw_sta()
5373 if (chsw->block_tx) in iwl_mvm_old_pre_chan_sw_sta()
5376 if (mvmvif->bf_data.bf_enabled) { in iwl_mvm_old_pre_chan_sw_sta()
5383 iwl_mvm_schedule_csa_period(mvm, vif, vif->bss_conf.beacon_int, in iwl_mvm_old_pre_chan_sw_sta()
5399 mutex_lock(&mvm->mutex); in iwl_mvm_pre_channel_switch()
5401 mvmvif->csa_failed = false; in iwl_mvm_pre_channel_switch()
5404 chsw->chandef.center_freq1); in iwl_mvm_pre_channel_switch()
5406 iwl_fw_dbg_trigger_simple_stop(&mvm->fwrt, in iwl_mvm_pre_channel_switch()
5410 switch (vif->type) { in iwl_mvm_pre_channel_switch()
5413 rcu_dereference_protected(mvm->csa_vif, in iwl_mvm_pre_channel_switch()
5414 lockdep_is_held(&mvm->mutex)); in iwl_mvm_pre_channel_switch()
5415 if (WARN_ONCE(csa_vif && csa_vif->bss_conf.csa_active, in iwl_mvm_pre_channel_switch()
5417 ret = -EBUSY; in iwl_mvm_pre_channel_switch()
5422 if (rcu_dereference_protected(mvm->csa_tx_blocked_vif, in iwl_mvm_pre_channel_switch()
5423 lockdep_is_held(&mvm->mutex))) { in iwl_mvm_pre_channel_switch()
5424 ret = -EBUSY; in iwl_mvm_pre_channel_switch()
5428 rcu_assign_pointer(mvm->csa_vif, vif); in iwl_mvm_pre_channel_switch()
5430 if (WARN_ONCE(mvmvif->csa_countdown, in iwl_mvm_pre_channel_switch()
5432 ret = -EBUSY; in iwl_mvm_pre_channel_switch()
5436 mvmvif->csa_target_freq = chsw->chandef.chan->center_freq; in iwl_mvm_pre_channel_switch()
5444 if (iwl_fw_lookup_notif_ver(mvm->fw, MAC_CONF_GROUP, in iwl_mvm_pre_channel_switch()
5454 if (!vif->cfg.assoc || !vif->bss_conf.dtim_period) { in iwl_mvm_pre_channel_switch()
5455 ret = -EBUSY; in iwl_mvm_pre_channel_switch()
5459 if (chsw->delay > IWL_MAX_CSA_BLOCK_TX) in iwl_mvm_pre_channel_switch()
5460 schedule_delayed_work(&mvmvif->csa_work, 0); in iwl_mvm_pre_channel_switch()
5462 if (chsw->block_tx) { in iwl_mvm_pre_channel_switch()
5467 if (!chsw->count || in iwl_mvm_pre_channel_switch()
5468 chsw->count * vif->bss_conf.beacon_int > in iwl_mvm_pre_channel_switch()
5470 schedule_delayed_work(&mvmvif->csa_work, in iwl_mvm_pre_channel_switch()
5474 if (!fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_pre_channel_switch()
5483 mvmvif->csa_count = chsw->count; in iwl_mvm_pre_channel_switch()
5484 mvmvif->csa_misbehave = false; in iwl_mvm_pre_channel_switch()
5490 mvmvif->ps_disabled = true; in iwl_mvm_pre_channel_switch()
5500 mutex_unlock(&mvm->mutex); in iwl_mvm_pre_channel_switch()
5512 .mac_id = cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id, in iwl_mvm_channel_switch_rx_beacon()
5513 mvmvif->color)), in iwl_mvm_channel_switch_rx_beacon()
5515 .tsf = cpu_to_le32(chsw->timestamp), in iwl_mvm_channel_switch_rx_beacon()
5516 .cs_count = chsw->count, in iwl_mvm_channel_switch_rx_beacon()
5517 .cs_mode = chsw->block_tx, in iwl_mvm_channel_switch_rx_beacon()
5524 if (iwl_fw_lookup_notif_ver(mvm->fw, MAC_CONF_GROUP, in iwl_mvm_channel_switch_rx_beacon()
5528 if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_CS_MODIFY)) in iwl_mvm_channel_switch_rx_beacon()
5532 mvmvif->id, chsw->count, mvmvif->csa_count, chsw->block_tx); in iwl_mvm_channel_switch_rx_beacon()
5534 if (chsw->count >= mvmvif->csa_count && chsw->block_tx) { in iwl_mvm_channel_switch_rx_beacon()
5535 if (mvmvif->csa_misbehave) { in iwl_mvm_channel_switch_rx_beacon()
5539 mvmvif->csa_misbehave = false; in iwl_mvm_channel_switch_rx_beacon()
5542 mvmvif->csa_misbehave = true; in iwl_mvm_channel_switch_rx_beacon()
5544 mvmvif->csa_count = chsw->count; in iwl_mvm_channel_switch_rx_beacon()
5546 mutex_lock(&mvm->mutex); in iwl_mvm_channel_switch_rx_beacon()
5547 if (mvmvif->csa_failed) in iwl_mvm_channel_switch_rx_beacon()
5555 mutex_unlock(&mvm->mutex); in iwl_mvm_channel_switch_rx_beacon()
5564 mutex_lock(&mvm->mutex); in iwl_mvm_flush_no_vif()
5567 mutex_unlock(&mvm->mutex); in iwl_mvm_flush_no_vif()
5569 iwl_trans_wait_tx_queues_empty(mvm->trans, queues); in iwl_mvm_flush_no_vif()
5574 mutex_lock(&mvm->mutex); in iwl_mvm_flush_no_vif()
5575 for (i = 0; i < mvm->fw->ucode_capa.num_stations; i++) { in iwl_mvm_flush_no_vif()
5578 sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[i], in iwl_mvm_flush_no_vif()
5579 lockdep_is_held(&mvm->mutex)); in iwl_mvm_flush_no_vif()
5589 mutex_unlock(&mvm->mutex); in iwl_mvm_flush_no_vif()
5609 flush_work(&mvm->add_stream_wk); in iwl_mvm_mac_flush()
5611 mutex_lock(&mvm->mutex); in iwl_mvm_mac_flush()
5614 /* flush the AP-station and all TDLS peers */ in iwl_mvm_mac_flush()
5615 for (i = 0; i < mvm->fw->ucode_capa.num_stations; i++) { in iwl_mvm_mac_flush()
5616 sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[i], in iwl_mvm_mac_flush()
5617 lockdep_is_held(&mvm->mutex)); in iwl_mvm_mac_flush()
5622 if (mvmsta->vif != vif) in iwl_mvm_mac_flush()
5625 if (sta == mvmvif->ap_sta) { in iwl_mvm_mac_flush()
5638 msk |= mvmsta->tfd_queue_msk; in iwl_mvm_mac_flush()
5642 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_flush()
5648 iwl_trans_wait_tx_queues_empty(mvm->trans, msk); in iwl_mvm_mac_flush()
5657 mutex_lock(&mvm->mutex); in iwl_mvm_mac_flush_sta()
5658 for (i = 0; i < mvm->fw->ucode_capa.num_stations; i++) { in iwl_mvm_mac_flush_sta()
5662 tmp = rcu_dereference_protected(mvm->fw_id_to_mac_id[i], in iwl_mvm_mac_flush_sta()
5663 lockdep_is_held(&mvm->mutex)); in iwl_mvm_mac_flush_sta()
5672 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_flush_sta()
5685 return -ENOENT; in iwl_mvm_mac_get_survey()
5687 if (!fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_get_survey()
5689 return -ENOENT; in iwl_mvm_mac_get_survey()
5691 mutex_lock(&mvm->mutex); in iwl_mvm_mac_get_survey()
5699 survey->filled = SURVEY_INFO_TIME | in iwl_mvm_mac_get_survey()
5703 survey->time = mvm->accu_radio_stats.on_time_rf + in iwl_mvm_mac_get_survey()
5704 mvm->radio_stats.on_time_rf; in iwl_mvm_mac_get_survey()
5705 do_div(survey->time, USEC_PER_MSEC); in iwl_mvm_mac_get_survey()
5707 survey->time_rx = mvm->accu_radio_stats.rx_time + in iwl_mvm_mac_get_survey()
5708 mvm->radio_stats.rx_time; in iwl_mvm_mac_get_survey()
5709 do_div(survey->time_rx, USEC_PER_MSEC); in iwl_mvm_mac_get_survey()
5711 survey->time_tx = mvm->accu_radio_stats.tx_time + in iwl_mvm_mac_get_survey()
5712 mvm->radio_stats.tx_time; in iwl_mvm_mac_get_survey()
5713 do_div(survey->time_tx, USEC_PER_MSEC); in iwl_mvm_mac_get_survey()
5715 survey->time_scan = mvm->accu_radio_stats.on_time_scan + in iwl_mvm_mac_get_survey()
5716 mvm->radio_stats.on_time_scan; in iwl_mvm_mac_get_survey()
5717 do_div(survey->time_scan, USEC_PER_MSEC); in iwl_mvm_mac_get_survey()
5721 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_get_survey()
5732 rinfo->bw = RATE_INFO_BW_20; in iwl_mvm_set_sta_rate()
5735 rinfo->bw = RATE_INFO_BW_40; in iwl_mvm_set_sta_rate()
5738 rinfo->bw = RATE_INFO_BW_80; in iwl_mvm_set_sta_rate()
5741 rinfo->bw = RATE_INFO_BW_160; in iwl_mvm_set_sta_rate()
5744 rinfo->bw = RATE_INFO_BW_320; in iwl_mvm_set_sta_rate()
5758 rinfo->legacy = 10; in iwl_mvm_set_sta_rate()
5761 rinfo->legacy = 20; in iwl_mvm_set_sta_rate()
5764 rinfo->legacy = 55; in iwl_mvm_set_sta_rate()
5767 rinfo->legacy = 110; in iwl_mvm_set_sta_rate()
5770 rinfo->legacy = 60; in iwl_mvm_set_sta_rate()
5773 rinfo->legacy = 90; in iwl_mvm_set_sta_rate()
5776 rinfo->legacy = 120; in iwl_mvm_set_sta_rate()
5779 rinfo->legacy = 180; in iwl_mvm_set_sta_rate()
5782 rinfo->legacy = 240; in iwl_mvm_set_sta_rate()
5785 rinfo->legacy = 360; in iwl_mvm_set_sta_rate()
5788 rinfo->legacy = 480; in iwl_mvm_set_sta_rate()
5791 rinfo->legacy = 540; in iwl_mvm_set_sta_rate()
5796 rinfo->nss = u32_get_bits(rate_n_flags, in iwl_mvm_set_sta_rate()
5798 rinfo->mcs = format == RATE_MCS_HT_MSK ? in iwl_mvm_set_sta_rate()
5803 rinfo->flags |= RATE_INFO_FLAGS_SHORT_GI; in iwl_mvm_set_sta_rate()
5808 rinfo->flags |= RATE_INFO_FLAGS_EHT_MCS; in iwl_mvm_set_sta_rate()
5813 rinfo->flags |= RATE_INFO_FLAGS_HE_MCS; in iwl_mvm_set_sta_rate()
5816 rinfo->bw = RATE_INFO_BW_HE_RU; in iwl_mvm_set_sta_rate()
5817 rinfo->he_ru_alloc = NL80211_RATE_INFO_HE_RU_ALLOC_106; in iwl_mvm_set_sta_rate()
5824 rinfo->he_gi = NL80211_RATE_INFO_HE_GI_0_8; in iwl_mvm_set_sta_rate()
5826 rinfo->he_gi = NL80211_RATE_INFO_HE_GI_1_6; in iwl_mvm_set_sta_rate()
5828 rinfo->he_gi = NL80211_RATE_INFO_HE_GI_3_2; in iwl_mvm_set_sta_rate()
5830 rinfo->he_gi = NL80211_RATE_INFO_HE_GI_0_8; in iwl_mvm_set_sta_rate()
5834 rinfo->he_gi = NL80211_RATE_INFO_HE_GI_0_8; in iwl_mvm_set_sta_rate()
5836 rinfo->he_gi = NL80211_RATE_INFO_HE_GI_1_6; in iwl_mvm_set_sta_rate()
5838 rinfo->he_gi = NL80211_RATE_INFO_HE_GI_3_2; in iwl_mvm_set_sta_rate()
5842 rinfo->he_gi = NL80211_RATE_INFO_HE_GI_1_6; in iwl_mvm_set_sta_rate()
5844 rinfo->he_gi = NL80211_RATE_INFO_HE_GI_3_2; in iwl_mvm_set_sta_rate()
5849 rinfo->he_dcm = 1; in iwl_mvm_set_sta_rate()
5852 rinfo->flags |= RATE_INFO_FLAGS_MCS; in iwl_mvm_set_sta_rate()
5855 rinfo->flags |= RATE_INFO_FLAGS_VHT_MCS; in iwl_mvm_set_sta_rate()
5869 if (mvmsta->deflink.avg_energy) { in iwl_mvm_mac_sta_statistics()
5870 sinfo->signal_avg = -(s8)mvmsta->deflink.avg_energy; in iwl_mvm_mac_sta_statistics()
5871 sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL_AVG); in iwl_mvm_mac_sta_statistics()
5875 struct iwl_lq_sta_rs_fw *lq_sta = &mvmsta->deflink.lq_sta.rs_fw; in iwl_mvm_mac_sta_statistics()
5877 iwl_mvm_set_sta_rate(lq_sta->last_rate_n_flags, &sinfo->txrate); in iwl_mvm_mac_sta_statistics()
5878 sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE); in iwl_mvm_mac_sta_statistics()
5882 if (!(vif->driver_flags & IEEE80211_VIF_BEACON_FILTER)) in iwl_mvm_mac_sta_statistics()
5885 if (!vif->cfg.assoc) in iwl_mvm_mac_sta_statistics()
5888 mutex_lock(&mvm->mutex); in iwl_mvm_mac_sta_statistics()
5890 if (mvmvif->deflink.ap_sta_id != mvmsta->deflink.sta_id) in iwl_mvm_mac_sta_statistics()
5896 sinfo->rx_beacon = mvmvif->deflink.beacon_stats.num_beacons + in iwl_mvm_mac_sta_statistics()
5897 mvmvif->deflink.beacon_stats.accu_num_beacons; in iwl_mvm_mac_sta_statistics()
5898 sinfo->filled |= BIT_ULL(NL80211_STA_INFO_BEACON_RX); in iwl_mvm_mac_sta_statistics()
5899 if (mvmvif->deflink.beacon_stats.avg_signal) { in iwl_mvm_mac_sta_statistics()
5901 sinfo->rx_beacon_signal_avg = in iwl_mvm_mac_sta_statistics()
5902 mvmvif->deflink.beacon_stats.avg_signal; in iwl_mvm_mac_sta_statistics()
5903 sinfo->filled |= BIT_ULL(NL80211_STA_INFO_BEACON_SIGNAL_AVG); in iwl_mvm_mac_sta_statistics()
5906 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_sta_statistics()
5913 if ((mlme->data == ASSOC_EVENT || mlme->data == AUTH_EVENT) && in iwl_mvm_event_mlme_callback_ini()
5914 (mlme->status == MLME_DENIED || mlme->status == MLME_TIMEOUT)) { in iwl_mvm_event_mlme_callback_ini()
5915 iwl_dbg_tlv_time_point(&mvm->fwrt, in iwl_mvm_event_mlme_callback_ini()
5921 if (mlme->data == DEAUTH_RX_EVENT || mlme->data == DEAUTH_TX_EVENT) { in iwl_mvm_event_mlme_callback_ini()
5922 iwl_dbg_tlv_time_point(&mvm->fwrt, in iwl_mvm_event_mlme_callback_ini()
5935 if ((trig_mlme->_cnt) && --(trig_mlme->_cnt)) \ in iwl_mvm_event_mlme_callback()
5937 iwl_fw_dbg_collect_trig(&(mvm)->fwrt, trig, _fmt); \ in iwl_mvm_event_mlme_callback()
5943 if (iwl_trans_dbg_ini_valid(mvm->trans)) { in iwl_mvm_event_mlme_callback()
5944 iwl_mvm_event_mlme_callback_ini(mvm, vif, &event->u.mlme); in iwl_mvm_event_mlme_callback()
5948 trig = iwl_fw_dbg_trigger_on(&mvm->fwrt, ieee80211_vif_to_wdev(vif), in iwl_mvm_event_mlme_callback()
5953 trig_mlme = (void *)trig->data; in iwl_mvm_event_mlme_callback()
5955 if (event->u.mlme.data == ASSOC_EVENT) { in iwl_mvm_event_mlme_callback()
5956 if (event->u.mlme.status == MLME_DENIED) in iwl_mvm_event_mlme_callback()
5959 event->u.mlme.reason); in iwl_mvm_event_mlme_callback()
5960 else if (event->u.mlme.status == MLME_TIMEOUT) in iwl_mvm_event_mlme_callback()
5963 } else if (event->u.mlme.data == AUTH_EVENT) { in iwl_mvm_event_mlme_callback()
5964 if (event->u.mlme.status == MLME_DENIED) in iwl_mvm_event_mlme_callback()
5967 event->u.mlme.reason); in iwl_mvm_event_mlme_callback()
5968 else if (event->u.mlme.status == MLME_TIMEOUT) in iwl_mvm_event_mlme_callback()
5971 } else if (event->u.mlme.data == DEAUTH_RX_EVENT) { in iwl_mvm_event_mlme_callback()
5973 "DEAUTH RX %d", event->u.mlme.reason); in iwl_mvm_event_mlme_callback()
5974 } else if (event->u.mlme.data == DEAUTH_TX_EVENT) { in iwl_mvm_event_mlme_callback()
5976 "DEAUTH TX %d", event->u.mlme.reason); in iwl_mvm_event_mlme_callback()
5988 trig = iwl_fw_dbg_trigger_on(&mvm->fwrt, ieee80211_vif_to_wdev(vif), in iwl_mvm_event_bar_rx_callback()
5993 ba_trig = (void *)trig->data; in iwl_mvm_event_bar_rx_callback()
5995 if (!(le16_to_cpu(ba_trig->rx_bar) & BIT(event->u.ba.tid))) in iwl_mvm_event_bar_rx_callback()
5998 iwl_fw_dbg_collect_trig(&mvm->fwrt, trig, in iwl_mvm_event_bar_rx_callback()
6000 event->u.ba.sta->addr, event->u.ba.tid, in iwl_mvm_event_bar_rx_callback()
6001 event->u.ba.ssn); in iwl_mvm_event_bar_rx_callback()
6010 switch (event->type) { in iwl_mvm_mac_event_callback()
6018 iwl_mvm_event_frame_timeout_callback(mvm, vif, event->u.ba.sta, in iwl_mvm_mac_event_callback()
6019 event->u.ba.tid); in iwl_mvm_mac_event_callback()
6035 .cmd.rxq_mask = cpu_to_le32(BIT(mvm->trans->num_rx_queues) - 1), in iwl_mvm_sync_rx_queues_internal()
6060 cmd.notif.cookie = mvm->queue_sync_cookie; in iwl_mvm_sync_rx_queues_internal()
6061 mvm->queue_sync_state = (1 << mvm->trans->num_rx_queues) - 1; in iwl_mvm_sync_rx_queues_internal()
6071 lockdep_assert_held(&mvm->mutex); in iwl_mvm_sync_rx_queues_internal()
6072 ret = wait_event_timeout(mvm->rx_sync_waitq, in iwl_mvm_sync_rx_queues_internal()
6073 READ_ONCE(mvm->queue_sync_state) == 0 || in iwl_mvm_sync_rx_queues_internal()
6078 mvm->queue_sync_state); in iwl_mvm_sync_rx_queues_internal()
6083 mvm->queue_sync_state = 0; in iwl_mvm_sync_rx_queues_internal()
6084 mvm->queue_sync_cookie++; in iwl_mvm_sync_rx_queues_internal()
6092 mutex_lock(&mvm->mutex); in iwl_mvm_sync_rx_queues()
6094 mutex_unlock(&mvm->mutex); in iwl_mvm_sync_rx_queues()
6105 if (vif->p2p || vif->type != NL80211_IFTYPE_AP || in iwl_mvm_mac_get_ftm_responder_stats()
6106 !mvmvif->ap_ibss_active || !vif->bss_conf.ftm_responder) in iwl_mvm_mac_get_ftm_responder_stats()
6107 return -EINVAL; in iwl_mvm_mac_get_ftm_responder_stats()
6109 mutex_lock(&mvm->mutex); in iwl_mvm_mac_get_ftm_responder_stats()
6110 *stats = mvm->ftm_resp_stats; in iwl_mvm_mac_get_ftm_responder_stats()
6111 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_get_ftm_responder_stats()
6113 stats->filled = BIT(NL80211_FTM_STATS_SUCCESS_NUM) | in iwl_mvm_mac_get_ftm_responder_stats()
6132 mutex_lock(&mvm->mutex); in iwl_mvm_start_pmsr()
6134 mutex_unlock(&mvm->mutex); in iwl_mvm_start_pmsr()
6144 mutex_lock(&mvm->mutex); in iwl_mvm_abort_pmsr()
6146 mutex_unlock(&mvm->mutex); in iwl_mvm_abort_pmsr()
6151 u8 protocol = ip_hdr(skb)->protocol; in iwl_mvm_can_hw_csum()
6166 if (skb->protocol != htons(ETH_P_IP)) in iwl_mvm_mac_can_aggregate()
6184 if (!hwts->macaddr) in iwl_mvm_set_hw_timestamp()
6185 return -EOPNOTSUPP; in iwl_mvm_set_hw_timestamp()
6187 if (hwts->enable) in iwl_mvm_set_hw_timestamp()
6191 mutex_lock(&mvm->mutex); in iwl_mvm_set_hw_timestamp()
6192 ret = iwl_mvm_time_sync_config(mvm, hwts->macaddr, protocols); in iwl_mvm_set_hw_timestamp()
6193 mutex_unlock(&mvm->mutex); in iwl_mvm_set_hw_timestamp()