Lines Matching refs:mvm
213 void iwl_mvm_ref(struct iwl_mvm *mvm, enum iwl_mvm_ref_type ref_type) in iwl_mvm_ref() argument
215 if (!iwl_mvm_is_d0i3_supported(mvm)) in iwl_mvm_ref()
218 IWL_DEBUG_RPM(mvm, "Take mvm reference - type %d\n", ref_type); in iwl_mvm_ref()
219 spin_lock_bh(&mvm->refs_lock); in iwl_mvm_ref()
220 mvm->refs[ref_type]++; in iwl_mvm_ref()
221 spin_unlock_bh(&mvm->refs_lock); in iwl_mvm_ref()
222 iwl_trans_ref(mvm->trans); in iwl_mvm_ref()
225 void iwl_mvm_unref(struct iwl_mvm *mvm, enum iwl_mvm_ref_type ref_type) in iwl_mvm_unref() argument
227 if (!iwl_mvm_is_d0i3_supported(mvm)) in iwl_mvm_unref()
230 IWL_DEBUG_RPM(mvm, "Leave mvm reference - type %d\n", ref_type); in iwl_mvm_unref()
231 spin_lock_bh(&mvm->refs_lock); in iwl_mvm_unref()
232 WARN_ON(!mvm->refs[ref_type]--); in iwl_mvm_unref()
233 spin_unlock_bh(&mvm->refs_lock); in iwl_mvm_unref()
234 iwl_trans_unref(mvm->trans); in iwl_mvm_unref()
237 static void iwl_mvm_unref_all_except(struct iwl_mvm *mvm, in iwl_mvm_unref_all_except() argument
242 if (!iwl_mvm_is_d0i3_supported(mvm)) in iwl_mvm_unref_all_except()
245 spin_lock_bh(&mvm->refs_lock); in iwl_mvm_unref_all_except()
247 if (except_ref == i || !mvm->refs[i]) in iwl_mvm_unref_all_except()
250 IWL_DEBUG_RPM(mvm, "Cleanup: remove mvm ref type %d (%d)\n", in iwl_mvm_unref_all_except()
251 i, mvm->refs[i]); in iwl_mvm_unref_all_except()
252 for (j = 0; j < mvm->refs[i]; j++) in iwl_mvm_unref_all_except()
253 iwl_trans_unref(mvm->trans); in iwl_mvm_unref_all_except()
254 mvm->refs[i] = 0; in iwl_mvm_unref_all_except()
256 spin_unlock_bh(&mvm->refs_lock); in iwl_mvm_unref_all_except()
259 bool iwl_mvm_ref_taken(struct iwl_mvm *mvm) in iwl_mvm_ref_taken() argument
264 if (!iwl_mvm_is_d0i3_supported(mvm)) in iwl_mvm_ref_taken()
267 spin_lock_bh(&mvm->refs_lock); in iwl_mvm_ref_taken()
269 if (mvm->refs[i]) { in iwl_mvm_ref_taken()
274 spin_unlock_bh(&mvm->refs_lock); in iwl_mvm_ref_taken()
279 int iwl_mvm_ref_sync(struct iwl_mvm *mvm, enum iwl_mvm_ref_type ref_type) in iwl_mvm_ref_sync() argument
281 iwl_mvm_ref(mvm, ref_type); in iwl_mvm_ref_sync()
283 if (!wait_event_timeout(mvm->d0i3_exit_waitq, in iwl_mvm_ref_sync()
284 !test_bit(IWL_MVM_STATUS_IN_D0I3, &mvm->status), in iwl_mvm_ref_sync()
287 iwl_mvm_unref(mvm, ref_type); in iwl_mvm_ref_sync()
294 static void iwl_mvm_reset_phy_ctxts(struct iwl_mvm *mvm) in iwl_mvm_reset_phy_ctxts() argument
298 memset(mvm->phy_ctxts, 0, sizeof(mvm->phy_ctxts)); in iwl_mvm_reset_phy_ctxts()
300 mvm->phy_ctxts[i].id = i; in iwl_mvm_reset_phy_ctxts()
301 mvm->phy_ctxts[i].ref = 0; in iwl_mvm_reset_phy_ctxts()
312 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_get_regdomain() local
315 IWL_DEBUG_LAR(mvm, "Getting regdomain data for %s from FW\n", alpha2); in iwl_mvm_get_regdomain()
317 lockdep_assert_held(&mvm->mutex); in iwl_mvm_get_regdomain()
319 resp = iwl_mvm_update_mcc(mvm, alpha2, src_id); in iwl_mvm_get_regdomain()
321 IWL_DEBUG_LAR(mvm, "Could not get update from FW %d\n", in iwl_mvm_get_regdomain()
329 regd = iwl_parse_nvm_mcc_info(mvm->trans->dev, mvm->cfg, in iwl_mvm_get_regdomain()
337 IWL_DEBUG_LAR(mvm, "Could not get parse update from FW %d\n", in iwl_mvm_get_regdomain()
342 IWL_DEBUG_LAR(mvm, "setting alpha2 from FW to %s (0x%x, 0x%x) src=%d\n", in iwl_mvm_get_regdomain()
344 mvm->lar_regdom_set = true; in iwl_mvm_get_regdomain()
345 mvm->mcc_src = src_id; in iwl_mvm_get_regdomain()
351 void iwl_mvm_update_changed_regdom(struct iwl_mvm *mvm) in iwl_mvm_update_changed_regdom() argument
356 if (!iwl_mvm_is_lar_supported(mvm)) in iwl_mvm_update_changed_regdom()
359 regd = iwl_mvm_get_current_regdomain(mvm, &changed); in iwl_mvm_update_changed_regdom()
363 regulatory_set_wiphy_regd(mvm->hw->wiphy, regd); in iwl_mvm_update_changed_regdom()
369 struct ieee80211_regdomain *iwl_mvm_get_current_regdomain(struct iwl_mvm *mvm, in iwl_mvm_get_current_regdomain() argument
372 return iwl_mvm_get_regdomain(mvm->hw->wiphy, "ZZ", in iwl_mvm_get_current_regdomain()
373 iwl_mvm_is_wifi_mcc_supported(mvm) ? in iwl_mvm_get_current_regdomain()
378 int iwl_mvm_init_fw_regd(struct iwl_mvm *mvm) in iwl_mvm_init_fw_regd() argument
385 rtnl_dereference(mvm->hw->wiphy->regd); in iwl_mvm_init_fw_regd()
391 used_src = mvm->mcc_src; in iwl_mvm_init_fw_regd()
392 if (iwl_mvm_is_wifi_mcc_supported(mvm)) { in iwl_mvm_init_fw_regd()
394 regd = iwl_mvm_get_current_regdomain(mvm, NULL); in iwl_mvm_init_fw_regd()
400 regd = iwl_mvm_get_regdomain(mvm->hw->wiphy, r->alpha2, used_src, in iwl_mvm_init_fw_regd()
407 ret = regulatory_set_wiphy_regd_sync_rtnl(mvm->hw->wiphy, regd); in iwl_mvm_init_fw_regd()
415 int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) in iwl_mvm_mac_setup_register() argument
417 struct ieee80211_hw *hw = mvm->hw; in iwl_mvm_mac_setup_register()
434 hw->queues = mvm->first_agg_queue; in iwl_mvm_mac_setup_register()
449 if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_MFP && in iwl_mvm_mac_setup_register()
471 if (iwl_mvm_is_lar_supported(mvm)) in iwl_mvm_mac_setup_register()
477 if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_GO_UAPSD) in iwl_mvm_mac_setup_register()
492 memcpy(mvm->addresses[0].addr, mvm->nvm_data->hw_addr, ETH_ALEN); in iwl_mvm_mac_setup_register()
493 hw->wiphy->addresses = mvm->addresses; in iwl_mvm_mac_setup_register()
497 num_mac = (mvm->nvm_data->n_hw_addrs > 1) ? in iwl_mvm_mac_setup_register()
498 min(IWL_MVM_MAX_ADDRESSES, mvm->nvm_data->n_hw_addrs) : 1; in iwl_mvm_mac_setup_register()
501 memcpy(mvm->addresses[i].addr, mvm->addresses[i-1].addr, in iwl_mvm_mac_setup_register()
503 mvm->addresses[i].addr[5]++; in iwl_mvm_mac_setup_register()
507 iwl_mvm_reset_phy_ctxts(mvm); in iwl_mvm_mac_setup_register()
509 hw->wiphy->max_scan_ie_len = iwl_mvm_max_scan_ie_len(mvm, false); in iwl_mvm_mac_setup_register()
513 if (mvm->nvm_data->bands[IEEE80211_BAND_2GHZ].n_channels) in iwl_mvm_mac_setup_register()
515 &mvm->nvm_data->bands[IEEE80211_BAND_2GHZ]; in iwl_mvm_mac_setup_register()
516 if (mvm->nvm_data->bands[IEEE80211_BAND_5GHZ].n_channels) { in iwl_mvm_mac_setup_register()
518 &mvm->nvm_data->bands[IEEE80211_BAND_5GHZ]; in iwl_mvm_mac_setup_register()
520 if ((mvm->fw->ucode_capa.capa[0] & in iwl_mvm_mac_setup_register()
522 (mvm->fw->ucode_capa.api[0] & in iwl_mvm_mac_setup_register()
528 hw->wiphy->hw_version = mvm->trans->hw_id; in iwl_mvm_mac_setup_register()
535 if (IWL_UCODE_API(mvm->fw->ucode_ver) >= 10) { in iwl_mvm_mac_setup_register()
551 if (mvm->fw->ucode_capa.capa[0] & in iwl_mvm_mac_setup_register()
554 if (mvm->fw->ucode_capa.capa[0] & in iwl_mvm_mac_setup_register()
558 if (mvm->fw->ucode_capa.capa[0] & in iwl_mvm_mac_setup_register()
563 if (mvm->fw->ucode_capa.capa[0] & in iwl_mvm_mac_setup_register()
567 mvm->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD; in iwl_mvm_mac_setup_register()
570 if (mvm->fw->cs[0].cipher) { in iwl_mvm_mac_setup_register()
571 mvm->hw->n_cipher_schemes = 1; in iwl_mvm_mac_setup_register()
572 mvm->hw->cipher_schemes = &mvm->fw->cs[0]; in iwl_mvm_mac_setup_register()
576 if (iwl_mvm_is_d0i3_supported(mvm) && in iwl_mvm_mac_setup_register()
577 device_can_wakeup(mvm->trans->dev)) { in iwl_mvm_mac_setup_register()
578 mvm->wowlan.flags = WIPHY_WOWLAN_ANY; in iwl_mvm_mac_setup_register()
579 hw->wiphy->wowlan = &mvm->wowlan; in iwl_mvm_mac_setup_register()
582 if (mvm->fw->img[IWL_UCODE_WOWLAN].sec[0].len && in iwl_mvm_mac_setup_register()
583 mvm->trans->ops->d3_suspend && in iwl_mvm_mac_setup_register()
584 mvm->trans->ops->d3_resume && in iwl_mvm_mac_setup_register()
585 device_can_wakeup(mvm->trans->dev)) { in iwl_mvm_mac_setup_register()
586 mvm->wowlan.flags |= WIPHY_WOWLAN_MAGIC_PKT | in iwl_mvm_mac_setup_register()
592 mvm->wowlan.flags |= WIPHY_WOWLAN_SUPPORTS_GTK_REKEY | in iwl_mvm_mac_setup_register()
596 mvm->wowlan.n_patterns = IWL_WOWLAN_MAX_PATTERNS; in iwl_mvm_mac_setup_register()
597 mvm->wowlan.pattern_min_len = IWL_WOWLAN_MIN_PATTERN_LEN; in iwl_mvm_mac_setup_register()
598 mvm->wowlan.pattern_max_len = IWL_WOWLAN_MAX_PATTERN_LEN; in iwl_mvm_mac_setup_register()
599 mvm->wowlan.max_nd_match_sets = IWL_SCAN_MAX_PROFILES; in iwl_mvm_mac_setup_register()
600 mvm->wowlan.tcp = &iwl_mvm_wowlan_tcp_support; in iwl_mvm_mac_setup_register()
601 hw->wiphy->wowlan = &mvm->wowlan; in iwl_mvm_mac_setup_register()
607 mvm->bcast_filters = iwl_mvm_default_bcast_filters; in iwl_mvm_mac_setup_register()
610 ret = iwl_mvm_leds_init(mvm); in iwl_mvm_mac_setup_register()
614 if (mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_TDLS_SUPPORT) { in iwl_mvm_mac_setup_register()
615 IWL_DEBUG_TDLS(mvm, "TDLS supported\n"); in iwl_mvm_mac_setup_register()
619 if (mvm->fw->ucode_capa.capa[0] & in iwl_mvm_mac_setup_register()
621 IWL_DEBUG_TDLS(mvm, "TDLS channel switch supported\n"); in iwl_mvm_mac_setup_register()
625 ret = ieee80211_register_hw(mvm->hw); in iwl_mvm_mac_setup_register()
627 iwl_mvm_leds_exit(mvm); in iwl_mvm_mac_setup_register()
632 static bool iwl_mvm_defer_tx(struct iwl_mvm *mvm, in iwl_mvm_defer_tx() argument
644 if (likely(!test_bit(IWL_MVM_STATUS_IN_D0I3, &mvm->status))) in iwl_mvm_defer_tx()
647 spin_lock(&mvm->d0i3_tx_lock); in iwl_mvm_defer_tx()
652 if (!test_bit(IWL_MVM_STATUS_IN_D0I3, &mvm->status)) in iwl_mvm_defer_tx()
657 mvmsta->sta_id != mvm->d0i3_ap_sta_id) in iwl_mvm_defer_tx()
660 __skb_queue_tail(&mvm->d0i3_tx, skb); in iwl_mvm_defer_tx()
661 ieee80211_stop_queues(mvm->hw); in iwl_mvm_defer_tx()
664 iwl_mvm_ref(mvm, IWL_MVM_REF_TX); in iwl_mvm_defer_tx()
665 iwl_mvm_unref(mvm, IWL_MVM_REF_TX); in iwl_mvm_defer_tx()
669 spin_unlock(&mvm->d0i3_tx_lock); in iwl_mvm_defer_tx()
677 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_tx() local
682 if (iwl_mvm_is_radio_killed(mvm)) { in iwl_mvm_mac_tx()
683 IWL_DEBUG_DROP(mvm, "Dropping - RF/CT KILL\n"); in iwl_mvm_mac_tx()
688 !test_bit(IWL_MVM_STATUS_ROC_RUNNING, &mvm->status) && in iwl_mvm_mac_tx()
689 !test_bit(IWL_MVM_STATUS_ROC_AUX_RUNNING, &mvm->status)) in iwl_mvm_mac_tx()
701 if (iwl_mvm_defer_tx(mvm, sta, skb)) in iwl_mvm_mac_tx()
703 if (iwl_mvm_tx_skb(mvm, skb, sta)) in iwl_mvm_mac_tx()
708 if (iwl_mvm_tx_skb_non_sta(mvm, skb)) in iwl_mvm_mac_tx()
739 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_ampdu_action() local
743 IWL_DEBUG_HT(mvm, "A-MPDU action on addr %pM tid %d: action %d\n", in iwl_mvm_mac_ampdu_action()
746 if (!(mvm->nvm_data->sku_cap_11n_enable)) in iwl_mvm_mac_ampdu_action()
764 ret = iwl_mvm_ref_sync(mvm, IWL_MVM_REF_TX_AGG); in iwl_mvm_mac_ampdu_action()
774 mutex_lock(&mvm->mutex); in iwl_mvm_mac_ampdu_action()
778 if (!iwl_enable_rx_ampdu(mvm->cfg)) { in iwl_mvm_mac_ampdu_action()
782 ret = iwl_mvm_sta_rx_agg(mvm, sta, tid, *ssn, true); in iwl_mvm_mac_ampdu_action()
785 ret = iwl_mvm_sta_rx_agg(mvm, sta, tid, 0, false); in iwl_mvm_mac_ampdu_action()
788 if (!iwl_enable_tx_ampdu(mvm->cfg)) { in iwl_mvm_mac_ampdu_action()
792 ret = iwl_mvm_sta_tx_agg_start(mvm, vif, sta, tid, ssn); in iwl_mvm_mac_ampdu_action()
795 ret = iwl_mvm_sta_tx_agg_stop(mvm, vif, sta, tid); in iwl_mvm_mac_ampdu_action()
799 ret = iwl_mvm_sta_tx_agg_flush(mvm, vif, sta, tid); in iwl_mvm_mac_ampdu_action()
802 ret = iwl_mvm_sta_tx_agg_oper(mvm, vif, sta, tid, buf_size); in iwl_mvm_mac_ampdu_action()
809 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_ampdu_action()
816 iwl_mvm_unref(mvm, IWL_MVM_REF_TX_AGG); in iwl_mvm_mac_ampdu_action()
824 struct iwl_mvm *mvm = data; in iwl_mvm_cleanup_iterator() local
830 spin_lock_bh(&mvm->time_event_lock); in iwl_mvm_cleanup_iterator()
831 iwl_mvm_te_clear_data(mvm, &mvmvif->time_event_data); in iwl_mvm_cleanup_iterator()
832 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_cleanup_iterator()
881 static void iwl_mvm_dump_fifos(struct iwl_mvm *mvm, in iwl_mvm_dump_fifos() argument
890 if (!iwl_trans_grab_nic_access(mvm->trans, false, &flags)) in iwl_mvm_dump_fifos()
894 for (i = 0; i < ARRAY_SIZE(mvm->shared_mem_cfg.rxfifo_size); i++) { in iwl_mvm_dump_fifos()
903 fifo_len = mvm->shared_mem_cfg.rxfifo_size[i]; in iwl_mvm_dump_fifos()
915 cpu_to_le32(iwl_trans_read_prph(mvm->trans, in iwl_mvm_dump_fifos()
919 cpu_to_le32(iwl_trans_read_prph(mvm->trans, in iwl_mvm_dump_fifos()
923 cpu_to_le32(iwl_trans_read_prph(mvm->trans, in iwl_mvm_dump_fifos()
927 cpu_to_le32(iwl_trans_read_prph(mvm->trans, in iwl_mvm_dump_fifos()
931 cpu_to_le32(iwl_trans_read_prph(mvm->trans, in iwl_mvm_dump_fifos()
936 iwl_trans_write_prph(mvm->trans, in iwl_mvm_dump_fifos()
939 iwl_trans_write_prph(mvm->trans, in iwl_mvm_dump_fifos()
942 iwl_trans_write_prph(mvm->trans, in iwl_mvm_dump_fifos()
949 fifo_data[j] = iwl_trans_read_prph(mvm->trans, in iwl_mvm_dump_fifos()
956 for (i = 0; i < ARRAY_SIZE(mvm->shared_mem_cfg.txfifo_size); i++) { in iwl_mvm_dump_fifos()
958 iwl_trans_write_prph(mvm->trans, TXF_LARC_NUM, i); in iwl_mvm_dump_fifos()
962 fifo_len = mvm->shared_mem_cfg.txfifo_size[i]; in iwl_mvm_dump_fifos()
974 cpu_to_le32(iwl_trans_read_prph(mvm->trans, in iwl_mvm_dump_fifos()
977 cpu_to_le32(iwl_trans_read_prph(mvm->trans, in iwl_mvm_dump_fifos()
980 cpu_to_le32(iwl_trans_read_prph(mvm->trans, in iwl_mvm_dump_fifos()
983 cpu_to_le32(iwl_trans_read_prph(mvm->trans, in iwl_mvm_dump_fifos()
986 cpu_to_le32(iwl_trans_read_prph(mvm->trans, in iwl_mvm_dump_fifos()
990 iwl_trans_write_prph(mvm->trans, TXF_READ_MODIFY_ADDR, in iwl_mvm_dump_fifos()
994 iwl_trans_read_prph(mvm->trans, TXF_READ_MODIFY_DATA); in iwl_mvm_dump_fifos()
999 fifo_data[j] = iwl_trans_read_prph(mvm->trans, in iwl_mvm_dump_fifos()
1004 iwl_trans_release_nic_access(mvm->trans, &flags); in iwl_mvm_dump_fifos()
1007 void iwl_mvm_free_fw_dump_desc(struct iwl_mvm *mvm) in iwl_mvm_free_fw_dump_desc() argument
1009 if (mvm->fw_dump_desc == &iwl_mvm_dump_desc_assert || in iwl_mvm_free_fw_dump_desc()
1010 !mvm->fw_dump_desc) in iwl_mvm_free_fw_dump_desc()
1013 kfree(mvm->fw_dump_desc); in iwl_mvm_free_fw_dump_desc()
1014 mvm->fw_dump_desc = NULL; in iwl_mvm_free_fw_dump_desc()
1020 void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm) in iwl_mvm_fw_error_dump() argument
1030 u32 smem_len = mvm->cfg->smem_len; in iwl_mvm_fw_error_dump()
1031 u32 sram2_len = mvm->cfg->dccm2_len; in iwl_mvm_fw_error_dump()
1033 lockdep_assert_held(&mvm->mutex); in iwl_mvm_fw_error_dump()
1040 if (!mvm->cfg->dccm_offset || !mvm->cfg->dccm_len) { in iwl_mvm_fw_error_dump()
1043 img = &mvm->fw->img[mvm->cur_ucode]; in iwl_mvm_fw_error_dump()
1047 sram_ofs = mvm->cfg->dccm_offset; in iwl_mvm_fw_error_dump()
1048 sram_len = mvm->cfg->dccm_len; in iwl_mvm_fw_error_dump()
1052 if (test_bit(STATUS_FW_ERROR, &mvm->trans->status)) { in iwl_mvm_fw_error_dump()
1053 struct iwl_mvm_shared_mem_cfg *mem_cfg = &mvm->shared_mem_cfg; in iwl_mvm_fw_error_dump()
1089 if (mvm->cfg->device_family == IWL_DEVICE_FAMILY_8000 && in iwl_mvm_fw_error_dump()
1090 CSR_HW_REV_STEP(mvm->trans->hw_rev) == SILICON_B_STEP) in iwl_mvm_fw_error_dump()
1094 if (mvm->fw_dump_desc) in iwl_mvm_fw_error_dump()
1096 mvm->fw_dump_desc->len; in iwl_mvm_fw_error_dump()
1109 iwl_mvm_free_fw_dump_desc(mvm); in iwl_mvm_fw_error_dump()
1122 mvm->cfg->device_family == IWL_DEVICE_FAMILY_7000 ? in iwl_mvm_fw_error_dump()
1125 dump_info->hw_step = cpu_to_le32(CSR_HW_REV_STEP(mvm->trans->hw_rev)); in iwl_mvm_fw_error_dump()
1126 memcpy(dump_info->fw_human_readable, mvm->fw->human_readable, in iwl_mvm_fw_error_dump()
1128 strncpy(dump_info->dev_human_readable, mvm->cfg->name, in iwl_mvm_fw_error_dump()
1130 strncpy(dump_info->bus_human_readable, mvm->dev->bus->name, in iwl_mvm_fw_error_dump()
1135 if (test_bit(STATUS_FW_ERROR, &mvm->trans->status)) in iwl_mvm_fw_error_dump()
1136 iwl_mvm_dump_fifos(mvm, &dump_data); in iwl_mvm_fw_error_dump()
1138 if (mvm->fw_dump_desc) { in iwl_mvm_fw_error_dump()
1141 mvm->fw_dump_desc->len); in iwl_mvm_fw_error_dump()
1143 memcpy(dump_trig, &mvm->fw_dump_desc->trig_desc, in iwl_mvm_fw_error_dump()
1144 sizeof(*dump_trig) + mvm->fw_dump_desc->len); in iwl_mvm_fw_error_dump()
1147 iwl_mvm_free_fw_dump_desc(mvm); in iwl_mvm_fw_error_dump()
1156 iwl_trans_read_mem_bytes(mvm->trans, sram_ofs, dump_mem->data, in iwl_mvm_fw_error_dump()
1165 dump_mem->offset = cpu_to_le32(mvm->cfg->smem_offset); in iwl_mvm_fw_error_dump()
1166 iwl_trans_read_mem_bytes(mvm->trans, mvm->cfg->smem_offset, in iwl_mvm_fw_error_dump()
1176 dump_mem->offset = cpu_to_le32(mvm->cfg->dccm2_offset); in iwl_mvm_fw_error_dump()
1177 iwl_trans_read_mem_bytes(mvm->trans, mvm->cfg->dccm2_offset, in iwl_mvm_fw_error_dump()
1181 if (mvm->cfg->device_family == IWL_DEVICE_FAMILY_8000 && in iwl_mvm_fw_error_dump()
1182 CSR_HW_REV_STEP(mvm->trans->hw_rev) == SILICON_B_STEP) { in iwl_mvm_fw_error_dump()
1190 iwl_trans_read_mem_bytes(mvm->trans, IWL8260_ICCM_OFFSET, in iwl_mvm_fw_error_dump()
1194 fw_error_dump->trans_ptr = iwl_trans_dump_data(mvm->trans); in iwl_mvm_fw_error_dump()
1200 dev_coredumpm(mvm->trans->dev, THIS_MODULE, fw_error_dump, 0, in iwl_mvm_fw_error_dump()
1203 clear_bit(IWL_MVM_STATUS_DUMPING_FW_LOG, &mvm->status); in iwl_mvm_fw_error_dump()
1212 static void iwl_mvm_restart_cleanup(struct iwl_mvm *mvm) in iwl_mvm_restart_cleanup() argument
1218 if (!test_and_clear_bit(IWL_MVM_STATUS_D3_RECONFIG, &mvm->status)) { in iwl_mvm_restart_cleanup()
1219 mvm->fw_dump_desc = &iwl_mvm_dump_desc_assert; in iwl_mvm_restart_cleanup()
1220 iwl_mvm_fw_error_dump(mvm); in iwl_mvm_restart_cleanup()
1226 iwl_mvm_unref_all_except(mvm, IWL_MVM_REF_UCODE_DOWN); in iwl_mvm_restart_cleanup()
1228 iwl_trans_stop_device(mvm->trans); in iwl_mvm_restart_cleanup()
1230 mvm->scan_status = IWL_MVM_SCAN_NONE; in iwl_mvm_restart_cleanup()
1231 mvm->ps_disabled = false; in iwl_mvm_restart_cleanup()
1232 mvm->calibrating = false; in iwl_mvm_restart_cleanup()
1235 ieee80211_remain_on_channel_expired(mvm->hw); in iwl_mvm_restart_cleanup()
1238 mvm->hw, IEEE80211_IFACE_ITER_RESUME_ALL, in iwl_mvm_restart_cleanup()
1239 iwl_mvm_cleanup_iterator, mvm); in iwl_mvm_restart_cleanup()
1241 mvm->p2p_device_vif = NULL; in iwl_mvm_restart_cleanup()
1242 mvm->d0i3_ap_sta_id = IWL_MVM_STATION_COUNT; in iwl_mvm_restart_cleanup()
1244 iwl_mvm_reset_phy_ctxts(mvm); in iwl_mvm_restart_cleanup()
1245 memset(mvm->fw_key_table, 0, sizeof(mvm->fw_key_table)); in iwl_mvm_restart_cleanup()
1246 memset(mvm->sta_drained, 0, sizeof(mvm->sta_drained)); in iwl_mvm_restart_cleanup()
1247 memset(mvm->tfd_drained, 0, sizeof(mvm->tfd_drained)); in iwl_mvm_restart_cleanup()
1248 memset(&mvm->last_bt_notif, 0, sizeof(mvm->last_bt_notif)); in iwl_mvm_restart_cleanup()
1249 memset(&mvm->last_bt_notif_old, 0, sizeof(mvm->last_bt_notif_old)); in iwl_mvm_restart_cleanup()
1250 memset(&mvm->last_bt_ci_cmd, 0, sizeof(mvm->last_bt_ci_cmd)); in iwl_mvm_restart_cleanup()
1251 memset(&mvm->last_bt_ci_cmd_old, 0, sizeof(mvm->last_bt_ci_cmd_old)); in iwl_mvm_restart_cleanup()
1252 memset(&mvm->bt_ack_kill_msk, 0, sizeof(mvm->bt_ack_kill_msk)); in iwl_mvm_restart_cleanup()
1253 memset(&mvm->bt_cts_kill_msk, 0, sizeof(mvm->bt_cts_kill_msk)); in iwl_mvm_restart_cleanup()
1255 ieee80211_wake_queues(mvm->hw); in iwl_mvm_restart_cleanup()
1258 clear_bit(IWL_MVM_STATUS_IN_D0I3, &mvm->status); in iwl_mvm_restart_cleanup()
1260 mvm->vif_count = 0; in iwl_mvm_restart_cleanup()
1261 mvm->rx_ba_sessions = 0; in iwl_mvm_restart_cleanup()
1262 mvm->fw_dbg_conf = FW_DBG_INVALID; in iwl_mvm_restart_cleanup()
1265 iwl_mvm_accu_radio_stats(mvm); in iwl_mvm_restart_cleanup()
1268 int __iwl_mvm_mac_start(struct iwl_mvm *mvm) in __iwl_mvm_mac_start() argument
1272 lockdep_assert_held(&mvm->mutex); in __iwl_mvm_mac_start()
1275 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) in __iwl_mvm_mac_start()
1276 iwl_mvm_restart_cleanup(mvm); in __iwl_mvm_mac_start()
1278 ret = iwl_mvm_up(mvm); in __iwl_mvm_mac_start()
1280 if (ret && test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { in __iwl_mvm_mac_start()
1285 clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status); in __iwl_mvm_mac_start()
1286 iwl_mvm_d0i3_enable_tx(mvm, NULL); in __iwl_mvm_mac_start()
1294 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_start() local
1298 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { in iwl_mvm_mac_start()
1304 wait_event_timeout(mvm->d0i3_exit_waitq, in iwl_mvm_mac_start()
1306 &mvm->status), in iwl_mvm_mac_start()
1310 mutex_lock(&mvm->mutex); in iwl_mvm_mac_start()
1311 ret = __iwl_mvm_mac_start(mvm); in iwl_mvm_mac_start()
1312 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_start()
1317 static void iwl_mvm_restart_complete(struct iwl_mvm *mvm) in iwl_mvm_restart_complete() argument
1321 mutex_lock(&mvm->mutex); in iwl_mvm_restart_complete()
1323 clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status); in iwl_mvm_restart_complete()
1324 iwl_mvm_d0i3_enable_tx(mvm, NULL); in iwl_mvm_restart_complete()
1325 ret = iwl_mvm_update_quotas(mvm, true, NULL); in iwl_mvm_restart_complete()
1327 IWL_ERR(mvm, "Failed to update quotas after restart (%d)\n", in iwl_mvm_restart_complete()
1331 iwl_mvm_unref(mvm, IWL_MVM_REF_UCODE_DOWN); in iwl_mvm_restart_complete()
1337 iwl_mvm_teardown_tdls_peers(mvm); in iwl_mvm_restart_complete()
1339 mutex_unlock(&mvm->mutex); in iwl_mvm_restart_complete()
1342 static void iwl_mvm_resume_complete(struct iwl_mvm *mvm) in iwl_mvm_resume_complete() argument
1346 if (!iwl_mvm_is_d0i3_supported(mvm)) in iwl_mvm_resume_complete()
1349 mutex_lock(&mvm->d0i3_suspend_mutex); in iwl_mvm_resume_complete()
1350 __clear_bit(D0I3_DEFER_WAKEUP, &mvm->d0i3_suspend_flags); in iwl_mvm_resume_complete()
1352 &mvm->d0i3_suspend_flags); in iwl_mvm_resume_complete()
1353 mutex_unlock(&mvm->d0i3_suspend_mutex); in iwl_mvm_resume_complete()
1356 IWL_DEBUG_RPM(mvm, "Run deferred d0i3 exit\n"); in iwl_mvm_resume_complete()
1357 _iwl_mvm_exit_d0i3(mvm); in iwl_mvm_resume_complete()
1360 if (mvm->trans->d0i3_mode == IWL_D0I3_MODE_ON_SUSPEND) in iwl_mvm_resume_complete()
1361 if (!wait_event_timeout(mvm->d0i3_exit_waitq, in iwl_mvm_resume_complete()
1363 &mvm->status), in iwl_mvm_resume_complete()
1372 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_reconfig_complete() local
1376 iwl_mvm_restart_complete(mvm); in iwl_mvm_mac_reconfig_complete()
1379 iwl_mvm_resume_complete(mvm); in iwl_mvm_mac_reconfig_complete()
1384 void __iwl_mvm_mac_stop(struct iwl_mvm *mvm) in __iwl_mvm_mac_stop() argument
1386 lockdep_assert_held(&mvm->mutex); in __iwl_mvm_mac_stop()
1391 memset(&mvm->accu_radio_stats, 0, sizeof(mvm->accu_radio_stats)); in __iwl_mvm_mac_stop()
1398 if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) in __iwl_mvm_mac_stop()
1399 iwl_mvm_ref(mvm, IWL_MVM_REF_UCODE_DOWN); in __iwl_mvm_mac_stop()
1407 flush_work(&mvm->roc_done_wk); in __iwl_mvm_mac_stop()
1409 iwl_trans_stop_device(mvm->trans); in __iwl_mvm_mac_stop()
1411 iwl_mvm_async_handlers_purge(mvm); in __iwl_mvm_mac_stop()
1415 iwl_mvm_del_aux_sta(mvm); in __iwl_mvm_mac_stop()
1421 clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status); in __iwl_mvm_mac_stop()
1426 if (mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN) { in __iwl_mvm_mac_stop()
1430 if (WARN_ONCE(mvm->scan_uid[i], in __iwl_mvm_mac_stop()
1432 mvm->scan_uid[i])) in __iwl_mvm_mac_stop()
1433 mvm->scan_uid[i] = 0; in __iwl_mvm_mac_stop()
1437 mvm->ucode_loaded = false; in __iwl_mvm_mac_stop()
1442 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_stop() local
1444 flush_work(&mvm->d0i3_exit_work); in iwl_mvm_mac_stop()
1445 flush_work(&mvm->async_handlers_wk); in iwl_mvm_mac_stop()
1446 cancel_delayed_work_sync(&mvm->fw_dump_wk); in iwl_mvm_mac_stop()
1447 iwl_mvm_free_fw_dump_desc(mvm); in iwl_mvm_mac_stop()
1449 mutex_lock(&mvm->mutex); in iwl_mvm_mac_stop()
1450 __iwl_mvm_mac_stop(mvm); in iwl_mvm_mac_stop()
1451 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_stop()
1457 cancel_work_sync(&mvm->async_handlers_wk); in iwl_mvm_mac_stop()
1460 static struct iwl_mvm_phy_ctxt *iwl_mvm_get_free_phy_ctxt(struct iwl_mvm *mvm) in iwl_mvm_get_free_phy_ctxt() argument
1464 lockdep_assert_held(&mvm->mutex); in iwl_mvm_get_free_phy_ctxt()
1467 if (!mvm->phy_ctxts[i].ref) in iwl_mvm_get_free_phy_ctxt()
1468 return &mvm->phy_ctxts[i]; in iwl_mvm_get_free_phy_ctxt()
1470 IWL_ERR(mvm, "No available PHY context\n"); in iwl_mvm_get_free_phy_ctxt()
1474 static int iwl_mvm_set_tx_power_old(struct iwl_mvm *mvm, in iwl_mvm_set_tx_power_old() argument
1483 return iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0, in iwl_mvm_set_tx_power_old()
1488 static int iwl_mvm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_set_tx_power() argument
1498 if (!(mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_TX_POWER_DEV)) in iwl_mvm_set_tx_power()
1499 return iwl_mvm_set_tx_power_old(mvm, vif, tx_power); in iwl_mvm_set_tx_power()
1504 return iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0, in iwl_mvm_set_tx_power()
1511 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_add_interface() local
1515 mvmvif->mvm = mvm; in iwl_mvm_mac_add_interface()
1522 ret = iwl_mvm_ref_sync(mvm, IWL_MVM_REF_ADD_IF); in iwl_mvm_mac_add_interface()
1532 mutex_lock(&mvm->mutex); in iwl_mvm_mac_add_interface()
1535 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) in iwl_mvm_mac_add_interface()
1540 ret = iwl_mvm_mac_ctxt_init(mvm, vif); in iwl_mvm_mac_add_interface()
1546 mvm->vif_count++; in iwl_mvm_mac_add_interface()
1561 ret = iwl_mvm_alloc_bcast_sta(mvm, vif); in iwl_mvm_mac_add_interface()
1563 IWL_ERR(mvm, "Failed to allocate bcast sta\n"); in iwl_mvm_mac_add_interface()
1567 iwl_mvm_vif_dbgfs_register(mvm, vif); in iwl_mvm_mac_add_interface()
1571 ret = iwl_mvm_mac_ctxt_add(mvm, vif); in iwl_mvm_mac_add_interface()
1575 ret = iwl_mvm_power_update_mac(mvm); in iwl_mvm_mac_add_interface()
1580 ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0); in iwl_mvm_mac_add_interface()
1584 if (!mvm->bf_allowed_vif && in iwl_mvm_mac_add_interface()
1586 mvm->bf_allowed_vif = mvmvif; in iwl_mvm_mac_add_interface()
1598 mvmvif->phy_ctxt = iwl_mvm_get_free_phy_ctxt(mvm); in iwl_mvm_mac_add_interface()
1604 iwl_mvm_phy_ctxt_ref(mvm, mvmvif->phy_ctxt); in iwl_mvm_mac_add_interface()
1605 ret = iwl_mvm_binding_add_vif(mvm, vif); in iwl_mvm_mac_add_interface()
1609 ret = iwl_mvm_add_bcast_sta(mvm, vif); in iwl_mvm_mac_add_interface()
1615 mvm->p2p_device_vif = vif; in iwl_mvm_mac_add_interface()
1618 iwl_mvm_vif_dbgfs_register(mvm, vif); in iwl_mvm_mac_add_interface()
1622 iwl_mvm_binding_remove_vif(mvm, vif); in iwl_mvm_mac_add_interface()
1624 iwl_mvm_phy_ctxt_unref(mvm, mvmvif->phy_ctxt); in iwl_mvm_mac_add_interface()
1626 if (mvm->bf_allowed_vif == mvmvif) { in iwl_mvm_mac_add_interface()
1627 mvm->bf_allowed_vif = NULL; in iwl_mvm_mac_add_interface()
1633 iwl_mvm_mac_ctxt_remove(mvm, vif); in iwl_mvm_mac_add_interface()
1636 mvm->vif_count--; in iwl_mvm_mac_add_interface()
1638 iwl_mvm_mac_ctxt_release(mvm, vif); in iwl_mvm_mac_add_interface()
1640 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_add_interface()
1642 iwl_mvm_unref(mvm, IWL_MVM_REF_ADD_IF); in iwl_mvm_mac_add_interface()
1647 static void iwl_mvm_prepare_mac_removal(struct iwl_mvm *mvm, in iwl_mvm_prepare_mac_removal() argument
1662 mutex_lock(&mvm->mutex); in iwl_mvm_prepare_mac_removal()
1663 iwl_mvm_flush_tx_path(mvm, tfd_msk, true); in iwl_mvm_prepare_mac_removal()
1664 mutex_unlock(&mvm->mutex); in iwl_mvm_prepare_mac_removal()
1679 iwl_trans_wait_tx_queue_empty(mvm->trans, tfd_msk); in iwl_mvm_prepare_mac_removal()
1688 flush_work(&mvm->roc_done_wk); in iwl_mvm_prepare_mac_removal()
1696 flush_work(&mvm->sta_drained_wk); in iwl_mvm_prepare_mac_removal()
1703 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_remove_interface() local
1706 iwl_mvm_prepare_mac_removal(mvm, vif); in iwl_mvm_mac_remove_interface()
1708 mutex_lock(&mvm->mutex); in iwl_mvm_mac_remove_interface()
1710 if (mvm->bf_allowed_vif == mvmvif) { in iwl_mvm_mac_remove_interface()
1711 mvm->bf_allowed_vif = NULL; in iwl_mvm_mac_remove_interface()
1716 iwl_mvm_vif_dbgfs_clean(mvm, vif); in iwl_mvm_mac_remove_interface()
1725 if (vif == mvm->noa_vif) { in iwl_mvm_mac_remove_interface()
1726 mvm->noa_vif = NULL; in iwl_mvm_mac_remove_interface()
1727 mvm->noa_duration = 0; in iwl_mvm_mac_remove_interface()
1730 iwl_mvm_dealloc_bcast_sta(mvm, vif); in iwl_mvm_mac_remove_interface()
1735 mvm->p2p_device_vif = NULL; in iwl_mvm_mac_remove_interface()
1736 iwl_mvm_rm_bcast_sta(mvm, vif); in iwl_mvm_mac_remove_interface()
1737 iwl_mvm_binding_remove_vif(mvm, vif); in iwl_mvm_mac_remove_interface()
1738 iwl_mvm_phy_ctxt_unref(mvm, mvmvif->phy_ctxt); in iwl_mvm_mac_remove_interface()
1742 if (mvm->vif_count && vif->type != NL80211_IFTYPE_P2P_DEVICE) in iwl_mvm_mac_remove_interface()
1743 mvm->vif_count--; in iwl_mvm_mac_remove_interface()
1745 iwl_mvm_power_update_mac(mvm); in iwl_mvm_mac_remove_interface()
1746 iwl_mvm_mac_ctxt_remove(mvm, vif); in iwl_mvm_mac_remove_interface()
1749 iwl_mvm_mac_ctxt_release(mvm, vif); in iwl_mvm_mac_remove_interface()
1750 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_remove_interface()
1759 struct iwl_mvm *mvm; member
1767 struct iwl_mvm *mvm = data->mvm; in iwl_mvm_mc_iface_iterator() local
1768 struct iwl_mcast_filter_cmd *cmd = mvm->mcast_filter_cmd; in iwl_mvm_mc_iface_iterator()
1783 ret = iwl_mvm_send_cmd_pdu(mvm, MCAST_FILTER_CMD, CMD_ASYNC, len, cmd); in iwl_mvm_mc_iface_iterator()
1785 IWL_ERR(mvm, "mcast filter cmd error. ret=%d\n", ret); in iwl_mvm_mc_iface_iterator()
1788 static void iwl_mvm_recalc_multicast(struct iwl_mvm *mvm) in iwl_mvm_recalc_multicast() argument
1791 .mvm = mvm, in iwl_mvm_recalc_multicast()
1794 lockdep_assert_held(&mvm->mutex); in iwl_mvm_recalc_multicast()
1796 if (WARN_ON_ONCE(!mvm->mcast_filter_cmd)) in iwl_mvm_recalc_multicast()
1800 mvm->hw, IEEE80211_IFACE_ITER_NORMAL, in iwl_mvm_recalc_multicast()
1807 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_prepare_multicast() local
1831 IWL_DEBUG_MAC80211(mvm, "mcast addr (%d): %pM\n", in iwl_mvm_prepare_multicast()
1846 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_configure_filter() local
1849 mutex_lock(&mvm->mutex); in iwl_mvm_configure_filter()
1852 kfree(mvm->mcast_filter_cmd); in iwl_mvm_configure_filter()
1853 mvm->mcast_filter_cmd = cmd; in iwl_mvm_configure_filter()
1858 iwl_mvm_recalc_multicast(mvm); in iwl_mvm_configure_filter()
1860 mutex_unlock(&mvm->mutex); in iwl_mvm_configure_filter()
1866 struct iwl_mvm *mvm; member
1911 struct iwl_mvm *mvm = data->mvm; in iwl_mvm_bcast_filter_iterator() local
1933 for (i = 0; mvm->bcast_filters[i].attrs[0].mask; i++) { in iwl_mvm_bcast_filter_iterator()
1947 &mvm->bcast_filters[i], in iwl_mvm_bcast_filter_iterator()
1962 bool iwl_mvm_bcast_filter_build_cmd(struct iwl_mvm *mvm, in iwl_mvm_bcast_filter_build_cmd() argument
1966 .mvm = mvm, in iwl_mvm_bcast_filter_build_cmd()
1979 if (mvm->dbgfs_bcast_filtering.override) { in iwl_mvm_bcast_filter_build_cmd()
1980 memcpy(cmd->filters, &mvm->dbgfs_bcast_filtering.cmd.filters, in iwl_mvm_bcast_filter_build_cmd()
1982 memcpy(cmd->macs, &mvm->dbgfs_bcast_filtering.cmd.macs, in iwl_mvm_bcast_filter_build_cmd()
1989 if (!mvm->bcast_filters) in iwl_mvm_bcast_filter_build_cmd()
1994 mvm->hw, IEEE80211_IFACE_ITER_NORMAL, in iwl_mvm_bcast_filter_build_cmd()
1999 static int iwl_mvm_configure_bcast_filter(struct iwl_mvm *mvm, in iwl_mvm_configure_bcast_filter() argument
2004 if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_BCAST_FILTERING)) in iwl_mvm_configure_bcast_filter()
2007 if (!iwl_mvm_bcast_filter_build_cmd(mvm, &cmd)) in iwl_mvm_configure_bcast_filter()
2010 return iwl_mvm_send_cmd_pdu(mvm, BCAST_FILTER_CMD, 0, in iwl_mvm_configure_bcast_filter()
2014 static inline int iwl_mvm_configure_bcast_filter(struct iwl_mvm *mvm, in iwl_mvm_configure_bcast_filter() argument
2021 static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm, in iwl_mvm_bss_info_changed_station() argument
2035 iwl_mvm_mac_ctxt_recalc_tsf_id(mvm, vif); in iwl_mvm_bss_info_changed_station()
2046 ret = iwl_mvm_mac_ctxt_changed(mvm, vif, false, mvmvif->bssid); in iwl_mvm_bss_info_changed_station()
2048 IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr); in iwl_mvm_bss_info_changed_station()
2057 iwl_mvm_request_statistics(mvm, true); in iwl_mvm_bss_info_changed_station()
2062 ret = iwl_mvm_update_quotas(mvm, true, NULL); in iwl_mvm_bss_info_changed_station()
2064 IWL_ERR(mvm, "failed to update quotas\n"); in iwl_mvm_bss_info_changed_station()
2069 &mvm->status)) { in iwl_mvm_bss_info_changed_station()
2085 iwl_mvm_protect_session(mvm, vif, dur, dur, in iwl_mvm_bss_info_changed_station()
2089 iwl_mvm_sf_update(mvm, vif, false); in iwl_mvm_bss_info_changed_station()
2090 iwl_mvm_power_vif_assoc(mvm, vif); in iwl_mvm_bss_info_changed_station()
2092 iwl_mvm_ref(mvm, IWL_MVM_REF_P2P_CLIENT); in iwl_mvm_bss_info_changed_station()
2093 iwl_mvm_update_smps(mvm, vif, in iwl_mvm_bss_info_changed_station()
2102 WARN_ONCE(iwl_mvm_sf_update(mvm, vif, false), in iwl_mvm_bss_info_changed_station()
2106 ret = iwl_mvm_rm_sta_id(mvm, vif, mvmvif->ap_sta_id); in iwl_mvm_bss_info_changed_station()
2108 IWL_ERR(mvm, "failed to remove AP station\n"); in iwl_mvm_bss_info_changed_station()
2110 if (mvm->d0i3_ap_sta_id == mvmvif->ap_sta_id) in iwl_mvm_bss_info_changed_station()
2111 mvm->d0i3_ap_sta_id = IWL_MVM_STATION_COUNT; in iwl_mvm_bss_info_changed_station()
2114 ret = iwl_mvm_update_quotas(mvm, false, NULL); in iwl_mvm_bss_info_changed_station()
2116 IWL_ERR(mvm, "failed to update quotas\n"); in iwl_mvm_bss_info_changed_station()
2119 iwl_mvm_unref(mvm, IWL_MVM_REF_P2P_CLIENT); in iwl_mvm_bss_info_changed_station()
2122 ret = iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); in iwl_mvm_bss_info_changed_station()
2124 IWL_ERR(mvm, in iwl_mvm_bss_info_changed_station()
2129 iwl_mvm_recalc_multicast(mvm); in iwl_mvm_bss_info_changed_station()
2130 iwl_mvm_configure_bcast_filter(mvm, vif); in iwl_mvm_bss_info_changed_station()
2135 iwl_mvm_bt_coex_vif_change(mvm); in iwl_mvm_bss_info_changed_station()
2136 iwl_mvm_update_smps(mvm, vif, IWL_MVM_SMPS_REQ_TT, in iwl_mvm_bss_info_changed_station()
2143 iwl_mvm_remove_time_event(mvm, mvmvif, in iwl_mvm_bss_info_changed_station()
2148 iwl_mvm_sf_update(mvm, vif, false); in iwl_mvm_bss_info_changed_station()
2149 WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif, 0)); in iwl_mvm_bss_info_changed_station()
2153 ret = iwl_mvm_power_update_mac(mvm); in iwl_mvm_bss_info_changed_station()
2155 IWL_ERR(mvm, "failed to update power mode\n"); in iwl_mvm_bss_info_changed_station()
2159 IWL_DEBUG_CALIB(mvm, "Changing TX Power to %d\n", in iwl_mvm_bss_info_changed_station()
2161 iwl_mvm_set_tx_power(mvm, vif, bss_conf->txpower); in iwl_mvm_bss_info_changed_station()
2165 IWL_DEBUG_MAC80211(mvm, "cqm info_changed\n"); in iwl_mvm_bss_info_changed_station()
2169 ret = iwl_mvm_enable_beacon_filter(mvm, vif, 0); in iwl_mvm_bss_info_changed_station()
2171 IWL_ERR(mvm, in iwl_mvm_bss_info_changed_station()
2177 IWL_DEBUG_MAC80211(mvm, "arp filter changed\n"); in iwl_mvm_bss_info_changed_station()
2178 iwl_mvm_configure_bcast_filter(mvm, vif); in iwl_mvm_bss_info_changed_station()
2185 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_start_ap_ibss() local
2193 ret = iwl_mvm_ref_sync(mvm, IWL_MVM_REF_START_AP); in iwl_mvm_start_ap_ibss()
2197 mutex_lock(&mvm->mutex); in iwl_mvm_start_ap_ibss()
2200 ret = iwl_mvm_mac_ctxt_beacon_changed(mvm, vif); in iwl_mvm_start_ap_ibss()
2209 iwl_mvm_mac_ctxt_recalc_tsf_id(mvm, vif); in iwl_mvm_start_ap_ibss()
2212 ret = iwl_mvm_mac_ctxt_add(mvm, vif); in iwl_mvm_start_ap_ibss()
2217 ret = iwl_mvm_binding_add_vif(mvm, vif); in iwl_mvm_start_ap_ibss()
2223 ret = iwl_mvm_send_add_bcast_sta(mvm, vif); in iwl_mvm_start_ap_ibss()
2231 iwl_mvm_power_update_mac(mvm); in iwl_mvm_start_ap_ibss()
2233 ret = iwl_mvm_update_quotas(mvm, false, NULL); in iwl_mvm_start_ap_ibss()
2238 if (vif->p2p && mvm->p2p_device_vif) in iwl_mvm_start_ap_ibss()
2239 iwl_mvm_mac_ctxt_changed(mvm, mvm->p2p_device_vif, false, NULL); in iwl_mvm_start_ap_ibss()
2241 iwl_mvm_ref(mvm, IWL_MVM_REF_AP_IBSS); in iwl_mvm_start_ap_ibss()
2243 iwl_mvm_bt_coex_vif_change(mvm); in iwl_mvm_start_ap_ibss()
2246 if (iwl_mvm_phy_ctx_count(mvm) > 1) in iwl_mvm_start_ap_ibss()
2247 iwl_mvm_teardown_tdls_peers(mvm); in iwl_mvm_start_ap_ibss()
2252 iwl_mvm_power_update_mac(mvm); in iwl_mvm_start_ap_ibss()
2254 iwl_mvm_send_rm_bcast_sta(mvm, vif); in iwl_mvm_start_ap_ibss()
2256 iwl_mvm_binding_remove_vif(mvm, vif); in iwl_mvm_start_ap_ibss()
2258 iwl_mvm_mac_ctxt_remove(mvm, vif); in iwl_mvm_start_ap_ibss()
2260 mutex_unlock(&mvm->mutex); in iwl_mvm_start_ap_ibss()
2261 iwl_mvm_unref(mvm, IWL_MVM_REF_START_AP); in iwl_mvm_start_ap_ibss()
2268 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_stop_ap_ibss() local
2271 iwl_mvm_prepare_mac_removal(mvm, vif); in iwl_mvm_stop_ap_ibss()
2273 mutex_lock(&mvm->mutex); in iwl_mvm_stop_ap_ibss()
2276 if (rcu_access_pointer(mvm->csa_vif) == vif) { in iwl_mvm_stop_ap_ibss()
2277 iwl_mvm_remove_time_event(mvm, mvmvif, in iwl_mvm_stop_ap_ibss()
2279 RCU_INIT_POINTER(mvm->csa_vif, NULL); in iwl_mvm_stop_ap_ibss()
2283 if (rcu_access_pointer(mvm->csa_tx_blocked_vif) == vif) { in iwl_mvm_stop_ap_ibss()
2284 RCU_INIT_POINTER(mvm->csa_tx_blocked_vif, NULL); in iwl_mvm_stop_ap_ibss()
2285 mvm->csa_tx_block_bcn_timeout = 0; in iwl_mvm_stop_ap_ibss()
2289 mvm->ap_last_beacon_gp2 = 0; in iwl_mvm_stop_ap_ibss()
2291 iwl_mvm_bt_coex_vif_change(mvm); in iwl_mvm_stop_ap_ibss()
2293 iwl_mvm_unref(mvm, IWL_MVM_REF_AP_IBSS); in iwl_mvm_stop_ap_ibss()
2296 if (vif->p2p && mvm->p2p_device_vif) in iwl_mvm_stop_ap_ibss()
2297 iwl_mvm_mac_ctxt_changed(mvm, mvm->p2p_device_vif, false, NULL); in iwl_mvm_stop_ap_ibss()
2299 iwl_mvm_update_quotas(mvm, false, NULL); in iwl_mvm_stop_ap_ibss()
2300 iwl_mvm_send_rm_bcast_sta(mvm, vif); in iwl_mvm_stop_ap_ibss()
2301 iwl_mvm_binding_remove_vif(mvm, vif); in iwl_mvm_stop_ap_ibss()
2303 iwl_mvm_power_update_mac(mvm); in iwl_mvm_stop_ap_ibss()
2305 iwl_mvm_mac_ctxt_remove(mvm, vif); in iwl_mvm_stop_ap_ibss()
2307 mutex_unlock(&mvm->mutex); in iwl_mvm_stop_ap_ibss()
2311 iwl_mvm_bss_info_changed_ap_ibss(struct iwl_mvm *mvm, in iwl_mvm_bss_info_changed_ap_ibss() argument
2324 iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL)) in iwl_mvm_bss_info_changed_ap_ibss()
2325 IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr); in iwl_mvm_bss_info_changed_ap_ibss()
2329 iwl_mvm_mac_ctxt_beacon_changed(mvm, vif)) in iwl_mvm_bss_info_changed_ap_ibss()
2330 IWL_WARN(mvm, "Failed updating beacon data\n"); in iwl_mvm_bss_info_changed_ap_ibss()
2333 IWL_DEBUG_CALIB(mvm, "Changing TX Power to %d\n", in iwl_mvm_bss_info_changed_ap_ibss()
2335 iwl_mvm_set_tx_power(mvm, vif, bss_conf->txpower); in iwl_mvm_bss_info_changed_ap_ibss()
2345 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_bss_info_changed() local
2352 if (iwl_mvm_ref_sync(mvm, IWL_MVM_REF_BSS_CHANGED)) in iwl_mvm_bss_info_changed()
2355 mutex_lock(&mvm->mutex); in iwl_mvm_bss_info_changed()
2358 iwl_mvm_scan_offload_stop(mvm, true); in iwl_mvm_bss_info_changed()
2362 iwl_mvm_bss_info_changed_station(mvm, vif, bss_conf, changes); in iwl_mvm_bss_info_changed()
2366 iwl_mvm_bss_info_changed_ap_ibss(mvm, vif, bss_conf, changes); in iwl_mvm_bss_info_changed()
2373 mutex_unlock(&mvm->mutex); in iwl_mvm_bss_info_changed()
2374 iwl_mvm_unref(mvm, IWL_MVM_REF_BSS_CHANGED); in iwl_mvm_bss_info_changed()
2377 static int iwl_mvm_cancel_scan_wait_notif(struct iwl_mvm *mvm, in iwl_mvm_cancel_scan_wait_notif() argument
2383 mutex_lock(&mvm->mutex); in iwl_mvm_cancel_scan_wait_notif()
2385 if (mvm->scan_status != scan_type) { in iwl_mvm_cancel_scan_wait_notif()
2394 ret = iwl_mvm_scan_offload_stop(mvm, true); in iwl_mvm_cancel_scan_wait_notif()
2397 ret = iwl_mvm_cancel_scan(mvm); in iwl_mvm_cancel_scan_wait_notif()
2410 mutex_unlock(&mvm->mutex); in iwl_mvm_cancel_scan_wait_notif()
2414 iwl_mvm_wait_for_async_handlers(mvm); in iwl_mvm_cancel_scan_wait_notif()
2422 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_hw_scan() local
2427 req->n_channels > mvm->fw->ucode_capa.n_scan_channels) in iwl_mvm_mac_hw_scan()
2430 if (!(mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN)) { in iwl_mvm_mac_hw_scan()
2431 ret = iwl_mvm_cancel_scan_wait_notif(mvm, IWL_MVM_SCAN_SCHED); in iwl_mvm_mac_hw_scan()
2436 mutex_lock(&mvm->mutex); in iwl_mvm_mac_hw_scan()
2438 if (iwl_mvm_is_lar_supported(mvm) && !mvm->lar_regdom_set) { in iwl_mvm_mac_hw_scan()
2439 IWL_ERR(mvm, "scan while LAR regdomain is not set\n"); in iwl_mvm_mac_hw_scan()
2444 if (mvm->scan_status != IWL_MVM_SCAN_NONE) { in iwl_mvm_mac_hw_scan()
2449 iwl_mvm_ref(mvm, IWL_MVM_REF_SCAN); in iwl_mvm_mac_hw_scan()
2451 if (mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN) in iwl_mvm_mac_hw_scan()
2452 ret = iwl_mvm_scan_umac(mvm, vif, hw_req); in iwl_mvm_mac_hw_scan()
2454 ret = iwl_mvm_unified_scan_lmac(mvm, vif, hw_req); in iwl_mvm_mac_hw_scan()
2457 iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN); in iwl_mvm_mac_hw_scan()
2459 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_hw_scan()
2466 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_cancel_hw_scan() local
2468 mutex_lock(&mvm->mutex); in iwl_mvm_mac_cancel_hw_scan()
2480 if ((mvm->scan_status == IWL_MVM_SCAN_OS) || in iwl_mvm_mac_cancel_hw_scan()
2481 (mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN)) in iwl_mvm_mac_cancel_hw_scan()
2482 iwl_mvm_cancel_scan(mvm); in iwl_mvm_mac_cancel_hw_scan()
2484 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_cancel_hw_scan()
2494 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_allow_buffered_frames() local
2498 iwl_mvm_sta_modify_sleep_tx_count(mvm, sta, reason, num_frames, in iwl_mvm_mac_allow_buffered_frames()
2509 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_release_buffered_frames() local
2513 iwl_mvm_sta_modify_sleep_tx_count(mvm, sta, reason, num_frames, in iwl_mvm_mac_release_buffered_frames()
2522 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_sta_notify() local
2545 if (atomic_read(&mvm->pending_frames[mvmsta->sta_id]) > 0) in iwl_mvm_mac_sta_notify()
2552 iwl_trans_freeze_txq_timer(mvm->trans, txqs, true); in iwl_mvm_mac_sta_notify()
2564 iwl_trans_freeze_txq_timer(mvm->trans, txqs, false); in iwl_mvm_mac_sta_notify()
2565 iwl_mvm_sta_modify_ps_wake(mvm, sta); in iwl_mvm_mac_sta_notify()
2577 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_sta_pre_rcu_remove() local
2588 mutex_lock(&mvm->mutex); in iwl_mvm_sta_pre_rcu_remove()
2589 if (sta == rcu_access_pointer(mvm->fw_id_to_mac_id[mvm_sta->sta_id])) in iwl_mvm_sta_pre_rcu_remove()
2590 rcu_assign_pointer(mvm->fw_id_to_mac_id[mvm_sta->sta_id], in iwl_mvm_sta_pre_rcu_remove()
2592 mutex_unlock(&mvm->mutex); in iwl_mvm_sta_pre_rcu_remove()
2595 static void iwl_mvm_check_uapsd(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_check_uapsd() argument
2598 if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_UAPSD_SUPPORT)) in iwl_mvm_check_uapsd()
2615 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_sta_state() local
2619 IWL_DEBUG_MAC80211(mvm, "station %pM state change %d->%d\n", in iwl_mvm_mac_sta_state()
2627 flush_work(&mvm->sta_drained_wk); in iwl_mvm_mac_sta_state()
2629 mutex_lock(&mvm->mutex); in iwl_mvm_mac_sta_state()
2641 IWL_ERR(mvm, in iwl_mvm_mac_sta_state()
2650 iwl_mvm_tdls_sta_count(mvm, NULL) == in iwl_mvm_mac_sta_state()
2652 iwl_mvm_phy_ctx_count(mvm) > 1)) { in iwl_mvm_mac_sta_state()
2653 IWL_DEBUG_MAC80211(mvm, "refusing TDLS sta\n"); in iwl_mvm_mac_sta_state()
2658 ret = iwl_mvm_add_sta(mvm, vif, sta); in iwl_mvm_mac_sta_state()
2660 iwl_mvm_recalc_tdls_state(mvm, vif, true); in iwl_mvm_mac_sta_state()
2667 mvm->last_ebs_successful = true; in iwl_mvm_mac_sta_state()
2668 iwl_mvm_check_uapsd(mvm, vif, sta->addr); in iwl_mvm_mac_sta_state()
2672 ret = iwl_mvm_update_sta(mvm, vif, sta); in iwl_mvm_mac_sta_state()
2674 iwl_mvm_rs_rate_init(mvm, sta, in iwl_mvm_mac_sta_state()
2681 if (iwl_mvm_phy_ctx_count(mvm) > 1) in iwl_mvm_mac_sta_state()
2682 iwl_mvm_teardown_tdls_peers(mvm); in iwl_mvm_mac_sta_state()
2685 WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif, 0)); in iwl_mvm_mac_sta_state()
2690 WARN_ON(iwl_mvm_disable_beacon_filter(mvm, vif, 0)); in iwl_mvm_mac_sta_state()
2700 ret = iwl_mvm_rm_sta(mvm, vif, sta); in iwl_mvm_mac_sta_state()
2702 iwl_mvm_recalc_tdls_state(mvm, vif, false); in iwl_mvm_mac_sta_state()
2707 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_sta_state()
2723 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_set_rts_threshold() local
2725 mvm->rts_threshold = value; in iwl_mvm_mac_set_rts_threshold()
2734 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_sta_rc_update() local
2738 iwl_mvm_sf_update(mvm, vif, false); in iwl_mvm_sta_rc_update()
2745 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_conf_tx() local
2757 mutex_lock(&mvm->mutex); in iwl_mvm_mac_conf_tx()
2758 ret = iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); in iwl_mvm_mac_conf_tx()
2759 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_conf_tx()
2768 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_mgd_prepare_tx() local
2781 if (iwl_mvm_ref_sync(mvm, IWL_MVM_REF_PREPARE_TX)) in iwl_mvm_mac_mgd_prepare_tx()
2784 mutex_lock(&mvm->mutex); in iwl_mvm_mac_mgd_prepare_tx()
2786 iwl_mvm_protect_session(mvm, vif, duration, min_duration, 500, false); in iwl_mvm_mac_mgd_prepare_tx()
2787 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_mgd_prepare_tx()
2789 iwl_mvm_unref(mvm, IWL_MVM_REF_PREPARE_TX); in iwl_mvm_mac_mgd_prepare_tx()
2797 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_sched_scan_start() local
2804 if (!(mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN)) { in iwl_mvm_mac_sched_scan_start()
2805 ret = iwl_mvm_cancel_scan_wait_notif(mvm, IWL_MVM_SCAN_OS); in iwl_mvm_mac_sched_scan_start()
2810 mutex_lock(&mvm->mutex); in iwl_mvm_mac_sched_scan_start()
2812 if (iwl_mvm_is_lar_supported(mvm) && !mvm->lar_regdom_set) { in iwl_mvm_mac_sched_scan_start()
2813 IWL_ERR(mvm, "sched-scan while LAR regdomain is not set\n"); in iwl_mvm_mac_sched_scan_start()
2823 if (mvm->scan_status != IWL_MVM_SCAN_NONE) { in iwl_mvm_mac_sched_scan_start()
2828 ret = iwl_mvm_scan_offload_start(mvm, vif, req, ies); in iwl_mvm_mac_sched_scan_start()
2830 mvm->scan_status = IWL_MVM_SCAN_NONE; in iwl_mvm_mac_sched_scan_start()
2833 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_sched_scan_start()
2840 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_sched_scan_stop() local
2843 mutex_lock(&mvm->mutex); in iwl_mvm_mac_sched_scan_stop()
2856 if (mvm->scan_status != IWL_MVM_SCAN_SCHED && in iwl_mvm_mac_sched_scan_stop()
2857 !(mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN)) { in iwl_mvm_mac_sched_scan_stop()
2858 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_sched_scan_stop()
2862 ret = iwl_mvm_scan_offload_stop(mvm, false); in iwl_mvm_mac_sched_scan_stop()
2863 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_sched_scan_stop()
2864 iwl_mvm_wait_for_async_handlers(mvm); in iwl_mvm_mac_sched_scan_stop()
2875 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_set_key() local
2879 IWL_DEBUG_MAC80211(mvm, "leave - hwcrypto disabled\n"); in iwl_mvm_mac_set_key()
2914 mutex_lock(&mvm->mutex); in iwl_mvm_mac_set_key()
2930 IWL_DEBUG_MAC80211(mvm, "set hwcrypto key\n"); in iwl_mvm_mac_set_key()
2931 ret = iwl_mvm_set_sta_key(mvm, vif, sta, key, false); in iwl_mvm_mac_set_key()
2933 IWL_WARN(mvm, "set key failed\n"); in iwl_mvm_mac_set_key()
2949 IWL_DEBUG_MAC80211(mvm, "disable hwcrypto key\n"); in iwl_mvm_mac_set_key()
2950 ret = iwl_mvm_remove_sta_key(mvm, vif, sta, key); in iwl_mvm_mac_set_key()
2956 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_set_key()
2966 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_update_tkip_key() local
2971 iwl_mvm_update_tkip_key(mvm, vif, keyconf, sta, iv32, phase1key); in iwl_mvm_mac_update_tkip_key()
2978 struct iwl_mvm *mvm = in iwl_mvm_rx_aux_roc() local
2988 IWL_ERR(mvm, "Invalid HOT_SPOT_CMD response\n"); in iwl_mvm_rx_aux_roc()
2994 IWL_DEBUG_TE(mvm, in iwl_mvm_rx_aux_roc()
2999 IWL_DEBUG_TE(mvm, "TIME_EVENT_CMD response - UID = 0x%x\n", in iwl_mvm_rx_aux_roc()
3002 spin_lock_bh(&mvm->time_event_lock); in iwl_mvm_rx_aux_roc()
3003 list_add_tail(&te_data->list, &mvm->aux_roc_te_list); in iwl_mvm_rx_aux_roc()
3004 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_rx_aux_roc()
3010 static int iwl_mvm_send_aux_roc_cmd(struct iwl_mvm *mvm, in iwl_mvm_send_aux_roc_cmd() argument
3024 .sta_id_and_color = cpu_to_le32(mvm->aux_sta.sta_id), in iwl_mvm_send_aux_roc_cmd()
3031 .apply_time = cpu_to_le32(iwl_read_prph(mvm->trans, time_reg)), in iwl_mvm_send_aux_roc_cmd()
3040 lockdep_assert_held(&mvm->mutex); in iwl_mvm_send_aux_roc_cmd()
3042 spin_lock_bh(&mvm->time_event_lock); in iwl_mvm_send_aux_roc_cmd()
3045 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_send_aux_roc_cmd()
3053 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_send_aux_roc_cmd()
3064 iwl_init_notification_wait(&mvm->notif_wait, &wait_time_event, in iwl_mvm_send_aux_roc_cmd()
3069 res = iwl_mvm_send_cmd_pdu(mvm, HOT_SPOT_CMD, 0, sizeof(aux_roc_req), in iwl_mvm_send_aux_roc_cmd()
3073 IWL_ERR(mvm, "Couldn't send HOT_SPOT_CMD: %d\n", res); in iwl_mvm_send_aux_roc_cmd()
3074 iwl_remove_notification(&mvm->notif_wait, &wait_time_event); in iwl_mvm_send_aux_roc_cmd()
3079 res = iwl_wait_notification(&mvm->notif_wait, &wait_time_event, 1); in iwl_mvm_send_aux_roc_cmd()
3085 spin_lock_bh(&mvm->time_event_lock); in iwl_mvm_send_aux_roc_cmd()
3086 iwl_mvm_te_clear_data(mvm, te_data); in iwl_mvm_send_aux_roc_cmd()
3087 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_send_aux_roc_cmd()
3099 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_roc() local
3105 IWL_DEBUG_MAC80211(mvm, "enter (%d, %d, %d)\n", channel->hw_value, in iwl_mvm_roc()
3108 flush_work(&mvm->roc_done_wk); in iwl_mvm_roc()
3110 mutex_lock(&mvm->mutex); in iwl_mvm_roc()
3114 if (mvm->fw->ucode_capa.capa[0] & in iwl_mvm_roc()
3117 ret = iwl_mvm_send_aux_roc_cmd(mvm, channel, in iwl_mvm_roc()
3121 IWL_ERR(mvm, "hotspot not supported\n"); in iwl_mvm_roc()
3128 IWL_ERR(mvm, "vif isn't P2P_DEVICE: %d\n", vif->type); in iwl_mvm_roc()
3134 phy_ctxt = &mvm->phy_ctxts[i]; in iwl_mvm_roc()
3143 ret = iwl_mvm_binding_remove_vif(mvm, vif); in iwl_mvm_roc()
3147 iwl_mvm_phy_ctxt_unref(mvm, mvmvif->phy_ctxt); in iwl_mvm_roc()
3152 ret = iwl_mvm_binding_add_vif(mvm, vif); in iwl_mvm_roc()
3156 iwl_mvm_phy_ctxt_ref(mvm, mvmvif->phy_ctxt); in iwl_mvm_roc()
3172 ret = iwl_mvm_phy_ctxt_changed(mvm, mvmvif->phy_ctxt, in iwl_mvm_roc()
3182 phy_ctxt = iwl_mvm_get_free_phy_ctxt(mvm); in iwl_mvm_roc()
3188 ret = iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, &chandef, in iwl_mvm_roc()
3191 IWL_ERR(mvm, "Failed to change PHY context\n"); in iwl_mvm_roc()
3196 ret = iwl_mvm_binding_remove_vif(mvm, vif); in iwl_mvm_roc()
3200 iwl_mvm_phy_ctxt_unref(mvm, mvmvif->phy_ctxt); in iwl_mvm_roc()
3205 ret = iwl_mvm_binding_add_vif(mvm, vif); in iwl_mvm_roc()
3209 iwl_mvm_phy_ctxt_ref(mvm, mvmvif->phy_ctxt); in iwl_mvm_roc()
3214 ret = iwl_mvm_start_p2p_roc(mvm, vif, duration, type); in iwl_mvm_roc()
3217 mutex_unlock(&mvm->mutex); in iwl_mvm_roc()
3218 IWL_DEBUG_MAC80211(mvm, "leave\n"); in iwl_mvm_roc()
3224 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_cancel_roc() local
3226 IWL_DEBUG_MAC80211(mvm, "enter\n"); in iwl_mvm_cancel_roc()
3228 mutex_lock(&mvm->mutex); in iwl_mvm_cancel_roc()
3229 iwl_mvm_stop_roc(mvm); in iwl_mvm_cancel_roc()
3230 mutex_unlock(&mvm->mutex); in iwl_mvm_cancel_roc()
3232 IWL_DEBUG_MAC80211(mvm, "leave\n"); in iwl_mvm_cancel_roc()
3236 static int __iwl_mvm_add_chanctx(struct iwl_mvm *mvm, in __iwl_mvm_add_chanctx() argument
3243 lockdep_assert_held(&mvm->mutex); in __iwl_mvm_add_chanctx()
3245 IWL_DEBUG_MAC80211(mvm, "Add channel context\n"); in __iwl_mvm_add_chanctx()
3247 phy_ctxt = iwl_mvm_get_free_phy_ctxt(mvm); in __iwl_mvm_add_chanctx()
3253 ret = iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, &ctx->min_def, in __iwl_mvm_add_chanctx()
3257 IWL_ERR(mvm, "Failed to add PHY context\n"); in __iwl_mvm_add_chanctx()
3261 iwl_mvm_phy_ctxt_ref(mvm, phy_ctxt); in __iwl_mvm_add_chanctx()
3270 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_add_chanctx() local
3273 mutex_lock(&mvm->mutex); in iwl_mvm_add_chanctx()
3274 ret = __iwl_mvm_add_chanctx(mvm, ctx); in iwl_mvm_add_chanctx()
3275 mutex_unlock(&mvm->mutex); in iwl_mvm_add_chanctx()
3280 static void __iwl_mvm_remove_chanctx(struct iwl_mvm *mvm, in __iwl_mvm_remove_chanctx() argument
3284 struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id]; in __iwl_mvm_remove_chanctx()
3286 lockdep_assert_held(&mvm->mutex); in __iwl_mvm_remove_chanctx()
3288 iwl_mvm_phy_ctxt_unref(mvm, phy_ctxt); in __iwl_mvm_remove_chanctx()
3294 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_remove_chanctx() local
3296 mutex_lock(&mvm->mutex); in iwl_mvm_remove_chanctx()
3297 __iwl_mvm_remove_chanctx(mvm, ctx); in iwl_mvm_remove_chanctx()
3298 mutex_unlock(&mvm->mutex); in iwl_mvm_remove_chanctx()
3305 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_change_chanctx() local
3307 struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id]; in iwl_mvm_change_chanctx()
3318 mutex_lock(&mvm->mutex); in iwl_mvm_change_chanctx()
3319 iwl_mvm_bt_coex_vif_change(mvm); in iwl_mvm_change_chanctx()
3320 iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, &ctx->min_def, in iwl_mvm_change_chanctx()
3323 mutex_unlock(&mvm->mutex); in iwl_mvm_change_chanctx()
3326 static int __iwl_mvm_assign_vif_chanctx(struct iwl_mvm *mvm, in __iwl_mvm_assign_vif_chanctx() argument
3332 struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id]; in __iwl_mvm_assign_vif_chanctx()
3336 lockdep_assert_held(&mvm->mutex); in __iwl_mvm_assign_vif_chanctx()
3365 ret = iwl_mvm_binding_add_vif(mvm, vif); in __iwl_mvm_assign_vif_chanctx()
3373 iwl_mvm_power_update_mac(mvm); in __iwl_mvm_assign_vif_chanctx()
3381 ret = iwl_mvm_update_quotas(mvm, false, NULL); in __iwl_mvm_assign_vif_chanctx()
3388 iwl_mvm_update_quotas(mvm, false, NULL); in __iwl_mvm_assign_vif_chanctx()
3389 iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); in __iwl_mvm_assign_vif_chanctx()
3399 ret = iwl_mvm_ref_sync(mvm, IWL_MVM_REF_PROTECT_CSA); in __iwl_mvm_assign_vif_chanctx()
3406 iwl_mvm_protect_session(mvm, vif, duration, duration, in __iwl_mvm_assign_vif_chanctx()
3410 iwl_mvm_unref(mvm, IWL_MVM_REF_PROTECT_CSA); in __iwl_mvm_assign_vif_chanctx()
3412 iwl_mvm_update_quotas(mvm, false, NULL); in __iwl_mvm_assign_vif_chanctx()
3418 iwl_mvm_binding_remove_vif(mvm, vif); in __iwl_mvm_assign_vif_chanctx()
3419 iwl_mvm_power_update_mac(mvm); in __iwl_mvm_assign_vif_chanctx()
3429 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_assign_vif_chanctx() local
3432 mutex_lock(&mvm->mutex); in iwl_mvm_assign_vif_chanctx()
3433 ret = __iwl_mvm_assign_vif_chanctx(mvm, vif, ctx, false); in iwl_mvm_assign_vif_chanctx()
3434 mutex_unlock(&mvm->mutex); in iwl_mvm_assign_vif_chanctx()
3439 static void __iwl_mvm_unassign_vif_chanctx(struct iwl_mvm *mvm, in __iwl_mvm_unassign_vif_chanctx() argument
3447 lockdep_assert_held(&mvm->mutex); in __iwl_mvm_unassign_vif_chanctx()
3449 iwl_mvm_remove_time_event(mvm, mvmvif, &mvmvif->time_event_data); in __iwl_mvm_unassign_vif_chanctx()
3466 iwl_mvm_modify_all_sta_disable_tx(mvm, mvmvif, true); in __iwl_mvm_unassign_vif_chanctx()
3469 rcu_assign_pointer(mvm->csa_tx_blocked_vif, vif); in __iwl_mvm_unassign_vif_chanctx()
3479 iwl_mvm_mac_ctxt_changed(mvm, vif, true, NULL); in __iwl_mvm_unassign_vif_chanctx()
3485 iwl_mvm_update_quotas(mvm, false, disabled_vif); in __iwl_mvm_unassign_vif_chanctx()
3486 iwl_mvm_binding_remove_vif(mvm, vif); in __iwl_mvm_unassign_vif_chanctx()
3490 iwl_mvm_power_update_mac(mvm); in __iwl_mvm_unassign_vif_chanctx()
3497 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_unassign_vif_chanctx() local
3499 mutex_lock(&mvm->mutex); in iwl_mvm_unassign_vif_chanctx()
3500 __iwl_mvm_unassign_vif_chanctx(mvm, vif, ctx, false); in iwl_mvm_unassign_vif_chanctx()
3501 mutex_unlock(&mvm->mutex); in iwl_mvm_unassign_vif_chanctx()
3505 iwl_mvm_switch_vif_chanctx_swap(struct iwl_mvm *mvm, in iwl_mvm_switch_vif_chanctx_swap() argument
3510 mutex_lock(&mvm->mutex); in iwl_mvm_switch_vif_chanctx_swap()
3511 __iwl_mvm_unassign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx, true); in iwl_mvm_switch_vif_chanctx_swap()
3512 __iwl_mvm_remove_chanctx(mvm, vifs[0].old_ctx); in iwl_mvm_switch_vif_chanctx_swap()
3514 ret = __iwl_mvm_add_chanctx(mvm, vifs[0].new_ctx); in iwl_mvm_switch_vif_chanctx_swap()
3516 IWL_ERR(mvm, "failed to add new_ctx during channel switch\n"); in iwl_mvm_switch_vif_chanctx_swap()
3520 ret = __iwl_mvm_assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].new_ctx, in iwl_mvm_switch_vif_chanctx_swap()
3523 IWL_ERR(mvm, in iwl_mvm_switch_vif_chanctx_swap()
3529 if (iwl_mvm_phy_ctx_count(mvm) > 1) in iwl_mvm_switch_vif_chanctx_swap()
3530 iwl_mvm_teardown_tdls_peers(mvm); in iwl_mvm_switch_vif_chanctx_swap()
3535 __iwl_mvm_remove_chanctx(mvm, vifs[0].new_ctx); in iwl_mvm_switch_vif_chanctx_swap()
3538 if (__iwl_mvm_add_chanctx(mvm, vifs[0].old_ctx)) { in iwl_mvm_switch_vif_chanctx_swap()
3539 IWL_ERR(mvm, "failed to add old_ctx back after failure.\n"); in iwl_mvm_switch_vif_chanctx_swap()
3543 if (__iwl_mvm_assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx, in iwl_mvm_switch_vif_chanctx_swap()
3545 IWL_ERR(mvm, "failed to reassign old_ctx after failure.\n"); in iwl_mvm_switch_vif_chanctx_swap()
3553 iwl_mvm_nic_restart(mvm, false); in iwl_mvm_switch_vif_chanctx_swap()
3556 mutex_unlock(&mvm->mutex); in iwl_mvm_switch_vif_chanctx_swap()
3562 iwl_mvm_switch_vif_chanctx_reassign(struct iwl_mvm *mvm, in iwl_mvm_switch_vif_chanctx_reassign() argument
3567 mutex_lock(&mvm->mutex); in iwl_mvm_switch_vif_chanctx_reassign()
3568 __iwl_mvm_unassign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx, true); in iwl_mvm_switch_vif_chanctx_reassign()
3570 ret = __iwl_mvm_assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].new_ctx, in iwl_mvm_switch_vif_chanctx_reassign()
3573 IWL_ERR(mvm, in iwl_mvm_switch_vif_chanctx_reassign()
3581 if (__iwl_mvm_assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx, in iwl_mvm_switch_vif_chanctx_reassign()
3583 IWL_ERR(mvm, "failed to reassign old_ctx after failure.\n"); in iwl_mvm_switch_vif_chanctx_reassign()
3591 iwl_mvm_nic_restart(mvm, false); in iwl_mvm_switch_vif_chanctx_reassign()
3594 mutex_unlock(&mvm->mutex); in iwl_mvm_switch_vif_chanctx_reassign()
3604 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_switch_vif_chanctx() local
3613 ret = iwl_mvm_switch_vif_chanctx_swap(mvm, vifs); in iwl_mvm_switch_vif_chanctx()
3616 ret = iwl_mvm_switch_vif_chanctx_reassign(mvm, vifs); in iwl_mvm_switch_vif_chanctx()
3630 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_set_tim() local
3634 IWL_ERR(mvm, "Station is not associated to a vif\n"); in iwl_mvm_set_tim()
3638 return iwl_mvm_mac_ctxt_beacon_changed(mvm, mvm_sta->vif); in iwl_mvm_set_tim()
3648 static int __iwl_mvm_mac_testmode_cmd(struct iwl_mvm *mvm, in __iwl_mvm_mac_testmode_cmd() argument
3674 mvm->noa_duration = noa_duration; in __iwl_mvm_mac_testmode_cmd()
3675 mvm->noa_vif = vif; in __iwl_mvm_mac_testmode_cmd()
3677 return iwl_mvm_update_quotas(mvm, false, NULL); in __iwl_mvm_mac_testmode_cmd()
3686 return iwl_mvm_enable_beacon_filter(mvm, vif, 0); in __iwl_mvm_mac_testmode_cmd()
3687 return iwl_mvm_disable_beacon_filter(mvm, vif, 0); in __iwl_mvm_mac_testmode_cmd()
3697 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_testmode_cmd() local
3700 mutex_lock(&mvm->mutex); in iwl_mvm_mac_testmode_cmd()
3701 err = __iwl_mvm_mac_testmode_cmd(mvm, vif, data, len); in iwl_mvm_mac_testmode_cmd()
3702 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_testmode_cmd()
3726 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_pre_channel_switch() local
3732 mutex_lock(&mvm->mutex); in iwl_mvm_pre_channel_switch()
3736 IWL_DEBUG_MAC80211(mvm, "pre CSA to freq %d\n", in iwl_mvm_pre_channel_switch()
3739 iwl_fw_dbg_trigger_simple_stop(mvm, vif, FW_DBG_TRIGGER_CHANNEL_SWITCH); in iwl_mvm_pre_channel_switch()
3744 rcu_dereference_protected(mvm->csa_vif, in iwl_mvm_pre_channel_switch()
3745 lockdep_is_held(&mvm->mutex)); in iwl_mvm_pre_channel_switch()
3752 rcu_assign_pointer(mvm->csa_vif, vif); in iwl_mvm_pre_channel_switch()
3771 iwl_mvm_csa_client_absent(mvm, vif); in iwl_mvm_pre_channel_switch()
3773 iwl_mvm_schedule_csa_period(mvm, vif, vif->bss_conf.beacon_int, in iwl_mvm_pre_channel_switch()
3776 ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0); in iwl_mvm_pre_channel_switch()
3788 ret = iwl_mvm_power_update_ps(mvm); in iwl_mvm_pre_channel_switch()
3793 iwl_mvm_teardown_tdls_peers(mvm); in iwl_mvm_pre_channel_switch()
3796 mutex_unlock(&mvm->mutex); in iwl_mvm_pre_channel_switch()
3805 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_post_channel_switch() local
3808 mutex_lock(&mvm->mutex); in iwl_mvm_post_channel_switch()
3819 mvmsta = iwl_mvm_sta_from_staid_protected(mvm, in iwl_mvm_post_channel_switch()
3827 iwl_mvm_sta_modify_disable_tx(mvm, mvmsta, false); in iwl_mvm_post_channel_switch()
3829 iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); in iwl_mvm_post_channel_switch()
3831 ret = iwl_mvm_enable_beacon_filter(mvm, vif, 0); in iwl_mvm_post_channel_switch()
3835 iwl_mvm_stop_session_protection(mvm, vif); in iwl_mvm_post_channel_switch()
3840 ret = iwl_mvm_power_update_ps(mvm); in iwl_mvm_post_channel_switch()
3843 mutex_unlock(&mvm->mutex); in iwl_mvm_post_channel_switch()
3851 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_flush() local
3861 mutex_lock(&mvm->mutex); in iwl_mvm_mac_flush()
3866 sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[i], in iwl_mvm_mac_flush()
3867 lockdep_is_held(&mvm->mutex)); in iwl_mvm_mac_flush()
3882 if (iwl_mvm_flush_tx_path(mvm, msk, true)) in iwl_mvm_mac_flush()
3883 IWL_ERR(mvm, "flush request fail\n"); in iwl_mvm_mac_flush()
3884 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_flush()
3886 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_flush()
3891 iwl_trans_wait_tx_queue_empty(mvm->trans, msk); in iwl_mvm_mac_flush()
3898 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_get_survey() local
3907 if (!(mvm->fw->ucode_capa.capa[0] & in iwl_mvm_mac_get_survey()
3911 mutex_lock(&mvm->mutex); in iwl_mvm_mac_get_survey()
3913 if (mvm->ucode_loaded) { in iwl_mvm_mac_get_survey()
3914 ret = iwl_mvm_request_statistics(mvm, false); in iwl_mvm_mac_get_survey()
3923 survey->time = mvm->accu_radio_stats.on_time_rf + in iwl_mvm_mac_get_survey()
3924 mvm->radio_stats.on_time_rf; in iwl_mvm_mac_get_survey()
3927 survey->time_rx = mvm->accu_radio_stats.rx_time + in iwl_mvm_mac_get_survey()
3928 mvm->radio_stats.rx_time; in iwl_mvm_mac_get_survey()
3931 survey->time_tx = mvm->accu_radio_stats.tx_time + in iwl_mvm_mac_get_survey()
3932 mvm->radio_stats.tx_time; in iwl_mvm_mac_get_survey()
3935 survey->time_scan = mvm->accu_radio_stats.on_time_scan + in iwl_mvm_mac_get_survey()
3936 mvm->radio_stats.on_time_scan; in iwl_mvm_mac_get_survey()
3941 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_get_survey()
3950 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_sta_statistics() local
3954 if (!(mvm->fw->ucode_capa.capa[0] & in iwl_mvm_mac_sta_statistics()
3965 mutex_lock(&mvm->mutex); in iwl_mvm_mac_sta_statistics()
3970 if (iwl_mvm_request_statistics(mvm, false)) in iwl_mvm_mac_sta_statistics()
3982 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_sta_statistics()
3996 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_event_callback() local
4000 if (!iwl_fw_dbg_trigger_enabled(mvm->fw, FW_DBG_TRIGGER_MLME)) in iwl_mvm_mac_event_callback()
4003 trig = iwl_fw_dbg_get_trigger(mvm->fw, FW_DBG_TRIGGER_MLME); in iwl_mvm_mac_event_callback()
4005 if (!iwl_fw_dbg_trigger_check_stop(mvm, vif, trig)) in iwl_mvm_mac_event_callback()
4010 CHECK_MLME_TRIGGER(mvm, trig, buf, in iwl_mvm_mac_event_callback()
4015 CHECK_MLME_TRIGGER(mvm, trig, buf, in iwl_mvm_mac_event_callback()
4020 CHECK_MLME_TRIGGER(mvm, trig, buf, in iwl_mvm_mac_event_callback()
4025 CHECK_MLME_TRIGGER(mvm, trig, buf, in iwl_mvm_mac_event_callback()
4029 CHECK_MLME_TRIGGER(mvm, trig, buf, in iwl_mvm_mac_event_callback()
4033 CHECK_MLME_TRIGGER(mvm, trig, buf, in iwl_mvm_mac_event_callback()