Lines Matching refs:mvm
212 void iwl_mvm_ref(struct iwl_mvm *mvm, enum iwl_mvm_ref_type ref_type) in iwl_mvm_ref() argument
214 if (!iwl_mvm_is_d0i3_supported(mvm)) in iwl_mvm_ref()
217 IWL_DEBUG_RPM(mvm, "Take mvm reference - type %d\n", ref_type); in iwl_mvm_ref()
218 spin_lock_bh(&mvm->refs_lock); in iwl_mvm_ref()
219 mvm->refs[ref_type]++; in iwl_mvm_ref()
220 spin_unlock_bh(&mvm->refs_lock); in iwl_mvm_ref()
221 iwl_trans_ref(mvm->trans); in iwl_mvm_ref()
224 void iwl_mvm_unref(struct iwl_mvm *mvm, enum iwl_mvm_ref_type ref_type) in iwl_mvm_unref() argument
226 if (!iwl_mvm_is_d0i3_supported(mvm)) in iwl_mvm_unref()
229 IWL_DEBUG_RPM(mvm, "Leave mvm reference - type %d\n", ref_type); in iwl_mvm_unref()
230 spin_lock_bh(&mvm->refs_lock); in iwl_mvm_unref()
231 WARN_ON(!mvm->refs[ref_type]--); in iwl_mvm_unref()
232 spin_unlock_bh(&mvm->refs_lock); in iwl_mvm_unref()
233 iwl_trans_unref(mvm->trans); in iwl_mvm_unref()
236 static void iwl_mvm_unref_all_except(struct iwl_mvm *mvm, in iwl_mvm_unref_all_except() argument
241 if (!iwl_mvm_is_d0i3_supported(mvm)) in iwl_mvm_unref_all_except()
244 spin_lock_bh(&mvm->refs_lock); in iwl_mvm_unref_all_except()
246 if (except_ref == i || !mvm->refs[i]) in iwl_mvm_unref_all_except()
249 IWL_DEBUG_RPM(mvm, "Cleanup: remove mvm ref type %d (%d)\n", in iwl_mvm_unref_all_except()
250 i, mvm->refs[i]); in iwl_mvm_unref_all_except()
251 for (j = 0; j < mvm->refs[i]; j++) in iwl_mvm_unref_all_except()
252 iwl_trans_unref(mvm->trans); in iwl_mvm_unref_all_except()
253 mvm->refs[i] = 0; in iwl_mvm_unref_all_except()
255 spin_unlock_bh(&mvm->refs_lock); in iwl_mvm_unref_all_except()
258 bool iwl_mvm_ref_taken(struct iwl_mvm *mvm) in iwl_mvm_ref_taken() argument
263 if (!iwl_mvm_is_d0i3_supported(mvm)) in iwl_mvm_ref_taken()
266 spin_lock_bh(&mvm->refs_lock); in iwl_mvm_ref_taken()
268 if (mvm->refs[i]) { in iwl_mvm_ref_taken()
273 spin_unlock_bh(&mvm->refs_lock); in iwl_mvm_ref_taken()
278 int iwl_mvm_ref_sync(struct iwl_mvm *mvm, enum iwl_mvm_ref_type ref_type) in iwl_mvm_ref_sync() argument
280 iwl_mvm_ref(mvm, ref_type); in iwl_mvm_ref_sync()
282 if (!wait_event_timeout(mvm->d0i3_exit_waitq, in iwl_mvm_ref_sync()
283 !test_bit(IWL_MVM_STATUS_IN_D0I3, &mvm->status), in iwl_mvm_ref_sync()
286 iwl_mvm_unref(mvm, ref_type); in iwl_mvm_ref_sync()
293 static void iwl_mvm_reset_phy_ctxts(struct iwl_mvm *mvm) in iwl_mvm_reset_phy_ctxts() argument
297 memset(mvm->phy_ctxts, 0, sizeof(mvm->phy_ctxts)); in iwl_mvm_reset_phy_ctxts()
299 mvm->phy_ctxts[i].id = i; in iwl_mvm_reset_phy_ctxts()
300 mvm->phy_ctxts[i].ref = 0; in iwl_mvm_reset_phy_ctxts()
311 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_get_regdomain() local
314 IWL_DEBUG_LAR(mvm, "Getting regdomain data for %s from FW\n", alpha2); in iwl_mvm_get_regdomain()
316 lockdep_assert_held(&mvm->mutex); in iwl_mvm_get_regdomain()
318 resp = iwl_mvm_update_mcc(mvm, alpha2, src_id); in iwl_mvm_get_regdomain()
320 IWL_DEBUG_LAR(mvm, "Could not get update from FW %d\n", in iwl_mvm_get_regdomain()
328 regd = iwl_parse_nvm_mcc_info(mvm->trans->dev, mvm->cfg, in iwl_mvm_get_regdomain()
336 IWL_DEBUG_LAR(mvm, "Could not get parse update from FW %d\n", in iwl_mvm_get_regdomain()
341 IWL_DEBUG_LAR(mvm, "setting alpha2 from FW to %s (0x%x, 0x%x) src=%d\n", in iwl_mvm_get_regdomain()
343 mvm->lar_regdom_set = true; in iwl_mvm_get_regdomain()
344 mvm->mcc_src = src_id; in iwl_mvm_get_regdomain()
350 void iwl_mvm_update_changed_regdom(struct iwl_mvm *mvm) in iwl_mvm_update_changed_regdom() argument
355 if (!iwl_mvm_is_lar_supported(mvm)) in iwl_mvm_update_changed_regdom()
358 regd = iwl_mvm_get_current_regdomain(mvm, &changed); in iwl_mvm_update_changed_regdom()
362 regulatory_set_wiphy_regd(mvm->hw->wiphy, regd); in iwl_mvm_update_changed_regdom()
368 struct ieee80211_regdomain *iwl_mvm_get_current_regdomain(struct iwl_mvm *mvm, in iwl_mvm_get_current_regdomain() argument
371 return iwl_mvm_get_regdomain(mvm->hw->wiphy, "ZZ", in iwl_mvm_get_current_regdomain()
372 iwl_mvm_is_wifi_mcc_supported(mvm) ? in iwl_mvm_get_current_regdomain()
377 int iwl_mvm_init_fw_regd(struct iwl_mvm *mvm) in iwl_mvm_init_fw_regd() argument
384 rtnl_dereference(mvm->hw->wiphy->regd); in iwl_mvm_init_fw_regd()
390 used_src = mvm->mcc_src; in iwl_mvm_init_fw_regd()
391 if (iwl_mvm_is_wifi_mcc_supported(mvm)) { in iwl_mvm_init_fw_regd()
393 regd = iwl_mvm_get_current_regdomain(mvm, NULL); in iwl_mvm_init_fw_regd()
399 regd = iwl_mvm_get_regdomain(mvm->hw->wiphy, r->alpha2, used_src, in iwl_mvm_init_fw_regd()
406 ret = regulatory_set_wiphy_regd_sync_rtnl(mvm->hw->wiphy, regd); in iwl_mvm_init_fw_regd()
414 int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) in iwl_mvm_mac_setup_register() argument
416 struct ieee80211_hw *hw = mvm->hw; in iwl_mvm_mac_setup_register()
440 hw->queues = mvm->first_agg_queue; in iwl_mvm_mac_setup_register()
450 BUILD_BUG_ON(ARRAY_SIZE(mvm->ciphers) < ARRAY_SIZE(mvm_ciphers) + 2); in iwl_mvm_mac_setup_register()
451 memcpy(mvm->ciphers, mvm_ciphers, sizeof(mvm_ciphers)); in iwl_mvm_mac_setup_register()
453 hw->wiphy->cipher_suites = mvm->ciphers; in iwl_mvm_mac_setup_register()
460 if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_MFP && in iwl_mvm_mac_setup_register()
463 mvm->ciphers[hw->wiphy->n_cipher_suites] = in iwl_mvm_mac_setup_register()
469 if (mvm->fw->cs[0].cipher) { in iwl_mvm_mac_setup_register()
470 mvm->hw->n_cipher_schemes = 1; in iwl_mvm_mac_setup_register()
471 mvm->hw->cipher_schemes = &mvm->fw->cs[0]; in iwl_mvm_mac_setup_register()
472 mvm->ciphers[hw->wiphy->n_cipher_suites] = in iwl_mvm_mac_setup_register()
473 mvm->fw->cs[0].cipher; in iwl_mvm_mac_setup_register()
496 if (iwl_mvm_is_lar_supported(mvm)) in iwl_mvm_mac_setup_register()
502 if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_GO_UAPSD) in iwl_mvm_mac_setup_register()
517 memcpy(mvm->addresses[0].addr, mvm->nvm_data->hw_addr, ETH_ALEN); in iwl_mvm_mac_setup_register()
518 hw->wiphy->addresses = mvm->addresses; in iwl_mvm_mac_setup_register()
522 num_mac = (mvm->nvm_data->n_hw_addrs > 1) ? in iwl_mvm_mac_setup_register()
523 min(IWL_MVM_MAX_ADDRESSES, mvm->nvm_data->n_hw_addrs) : 1; in iwl_mvm_mac_setup_register()
526 memcpy(mvm->addresses[i].addr, mvm->addresses[i-1].addr, in iwl_mvm_mac_setup_register()
528 mvm->addresses[i].addr[5]++; in iwl_mvm_mac_setup_register()
532 iwl_mvm_reset_phy_ctxts(mvm); in iwl_mvm_mac_setup_register()
534 hw->wiphy->max_scan_ie_len = iwl_mvm_max_scan_ie_len(mvm); in iwl_mvm_mac_setup_register()
542 if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_UMAC_SCAN)) in iwl_mvm_mac_setup_register()
543 mvm->max_scans = IWL_MVM_MAX_UMAC_SCANS; in iwl_mvm_mac_setup_register()
545 mvm->max_scans = IWL_MVM_MAX_LMAC_SCANS; in iwl_mvm_mac_setup_register()
547 if (mvm->nvm_data->bands[IEEE80211_BAND_2GHZ].n_channels) in iwl_mvm_mac_setup_register()
549 &mvm->nvm_data->bands[IEEE80211_BAND_2GHZ]; in iwl_mvm_mac_setup_register()
550 if (mvm->nvm_data->bands[IEEE80211_BAND_5GHZ].n_channels) { in iwl_mvm_mac_setup_register()
552 &mvm->nvm_data->bands[IEEE80211_BAND_5GHZ]; in iwl_mvm_mac_setup_register()
554 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
556 fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
562 hw->wiphy->hw_version = mvm->trans->hw_id; in iwl_mvm_mac_setup_register()
591 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
594 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
598 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
603 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
607 mvm->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD; in iwl_mvm_mac_setup_register()
610 if (iwl_mvm_is_d0i3_supported(mvm) && in iwl_mvm_mac_setup_register()
611 device_can_wakeup(mvm->trans->dev)) { in iwl_mvm_mac_setup_register()
612 mvm->wowlan.flags = WIPHY_WOWLAN_ANY; in iwl_mvm_mac_setup_register()
613 hw->wiphy->wowlan = &mvm->wowlan; in iwl_mvm_mac_setup_register()
616 if (mvm->fw->img[IWL_UCODE_WOWLAN].sec[0].len && in iwl_mvm_mac_setup_register()
617 mvm->trans->ops->d3_suspend && in iwl_mvm_mac_setup_register()
618 mvm->trans->ops->d3_resume && in iwl_mvm_mac_setup_register()
619 device_can_wakeup(mvm->trans->dev)) { in iwl_mvm_mac_setup_register()
620 mvm->wowlan.flags |= WIPHY_WOWLAN_MAGIC_PKT | in iwl_mvm_mac_setup_register()
626 mvm->wowlan.flags |= WIPHY_WOWLAN_SUPPORTS_GTK_REKEY | in iwl_mvm_mac_setup_register()
630 mvm->wowlan.n_patterns = IWL_WOWLAN_MAX_PATTERNS; in iwl_mvm_mac_setup_register()
631 mvm->wowlan.pattern_min_len = IWL_WOWLAN_MIN_PATTERN_LEN; in iwl_mvm_mac_setup_register()
632 mvm->wowlan.pattern_max_len = IWL_WOWLAN_MAX_PATTERN_LEN; in iwl_mvm_mac_setup_register()
633 mvm->wowlan.max_nd_match_sets = IWL_SCAN_MAX_PROFILES; in iwl_mvm_mac_setup_register()
634 mvm->wowlan.tcp = &iwl_mvm_wowlan_tcp_support; in iwl_mvm_mac_setup_register()
635 hw->wiphy->wowlan = &mvm->wowlan; in iwl_mvm_mac_setup_register()
641 mvm->bcast_filters = iwl_mvm_default_bcast_filters; in iwl_mvm_mac_setup_register()
644 ret = iwl_mvm_leds_init(mvm); in iwl_mvm_mac_setup_register()
648 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
650 IWL_DEBUG_TDLS(mvm, "TDLS supported\n"); in iwl_mvm_mac_setup_register()
655 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_setup_register()
657 IWL_DEBUG_TDLS(mvm, "TDLS channel switch supported\n"); in iwl_mvm_mac_setup_register()
661 hw->netdev_features |= mvm->cfg->features; in iwl_mvm_mac_setup_register()
662 if (!iwl_mvm_is_csum_supported(mvm)) in iwl_mvm_mac_setup_register()
665 ret = ieee80211_register_hw(mvm->hw); in iwl_mvm_mac_setup_register()
667 iwl_mvm_leds_exit(mvm); in iwl_mvm_mac_setup_register()
672 static bool iwl_mvm_defer_tx(struct iwl_mvm *mvm, in iwl_mvm_defer_tx() argument
684 if (likely(!test_bit(IWL_MVM_STATUS_IN_D0I3, &mvm->status))) in iwl_mvm_defer_tx()
687 spin_lock(&mvm->d0i3_tx_lock); in iwl_mvm_defer_tx()
692 if (!test_bit(IWL_MVM_STATUS_IN_D0I3, &mvm->status)) in iwl_mvm_defer_tx()
697 mvmsta->sta_id != mvm->d0i3_ap_sta_id) in iwl_mvm_defer_tx()
700 __skb_queue_tail(&mvm->d0i3_tx, skb); in iwl_mvm_defer_tx()
701 ieee80211_stop_queues(mvm->hw); in iwl_mvm_defer_tx()
704 iwl_mvm_ref(mvm, IWL_MVM_REF_TX); in iwl_mvm_defer_tx()
705 iwl_mvm_unref(mvm, IWL_MVM_REF_TX); in iwl_mvm_defer_tx()
709 spin_unlock(&mvm->d0i3_tx_lock); in iwl_mvm_defer_tx()
717 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_tx() local
722 if (iwl_mvm_is_radio_killed(mvm)) { in iwl_mvm_mac_tx()
723 IWL_DEBUG_DROP(mvm, "Dropping - RF/CT KILL\n"); in iwl_mvm_mac_tx()
728 !test_bit(IWL_MVM_STATUS_ROC_RUNNING, &mvm->status) && in iwl_mvm_mac_tx()
729 !test_bit(IWL_MVM_STATUS_ROC_AUX_RUNNING, &mvm->status)) in iwl_mvm_mac_tx()
741 if (iwl_mvm_defer_tx(mvm, sta, skb)) in iwl_mvm_mac_tx()
743 if (iwl_mvm_tx_skb(mvm, skb, sta)) in iwl_mvm_mac_tx()
748 if (iwl_mvm_tx_skb_non_sta(mvm, skb)) in iwl_mvm_mac_tx()
781 iwl_mvm_ampdu_check_trigger(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_ampdu_check_trigger() argument
788 if (!iwl_fw_dbg_trigger_enabled(mvm->fw, FW_DBG_TRIGGER_BA)) in iwl_mvm_ampdu_check_trigger()
791 trig = iwl_fw_dbg_get_trigger(mvm->fw, FW_DBG_TRIGGER_BA); in iwl_mvm_ampdu_check_trigger()
794 if (!iwl_fw_dbg_trigger_check_stop(mvm, vif, trig)) in iwl_mvm_ampdu_check_trigger()
802 CHECK_BA_TRIGGER(mvm, trig, ba_trig->tx_ba_start, tid, in iwl_mvm_ampdu_check_trigger()
808 CHECK_BA_TRIGGER(mvm, trig, ba_trig->tx_ba_stop, tid, in iwl_mvm_ampdu_check_trigger()
813 CHECK_BA_TRIGGER(mvm, trig, ba_trig->rx_ba_start, tid, in iwl_mvm_ampdu_check_trigger()
818 CHECK_BA_TRIGGER(mvm, trig, ba_trig->rx_ba_stop, tid, in iwl_mvm_ampdu_check_trigger()
833 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_ampdu_action() local
837 IWL_DEBUG_HT(mvm, "A-MPDU action on addr %pM tid %d: action %d\n", in iwl_mvm_mac_ampdu_action()
840 if (!(mvm->nvm_data->sku_cap_11n_enable)) in iwl_mvm_mac_ampdu_action()
858 ret = iwl_mvm_ref_sync(mvm, IWL_MVM_REF_TX_AGG); in iwl_mvm_mac_ampdu_action()
868 mutex_lock(&mvm->mutex); in iwl_mvm_mac_ampdu_action()
872 if (!iwl_enable_rx_ampdu(mvm->cfg)) { in iwl_mvm_mac_ampdu_action()
876 ret = iwl_mvm_sta_rx_agg(mvm, sta, tid, *ssn, true); in iwl_mvm_mac_ampdu_action()
879 ret = iwl_mvm_sta_rx_agg(mvm, sta, tid, 0, false); in iwl_mvm_mac_ampdu_action()
882 if (!iwl_enable_tx_ampdu(mvm->cfg)) { in iwl_mvm_mac_ampdu_action()
886 ret = iwl_mvm_sta_tx_agg_start(mvm, vif, sta, tid, ssn); in iwl_mvm_mac_ampdu_action()
889 ret = iwl_mvm_sta_tx_agg_stop(mvm, vif, sta, tid); in iwl_mvm_mac_ampdu_action()
893 ret = iwl_mvm_sta_tx_agg_flush(mvm, vif, sta, tid); in iwl_mvm_mac_ampdu_action()
896 ret = iwl_mvm_sta_tx_agg_oper(mvm, vif, sta, tid, buf_size); in iwl_mvm_mac_ampdu_action()
910 iwl_mvm_ampdu_check_trigger(mvm, vif, sta, tid, in iwl_mvm_mac_ampdu_action()
913 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_ampdu_action()
920 iwl_mvm_unref(mvm, IWL_MVM_REF_TX_AGG); in iwl_mvm_mac_ampdu_action()
928 struct iwl_mvm *mvm = data; in iwl_mvm_cleanup_iterator() local
934 spin_lock_bh(&mvm->time_event_lock); in iwl_mvm_cleanup_iterator()
935 iwl_mvm_te_clear_data(mvm, &mvmvif->time_event_data); in iwl_mvm_cleanup_iterator()
936 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_cleanup_iterator()
985 static void iwl_mvm_dump_fifos(struct iwl_mvm *mvm, in iwl_mvm_dump_fifos() argument
994 if (!iwl_trans_grab_nic_access(mvm->trans, false, &flags)) in iwl_mvm_dump_fifos()
998 for (i = 0; i < ARRAY_SIZE(mvm->shared_mem_cfg.rxfifo_size); i++) { in iwl_mvm_dump_fifos()
1007 fifo_len = mvm->shared_mem_cfg.rxfifo_size[i]; in iwl_mvm_dump_fifos()
1019 cpu_to_le32(iwl_trans_read_prph(mvm->trans, in iwl_mvm_dump_fifos()
1023 cpu_to_le32(iwl_trans_read_prph(mvm->trans, in iwl_mvm_dump_fifos()
1027 cpu_to_le32(iwl_trans_read_prph(mvm->trans, in iwl_mvm_dump_fifos()
1031 cpu_to_le32(iwl_trans_read_prph(mvm->trans, in iwl_mvm_dump_fifos()
1035 cpu_to_le32(iwl_trans_read_prph(mvm->trans, in iwl_mvm_dump_fifos()
1040 iwl_trans_write_prph(mvm->trans, in iwl_mvm_dump_fifos()
1043 iwl_trans_write_prph(mvm->trans, in iwl_mvm_dump_fifos()
1046 iwl_trans_write_prph(mvm->trans, in iwl_mvm_dump_fifos()
1053 fifo_data[j] = iwl_trans_read_prph(mvm->trans, in iwl_mvm_dump_fifos()
1060 for (i = 0; i < ARRAY_SIZE(mvm->shared_mem_cfg.txfifo_size); i++) { in iwl_mvm_dump_fifos()
1062 iwl_trans_write_prph(mvm->trans, TXF_LARC_NUM, i); in iwl_mvm_dump_fifos()
1066 fifo_len = mvm->shared_mem_cfg.txfifo_size[i]; in iwl_mvm_dump_fifos()
1078 cpu_to_le32(iwl_trans_read_prph(mvm->trans, in iwl_mvm_dump_fifos()
1081 cpu_to_le32(iwl_trans_read_prph(mvm->trans, in iwl_mvm_dump_fifos()
1084 cpu_to_le32(iwl_trans_read_prph(mvm->trans, in iwl_mvm_dump_fifos()
1087 cpu_to_le32(iwl_trans_read_prph(mvm->trans, in iwl_mvm_dump_fifos()
1090 cpu_to_le32(iwl_trans_read_prph(mvm->trans, in iwl_mvm_dump_fifos()
1094 iwl_trans_write_prph(mvm->trans, TXF_READ_MODIFY_ADDR, in iwl_mvm_dump_fifos()
1098 iwl_trans_read_prph(mvm->trans, TXF_READ_MODIFY_DATA); in iwl_mvm_dump_fifos()
1103 fifo_data[j] = iwl_trans_read_prph(mvm->trans, in iwl_mvm_dump_fifos()
1108 iwl_trans_release_nic_access(mvm->trans, &flags); in iwl_mvm_dump_fifos()
1111 void iwl_mvm_free_fw_dump_desc(struct iwl_mvm *mvm) in iwl_mvm_free_fw_dump_desc() argument
1113 if (mvm->fw_dump_desc == &iwl_mvm_dump_desc_assert || in iwl_mvm_free_fw_dump_desc()
1114 !mvm->fw_dump_desc) in iwl_mvm_free_fw_dump_desc()
1117 kfree(mvm->fw_dump_desc); in iwl_mvm_free_fw_dump_desc()
1118 mvm->fw_dump_desc = NULL; in iwl_mvm_free_fw_dump_desc()
1124 void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm) in iwl_mvm_fw_error_dump() argument
1134 u32 smem_len = mvm->cfg->smem_len; in iwl_mvm_fw_error_dump()
1135 u32 sram2_len = mvm->cfg->dccm2_len; in iwl_mvm_fw_error_dump()
1138 lockdep_assert_held(&mvm->mutex); in iwl_mvm_fw_error_dump()
1141 if (test_bit(STATUS_TRANS_DEAD, &mvm->trans->status)) { in iwl_mvm_fw_error_dump()
1142 IWL_ERR(mvm, "Skip fw error dump since bus is dead\n"); in iwl_mvm_fw_error_dump()
1146 if (mvm->fw_dump_trig && in iwl_mvm_fw_error_dump()
1147 mvm->fw_dump_trig->mode & IWL_FW_DBG_TRIGGER_MONITOR_ONLY) in iwl_mvm_fw_error_dump()
1155 if (!mvm->cfg->dccm_offset || !mvm->cfg->dccm_len) { in iwl_mvm_fw_error_dump()
1158 img = &mvm->fw->img[mvm->cur_ucode]; in iwl_mvm_fw_error_dump()
1162 sram_ofs = mvm->cfg->dccm_offset; in iwl_mvm_fw_error_dump()
1163 sram_len = mvm->cfg->dccm_len; in iwl_mvm_fw_error_dump()
1167 if (test_bit(STATUS_FW_ERROR, &mvm->trans->status)) { in iwl_mvm_fw_error_dump()
1168 struct iwl_mvm_shared_mem_cfg *mem_cfg = &mvm->shared_mem_cfg; in iwl_mvm_fw_error_dump()
1210 if (mvm->fw->img[mvm->cur_ucode].paging_mem_size) in iwl_mvm_fw_error_dump()
1211 file_len += mvm->num_of_paging_blk * in iwl_mvm_fw_error_dump()
1225 if (mvm->cfg->device_family == IWL_DEVICE_FAMILY_8000 && in iwl_mvm_fw_error_dump()
1226 CSR_HW_REV_STEP(mvm->trans->hw_rev) == SILICON_B_STEP) in iwl_mvm_fw_error_dump()
1230 if (mvm->fw_dump_desc) in iwl_mvm_fw_error_dump()
1232 mvm->fw_dump_desc->len; in iwl_mvm_fw_error_dump()
1237 iwl_mvm_free_fw_dump_desc(mvm); in iwl_mvm_fw_error_dump()
1250 mvm->cfg->device_family == IWL_DEVICE_FAMILY_7000 ? in iwl_mvm_fw_error_dump()
1253 dump_info->hw_step = cpu_to_le32(CSR_HW_REV_STEP(mvm->trans->hw_rev)); in iwl_mvm_fw_error_dump()
1254 memcpy(dump_info->fw_human_readable, mvm->fw->human_readable, in iwl_mvm_fw_error_dump()
1256 strncpy(dump_info->dev_human_readable, mvm->cfg->name, in iwl_mvm_fw_error_dump()
1258 strncpy(dump_info->bus_human_readable, mvm->dev->bus->name, in iwl_mvm_fw_error_dump()
1263 if (test_bit(STATUS_FW_ERROR, &mvm->trans->status)) in iwl_mvm_fw_error_dump()
1264 iwl_mvm_dump_fifos(mvm, &dump_data); in iwl_mvm_fw_error_dump()
1266 if (mvm->fw_dump_desc) { in iwl_mvm_fw_error_dump()
1269 mvm->fw_dump_desc->len); in iwl_mvm_fw_error_dump()
1271 memcpy(dump_trig, &mvm->fw_dump_desc->trig_desc, in iwl_mvm_fw_error_dump()
1272 sizeof(*dump_trig) + mvm->fw_dump_desc->len); in iwl_mvm_fw_error_dump()
1275 iwl_mvm_free_fw_dump_desc(mvm); in iwl_mvm_fw_error_dump()
1288 iwl_trans_read_mem_bytes(mvm->trans, sram_ofs, dump_mem->data, in iwl_mvm_fw_error_dump()
1297 dump_mem->offset = cpu_to_le32(mvm->cfg->smem_offset); in iwl_mvm_fw_error_dump()
1298 iwl_trans_read_mem_bytes(mvm->trans, mvm->cfg->smem_offset, in iwl_mvm_fw_error_dump()
1308 dump_mem->offset = cpu_to_le32(mvm->cfg->dccm2_offset); in iwl_mvm_fw_error_dump()
1309 iwl_trans_read_mem_bytes(mvm->trans, mvm->cfg->dccm2_offset, in iwl_mvm_fw_error_dump()
1313 if (mvm->cfg->device_family == IWL_DEVICE_FAMILY_8000 && in iwl_mvm_fw_error_dump()
1314 CSR_HW_REV_STEP(mvm->trans->hw_rev) == SILICON_B_STEP) { in iwl_mvm_fw_error_dump()
1322 iwl_trans_read_mem_bytes(mvm->trans, IWL8260_ICCM_OFFSET, in iwl_mvm_fw_error_dump()
1327 if (mvm->fw->img[mvm->cur_ucode].paging_mem_size) { in iwl_mvm_fw_error_dump()
1330 for (i = 1; i < mvm->num_of_paging_blk + 1; i++) { in iwl_mvm_fw_error_dump()
1333 mvm->fw_paging_db[i].fw_paging_block; in iwl_mvm_fw_error_dump()
1347 fw_error_dump->trans_ptr = iwl_trans_dump_data(mvm->trans, in iwl_mvm_fw_error_dump()
1348 mvm->fw_dump_trig); in iwl_mvm_fw_error_dump()
1354 dev_coredumpm(mvm->trans->dev, THIS_MODULE, fw_error_dump, 0, in iwl_mvm_fw_error_dump()
1357 mvm->fw_dump_trig = NULL; in iwl_mvm_fw_error_dump()
1358 clear_bit(IWL_MVM_STATUS_DUMPING_FW_LOG, &mvm->status); in iwl_mvm_fw_error_dump()
1367 static void iwl_mvm_restart_cleanup(struct iwl_mvm *mvm) in iwl_mvm_restart_cleanup() argument
1373 if (!test_and_clear_bit(IWL_MVM_STATUS_D3_RECONFIG, &mvm->status)) { in iwl_mvm_restart_cleanup()
1374 mvm->fw_dump_desc = &iwl_mvm_dump_desc_assert; in iwl_mvm_restart_cleanup()
1375 iwl_mvm_fw_error_dump(mvm); in iwl_mvm_restart_cleanup()
1381 iwl_mvm_unref_all_except(mvm, IWL_MVM_REF_UCODE_DOWN); in iwl_mvm_restart_cleanup()
1383 iwl_trans_stop_device(mvm->trans); in iwl_mvm_restart_cleanup()
1385 mvm->scan_status = 0; in iwl_mvm_restart_cleanup()
1386 mvm->ps_disabled = false; in iwl_mvm_restart_cleanup()
1387 mvm->calibrating = false; in iwl_mvm_restart_cleanup()
1390 ieee80211_remain_on_channel_expired(mvm->hw); in iwl_mvm_restart_cleanup()
1396 ieee80211_iterate_interfaces(mvm->hw, 0, iwl_mvm_cleanup_iterator, mvm); in iwl_mvm_restart_cleanup()
1398 mvm->p2p_device_vif = NULL; in iwl_mvm_restart_cleanup()
1399 mvm->d0i3_ap_sta_id = IWL_MVM_STATION_COUNT; in iwl_mvm_restart_cleanup()
1401 iwl_mvm_reset_phy_ctxts(mvm); in iwl_mvm_restart_cleanup()
1402 memset(mvm->sta_drained, 0, sizeof(mvm->sta_drained)); in iwl_mvm_restart_cleanup()
1403 memset(mvm->tfd_drained, 0, sizeof(mvm->tfd_drained)); in iwl_mvm_restart_cleanup()
1404 memset(&mvm->last_bt_notif, 0, sizeof(mvm->last_bt_notif)); in iwl_mvm_restart_cleanup()
1405 memset(&mvm->last_bt_notif_old, 0, sizeof(mvm->last_bt_notif_old)); in iwl_mvm_restart_cleanup()
1406 memset(&mvm->last_bt_ci_cmd, 0, sizeof(mvm->last_bt_ci_cmd)); in iwl_mvm_restart_cleanup()
1407 memset(&mvm->last_bt_ci_cmd_old, 0, sizeof(mvm->last_bt_ci_cmd_old)); in iwl_mvm_restart_cleanup()
1408 memset(&mvm->bt_ack_kill_msk, 0, sizeof(mvm->bt_ack_kill_msk)); in iwl_mvm_restart_cleanup()
1409 memset(&mvm->bt_cts_kill_msk, 0, sizeof(mvm->bt_cts_kill_msk)); in iwl_mvm_restart_cleanup()
1411 ieee80211_wake_queues(mvm->hw); in iwl_mvm_restart_cleanup()
1414 clear_bit(IWL_MVM_STATUS_IN_D0I3, &mvm->status); in iwl_mvm_restart_cleanup()
1416 mvm->vif_count = 0; in iwl_mvm_restart_cleanup()
1417 mvm->rx_ba_sessions = 0; in iwl_mvm_restart_cleanup()
1418 mvm->fw_dbg_conf = FW_DBG_INVALID; in iwl_mvm_restart_cleanup()
1421 iwl_mvm_accu_radio_stats(mvm); in iwl_mvm_restart_cleanup()
1424 int __iwl_mvm_mac_start(struct iwl_mvm *mvm) in __iwl_mvm_mac_start() argument
1428 lockdep_assert_held(&mvm->mutex); in __iwl_mvm_mac_start()
1431 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) in __iwl_mvm_mac_start()
1432 iwl_mvm_restart_cleanup(mvm); in __iwl_mvm_mac_start()
1434 ret = iwl_mvm_up(mvm); in __iwl_mvm_mac_start()
1436 if (ret && test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { in __iwl_mvm_mac_start()
1441 clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status); in __iwl_mvm_mac_start()
1442 iwl_mvm_d0i3_enable_tx(mvm, NULL); in __iwl_mvm_mac_start()
1450 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_start() local
1454 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { in iwl_mvm_mac_start()
1460 wait_event_timeout(mvm->d0i3_exit_waitq, in iwl_mvm_mac_start()
1462 &mvm->status), in iwl_mvm_mac_start()
1466 mutex_lock(&mvm->mutex); in iwl_mvm_mac_start()
1467 ret = __iwl_mvm_mac_start(mvm); in iwl_mvm_mac_start()
1468 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_start()
1473 static void iwl_mvm_restart_complete(struct iwl_mvm *mvm) in iwl_mvm_restart_complete() argument
1477 mutex_lock(&mvm->mutex); in iwl_mvm_restart_complete()
1479 clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status); in iwl_mvm_restart_complete()
1480 iwl_mvm_d0i3_enable_tx(mvm, NULL); in iwl_mvm_restart_complete()
1481 ret = iwl_mvm_update_quotas(mvm, true, NULL); in iwl_mvm_restart_complete()
1483 IWL_ERR(mvm, "Failed to update quotas after restart (%d)\n", in iwl_mvm_restart_complete()
1487 iwl_mvm_unref(mvm, IWL_MVM_REF_UCODE_DOWN); in iwl_mvm_restart_complete()
1493 iwl_mvm_teardown_tdls_peers(mvm); in iwl_mvm_restart_complete()
1495 mutex_unlock(&mvm->mutex); in iwl_mvm_restart_complete()
1498 static void iwl_mvm_resume_complete(struct iwl_mvm *mvm) in iwl_mvm_resume_complete() argument
1500 if (!iwl_mvm_is_d0i3_supported(mvm)) in iwl_mvm_resume_complete()
1503 if (mvm->trans->d0i3_mode == IWL_D0I3_MODE_ON_SUSPEND) in iwl_mvm_resume_complete()
1504 if (!wait_event_timeout(mvm->d0i3_exit_waitq, in iwl_mvm_resume_complete()
1506 &mvm->status), in iwl_mvm_resume_complete()
1515 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_reconfig_complete() local
1519 iwl_mvm_restart_complete(mvm); in iwl_mvm_mac_reconfig_complete()
1522 iwl_mvm_resume_complete(mvm); in iwl_mvm_mac_reconfig_complete()
1527 void __iwl_mvm_mac_stop(struct iwl_mvm *mvm) in __iwl_mvm_mac_stop() argument
1529 lockdep_assert_held(&mvm->mutex); in __iwl_mvm_mac_stop()
1534 memset(&mvm->accu_radio_stats, 0, sizeof(mvm->accu_radio_stats)); in __iwl_mvm_mac_stop()
1541 if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) in __iwl_mvm_mac_stop()
1542 iwl_mvm_ref(mvm, IWL_MVM_REF_UCODE_DOWN); in __iwl_mvm_mac_stop()
1550 flush_work(&mvm->roc_done_wk); in __iwl_mvm_mac_stop()
1552 iwl_trans_stop_device(mvm->trans); in __iwl_mvm_mac_stop()
1554 iwl_mvm_async_handlers_purge(mvm); in __iwl_mvm_mac_stop()
1558 iwl_mvm_del_aux_sta(mvm); in __iwl_mvm_mac_stop()
1560 iwl_free_fw_paging(mvm); in __iwl_mvm_mac_stop()
1568 if (test_and_clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) in __iwl_mvm_mac_stop()
1569 ieee80211_iterate_interfaces(mvm->hw, 0, in __iwl_mvm_mac_stop()
1570 iwl_mvm_cleanup_iterator, mvm); in __iwl_mvm_mac_stop()
1575 if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_UMAC_SCAN)) { in __iwl_mvm_mac_stop()
1578 for (i = 0; i < mvm->max_scans; i++) { in __iwl_mvm_mac_stop()
1579 if (WARN_ONCE(mvm->scan_uid_status[i], in __iwl_mvm_mac_stop()
1582 mvm->scan_uid_status[i] = 0; in __iwl_mvm_mac_stop()
1586 mvm->ucode_loaded = false; in __iwl_mvm_mac_stop()
1591 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_stop() local
1593 flush_work(&mvm->d0i3_exit_work); in iwl_mvm_mac_stop()
1594 flush_work(&mvm->async_handlers_wk); in iwl_mvm_mac_stop()
1595 cancel_delayed_work_sync(&mvm->fw_dump_wk); in iwl_mvm_mac_stop()
1596 iwl_mvm_free_fw_dump_desc(mvm); in iwl_mvm_mac_stop()
1598 mutex_lock(&mvm->mutex); in iwl_mvm_mac_stop()
1599 __iwl_mvm_mac_stop(mvm); in iwl_mvm_mac_stop()
1600 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_stop()
1606 cancel_work_sync(&mvm->async_handlers_wk); in iwl_mvm_mac_stop()
1609 static struct iwl_mvm_phy_ctxt *iwl_mvm_get_free_phy_ctxt(struct iwl_mvm *mvm) in iwl_mvm_get_free_phy_ctxt() argument
1613 lockdep_assert_held(&mvm->mutex); in iwl_mvm_get_free_phy_ctxt()
1616 if (!mvm->phy_ctxts[i].ref) in iwl_mvm_get_free_phy_ctxt()
1617 return &mvm->phy_ctxts[i]; in iwl_mvm_get_free_phy_ctxt()
1619 IWL_ERR(mvm, "No available PHY context\n"); in iwl_mvm_get_free_phy_ctxt()
1623 static int iwl_mvm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_set_tx_power() argument
1637 if (!fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_TX_POWER_CHAIN)) in iwl_mvm_set_tx_power()
1640 return iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0, len, &cmd); in iwl_mvm_set_tx_power()
1646 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_add_interface() local
1650 mvmvif->mvm = mvm; in iwl_mvm_mac_add_interface()
1657 ret = iwl_mvm_ref_sync(mvm, IWL_MVM_REF_ADD_IF); in iwl_mvm_mac_add_interface()
1667 mutex_lock(&mvm->mutex); in iwl_mvm_mac_add_interface()
1670 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) in iwl_mvm_mac_add_interface()
1675 ret = iwl_mvm_mac_ctxt_init(mvm, vif); in iwl_mvm_mac_add_interface()
1681 mvm->vif_count++; in iwl_mvm_mac_add_interface()
1696 ret = iwl_mvm_alloc_bcast_sta(mvm, vif); in iwl_mvm_mac_add_interface()
1698 IWL_ERR(mvm, "Failed to allocate bcast sta\n"); in iwl_mvm_mac_add_interface()
1702 iwl_mvm_vif_dbgfs_register(mvm, vif); in iwl_mvm_mac_add_interface()
1708 ret = iwl_mvm_mac_ctxt_add(mvm, vif); in iwl_mvm_mac_add_interface()
1712 ret = iwl_mvm_power_update_mac(mvm); in iwl_mvm_mac_add_interface()
1717 ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0); in iwl_mvm_mac_add_interface()
1721 if (!mvm->bf_allowed_vif && in iwl_mvm_mac_add_interface()
1723 mvm->bf_allowed_vif = mvmvif; in iwl_mvm_mac_add_interface()
1735 mvmvif->phy_ctxt = iwl_mvm_get_free_phy_ctxt(mvm); in iwl_mvm_mac_add_interface()
1741 iwl_mvm_phy_ctxt_ref(mvm, mvmvif->phy_ctxt); in iwl_mvm_mac_add_interface()
1742 ret = iwl_mvm_binding_add_vif(mvm, vif); in iwl_mvm_mac_add_interface()
1746 ret = iwl_mvm_add_bcast_sta(mvm, vif); in iwl_mvm_mac_add_interface()
1752 mvm->p2p_device_vif = vif; in iwl_mvm_mac_add_interface()
1755 iwl_mvm_vif_dbgfs_register(mvm, vif); in iwl_mvm_mac_add_interface()
1759 iwl_mvm_binding_remove_vif(mvm, vif); in iwl_mvm_mac_add_interface()
1761 iwl_mvm_phy_ctxt_unref(mvm, mvmvif->phy_ctxt); in iwl_mvm_mac_add_interface()
1763 if (mvm->bf_allowed_vif == mvmvif) { in iwl_mvm_mac_add_interface()
1764 mvm->bf_allowed_vif = NULL; in iwl_mvm_mac_add_interface()
1770 iwl_mvm_mac_ctxt_remove(mvm, vif); in iwl_mvm_mac_add_interface()
1773 mvm->vif_count--; in iwl_mvm_mac_add_interface()
1775 iwl_mvm_mac_ctxt_release(mvm, vif); in iwl_mvm_mac_add_interface()
1777 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_add_interface()
1779 iwl_mvm_unref(mvm, IWL_MVM_REF_ADD_IF); in iwl_mvm_mac_add_interface()
1784 static void iwl_mvm_prepare_mac_removal(struct iwl_mvm *mvm, in iwl_mvm_prepare_mac_removal() argument
1799 mutex_lock(&mvm->mutex); in iwl_mvm_prepare_mac_removal()
1800 iwl_mvm_flush_tx_path(mvm, tfd_msk, 0); in iwl_mvm_prepare_mac_removal()
1801 mutex_unlock(&mvm->mutex); in iwl_mvm_prepare_mac_removal()
1816 iwl_trans_wait_tx_queue_empty(mvm->trans, tfd_msk); in iwl_mvm_prepare_mac_removal()
1825 flush_work(&mvm->roc_done_wk); in iwl_mvm_prepare_mac_removal()
1833 flush_work(&mvm->sta_drained_wk); in iwl_mvm_prepare_mac_removal()
1840 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_remove_interface() local
1843 iwl_mvm_prepare_mac_removal(mvm, vif); in iwl_mvm_mac_remove_interface()
1845 mutex_lock(&mvm->mutex); in iwl_mvm_mac_remove_interface()
1847 if (mvm->bf_allowed_vif == mvmvif) { in iwl_mvm_mac_remove_interface()
1848 mvm->bf_allowed_vif = NULL; in iwl_mvm_mac_remove_interface()
1853 iwl_mvm_vif_dbgfs_clean(mvm, vif); in iwl_mvm_mac_remove_interface()
1862 if (vif == mvm->noa_vif) { in iwl_mvm_mac_remove_interface()
1863 mvm->noa_vif = NULL; in iwl_mvm_mac_remove_interface()
1864 mvm->noa_duration = 0; in iwl_mvm_mac_remove_interface()
1867 iwl_mvm_dealloc_bcast_sta(mvm, vif); in iwl_mvm_mac_remove_interface()
1872 mvm->p2p_device_vif = NULL; in iwl_mvm_mac_remove_interface()
1873 iwl_mvm_rm_bcast_sta(mvm, vif); in iwl_mvm_mac_remove_interface()
1874 iwl_mvm_binding_remove_vif(mvm, vif); in iwl_mvm_mac_remove_interface()
1875 iwl_mvm_phy_ctxt_unref(mvm, mvmvif->phy_ctxt); in iwl_mvm_mac_remove_interface()
1879 if (mvm->vif_count && vif->type != NL80211_IFTYPE_P2P_DEVICE) in iwl_mvm_mac_remove_interface()
1880 mvm->vif_count--; in iwl_mvm_mac_remove_interface()
1882 iwl_mvm_power_update_mac(mvm); in iwl_mvm_mac_remove_interface()
1883 iwl_mvm_mac_ctxt_remove(mvm, vif); in iwl_mvm_mac_remove_interface()
1886 iwl_mvm_mac_ctxt_release(mvm, vif); in iwl_mvm_mac_remove_interface()
1887 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_remove_interface()
1896 struct iwl_mvm *mvm; member
1904 struct iwl_mvm *mvm = data->mvm; in iwl_mvm_mc_iface_iterator() local
1905 struct iwl_mcast_filter_cmd *cmd = mvm->mcast_filter_cmd; in iwl_mvm_mc_iface_iterator()
1920 ret = iwl_mvm_send_cmd_pdu(mvm, MCAST_FILTER_CMD, CMD_ASYNC, len, cmd); in iwl_mvm_mc_iface_iterator()
1922 IWL_ERR(mvm, "mcast filter cmd error. ret=%d\n", ret); in iwl_mvm_mc_iface_iterator()
1925 static void iwl_mvm_recalc_multicast(struct iwl_mvm *mvm) in iwl_mvm_recalc_multicast() argument
1928 .mvm = mvm, in iwl_mvm_recalc_multicast()
1931 lockdep_assert_held(&mvm->mutex); in iwl_mvm_recalc_multicast()
1933 if (WARN_ON_ONCE(!mvm->mcast_filter_cmd)) in iwl_mvm_recalc_multicast()
1937 mvm->hw, IEEE80211_IFACE_ITER_NORMAL, in iwl_mvm_recalc_multicast()
1944 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_prepare_multicast() local
1968 IWL_DEBUG_MAC80211(mvm, "mcast addr (%d): %pM\n", in iwl_mvm_prepare_multicast()
1983 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_configure_filter() local
1986 mutex_lock(&mvm->mutex); in iwl_mvm_configure_filter()
1989 kfree(mvm->mcast_filter_cmd); in iwl_mvm_configure_filter()
1990 mvm->mcast_filter_cmd = cmd; in iwl_mvm_configure_filter()
1995 iwl_mvm_recalc_multicast(mvm); in iwl_mvm_configure_filter()
1997 mutex_unlock(&mvm->mutex); in iwl_mvm_configure_filter()
2006 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_config_iface_filter() local
2017 mutex_lock(&mvm->mutex); in iwl_mvm_config_iface_filter()
2018 iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); in iwl_mvm_config_iface_filter()
2019 mutex_unlock(&mvm->mutex); in iwl_mvm_config_iface_filter()
2024 struct iwl_mvm *mvm; member
2069 struct iwl_mvm *mvm = data->mvm; in iwl_mvm_bcast_filter_iterator() local
2091 for (i = 0; mvm->bcast_filters[i].attrs[0].mask; i++) { in iwl_mvm_bcast_filter_iterator()
2105 &mvm->bcast_filters[i], in iwl_mvm_bcast_filter_iterator()
2120 bool iwl_mvm_bcast_filter_build_cmd(struct iwl_mvm *mvm, in iwl_mvm_bcast_filter_build_cmd() argument
2124 .mvm = mvm, in iwl_mvm_bcast_filter_build_cmd()
2137 if (mvm->dbgfs_bcast_filtering.override) { in iwl_mvm_bcast_filter_build_cmd()
2138 memcpy(cmd->filters, &mvm->dbgfs_bcast_filtering.cmd.filters, in iwl_mvm_bcast_filter_build_cmd()
2140 memcpy(cmd->macs, &mvm->dbgfs_bcast_filtering.cmd.macs, in iwl_mvm_bcast_filter_build_cmd()
2147 if (!mvm->bcast_filters) in iwl_mvm_bcast_filter_build_cmd()
2152 mvm->hw, IEEE80211_IFACE_ITER_NORMAL, in iwl_mvm_bcast_filter_build_cmd()
2157 static int iwl_mvm_configure_bcast_filter(struct iwl_mvm *mvm, in iwl_mvm_configure_bcast_filter() argument
2162 if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_BCAST_FILTERING)) in iwl_mvm_configure_bcast_filter()
2165 if (!iwl_mvm_bcast_filter_build_cmd(mvm, &cmd)) in iwl_mvm_configure_bcast_filter()
2168 return iwl_mvm_send_cmd_pdu(mvm, BCAST_FILTER_CMD, 0, in iwl_mvm_configure_bcast_filter()
2172 static inline int iwl_mvm_configure_bcast_filter(struct iwl_mvm *mvm, in iwl_mvm_configure_bcast_filter() argument
2179 static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm, in iwl_mvm_bss_info_changed_station() argument
2193 iwl_mvm_mac_ctxt_recalc_tsf_id(mvm, vif); in iwl_mvm_bss_info_changed_station()
2204 ret = iwl_mvm_mac_ctxt_changed(mvm, vif, false, mvmvif->bssid); in iwl_mvm_bss_info_changed_station()
2206 IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr); in iwl_mvm_bss_info_changed_station()
2215 iwl_mvm_request_statistics(mvm, true); in iwl_mvm_bss_info_changed_station()
2220 ret = iwl_mvm_update_quotas(mvm, true, NULL); in iwl_mvm_bss_info_changed_station()
2222 IWL_ERR(mvm, "failed to update quotas\n"); in iwl_mvm_bss_info_changed_station()
2227 &mvm->status)) { in iwl_mvm_bss_info_changed_station()
2243 iwl_mvm_protect_session(mvm, vif, dur, dur, in iwl_mvm_bss_info_changed_station()
2247 iwl_mvm_sf_update(mvm, vif, false); in iwl_mvm_bss_info_changed_station()
2248 iwl_mvm_power_vif_assoc(mvm, vif); in iwl_mvm_bss_info_changed_station()
2250 iwl_mvm_ref(mvm, IWL_MVM_REF_P2P_CLIENT); in iwl_mvm_bss_info_changed_station()
2251 iwl_mvm_update_smps(mvm, vif, in iwl_mvm_bss_info_changed_station()
2260 WARN_ONCE(iwl_mvm_sf_update(mvm, vif, false), in iwl_mvm_bss_info_changed_station()
2264 ret = iwl_mvm_rm_sta_id(mvm, vif, mvmvif->ap_sta_id); in iwl_mvm_bss_info_changed_station()
2266 IWL_ERR(mvm, "failed to remove AP station\n"); in iwl_mvm_bss_info_changed_station()
2268 if (mvm->d0i3_ap_sta_id == mvmvif->ap_sta_id) in iwl_mvm_bss_info_changed_station()
2269 mvm->d0i3_ap_sta_id = IWL_MVM_STATION_COUNT; in iwl_mvm_bss_info_changed_station()
2272 ret = iwl_mvm_update_quotas(mvm, false, NULL); in iwl_mvm_bss_info_changed_station()
2274 IWL_ERR(mvm, "failed to update quotas\n"); in iwl_mvm_bss_info_changed_station()
2277 iwl_mvm_unref(mvm, IWL_MVM_REF_P2P_CLIENT); in iwl_mvm_bss_info_changed_station()
2280 ret = iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); in iwl_mvm_bss_info_changed_station()
2282 IWL_ERR(mvm, in iwl_mvm_bss_info_changed_station()
2287 iwl_mvm_recalc_multicast(mvm); in iwl_mvm_bss_info_changed_station()
2288 iwl_mvm_configure_bcast_filter(mvm, vif); in iwl_mvm_bss_info_changed_station()
2293 iwl_mvm_bt_coex_vif_change(mvm); in iwl_mvm_bss_info_changed_station()
2294 iwl_mvm_update_smps(mvm, vif, IWL_MVM_SMPS_REQ_TT, in iwl_mvm_bss_info_changed_station()
2301 iwl_mvm_remove_time_event(mvm, mvmvif, in iwl_mvm_bss_info_changed_station()
2306 iwl_mvm_sf_update(mvm, vif, false); in iwl_mvm_bss_info_changed_station()
2307 WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif, 0)); in iwl_mvm_bss_info_changed_station()
2311 ret = iwl_mvm_power_update_mac(mvm); in iwl_mvm_bss_info_changed_station()
2313 IWL_ERR(mvm, "failed to update power mode\n"); in iwl_mvm_bss_info_changed_station()
2317 IWL_DEBUG_CALIB(mvm, "Changing TX Power to %d\n", in iwl_mvm_bss_info_changed_station()
2319 iwl_mvm_set_tx_power(mvm, vif, bss_conf->txpower); in iwl_mvm_bss_info_changed_station()
2323 IWL_DEBUG_MAC80211(mvm, "cqm info_changed\n"); in iwl_mvm_bss_info_changed_station()
2327 ret = iwl_mvm_enable_beacon_filter(mvm, vif, 0); in iwl_mvm_bss_info_changed_station()
2329 IWL_ERR(mvm, in iwl_mvm_bss_info_changed_station()
2335 IWL_DEBUG_MAC80211(mvm, "arp filter changed\n"); in iwl_mvm_bss_info_changed_station()
2336 iwl_mvm_configure_bcast_filter(mvm, vif); in iwl_mvm_bss_info_changed_station()
2343 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_start_ap_ibss() local
2351 ret = iwl_mvm_ref_sync(mvm, IWL_MVM_REF_START_AP); in iwl_mvm_start_ap_ibss()
2355 mutex_lock(&mvm->mutex); in iwl_mvm_start_ap_ibss()
2358 ret = iwl_mvm_mac_ctxt_beacon_changed(mvm, vif); in iwl_mvm_start_ap_ibss()
2367 iwl_mvm_mac_ctxt_recalc_tsf_id(mvm, vif); in iwl_mvm_start_ap_ibss()
2372 ret = iwl_mvm_mac_ctxt_add(mvm, vif); in iwl_mvm_start_ap_ibss()
2377 ret = iwl_mvm_binding_add_vif(mvm, vif); in iwl_mvm_start_ap_ibss()
2383 ret = iwl_mvm_send_add_bcast_sta(mvm, vif); in iwl_mvm_start_ap_ibss()
2391 iwl_mvm_power_update_mac(mvm); in iwl_mvm_start_ap_ibss()
2393 ret = iwl_mvm_update_quotas(mvm, false, NULL); in iwl_mvm_start_ap_ibss()
2398 if (vif->p2p && mvm->p2p_device_vif) in iwl_mvm_start_ap_ibss()
2399 iwl_mvm_mac_ctxt_changed(mvm, mvm->p2p_device_vif, false, NULL); in iwl_mvm_start_ap_ibss()
2401 iwl_mvm_ref(mvm, IWL_MVM_REF_AP_IBSS); in iwl_mvm_start_ap_ibss()
2403 iwl_mvm_bt_coex_vif_change(mvm); in iwl_mvm_start_ap_ibss()
2406 if (iwl_mvm_phy_ctx_count(mvm) > 1) in iwl_mvm_start_ap_ibss()
2407 iwl_mvm_teardown_tdls_peers(mvm); in iwl_mvm_start_ap_ibss()
2412 iwl_mvm_power_update_mac(mvm); in iwl_mvm_start_ap_ibss()
2414 iwl_mvm_send_rm_bcast_sta(mvm, vif); in iwl_mvm_start_ap_ibss()
2416 iwl_mvm_binding_remove_vif(mvm, vif); in iwl_mvm_start_ap_ibss()
2418 iwl_mvm_mac_ctxt_remove(mvm, vif); in iwl_mvm_start_ap_ibss()
2420 mutex_unlock(&mvm->mutex); in iwl_mvm_start_ap_ibss()
2421 iwl_mvm_unref(mvm, IWL_MVM_REF_START_AP); in iwl_mvm_start_ap_ibss()
2428 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_stop_ap_ibss() local
2431 iwl_mvm_prepare_mac_removal(mvm, vif); in iwl_mvm_stop_ap_ibss()
2433 mutex_lock(&mvm->mutex); in iwl_mvm_stop_ap_ibss()
2436 if (rcu_access_pointer(mvm->csa_vif) == vif) { in iwl_mvm_stop_ap_ibss()
2437 iwl_mvm_remove_time_event(mvm, mvmvif, in iwl_mvm_stop_ap_ibss()
2439 RCU_INIT_POINTER(mvm->csa_vif, NULL); in iwl_mvm_stop_ap_ibss()
2443 if (rcu_access_pointer(mvm->csa_tx_blocked_vif) == vif) { in iwl_mvm_stop_ap_ibss()
2444 RCU_INIT_POINTER(mvm->csa_tx_blocked_vif, NULL); in iwl_mvm_stop_ap_ibss()
2445 mvm->csa_tx_block_bcn_timeout = 0; in iwl_mvm_stop_ap_ibss()
2449 mvm->ap_last_beacon_gp2 = 0; in iwl_mvm_stop_ap_ibss()
2451 iwl_mvm_bt_coex_vif_change(mvm); in iwl_mvm_stop_ap_ibss()
2453 iwl_mvm_unref(mvm, IWL_MVM_REF_AP_IBSS); in iwl_mvm_stop_ap_ibss()
2456 if (vif->p2p && mvm->p2p_device_vif) in iwl_mvm_stop_ap_ibss()
2457 iwl_mvm_mac_ctxt_changed(mvm, mvm->p2p_device_vif, false, NULL); in iwl_mvm_stop_ap_ibss()
2459 iwl_mvm_update_quotas(mvm, false, NULL); in iwl_mvm_stop_ap_ibss()
2460 iwl_mvm_send_rm_bcast_sta(mvm, vif); in iwl_mvm_stop_ap_ibss()
2461 iwl_mvm_binding_remove_vif(mvm, vif); in iwl_mvm_stop_ap_ibss()
2463 iwl_mvm_power_update_mac(mvm); in iwl_mvm_stop_ap_ibss()
2465 iwl_mvm_mac_ctxt_remove(mvm, vif); in iwl_mvm_stop_ap_ibss()
2467 mutex_unlock(&mvm->mutex); in iwl_mvm_stop_ap_ibss()
2471 iwl_mvm_bss_info_changed_ap_ibss(struct iwl_mvm *mvm, in iwl_mvm_bss_info_changed_ap_ibss() argument
2484 iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL)) in iwl_mvm_bss_info_changed_ap_ibss()
2485 IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr); in iwl_mvm_bss_info_changed_ap_ibss()
2489 iwl_mvm_mac_ctxt_beacon_changed(mvm, vif)) in iwl_mvm_bss_info_changed_ap_ibss()
2490 IWL_WARN(mvm, "Failed updating beacon data\n"); in iwl_mvm_bss_info_changed_ap_ibss()
2493 IWL_DEBUG_CALIB(mvm, "Changing TX Power to %d\n", in iwl_mvm_bss_info_changed_ap_ibss()
2495 iwl_mvm_set_tx_power(mvm, vif, bss_conf->txpower); in iwl_mvm_bss_info_changed_ap_ibss()
2505 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_bss_info_changed() local
2512 if (iwl_mvm_ref_sync(mvm, IWL_MVM_REF_BSS_CHANGED)) in iwl_mvm_bss_info_changed()
2515 mutex_lock(&mvm->mutex); in iwl_mvm_bss_info_changed()
2518 iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_SCHED, true); in iwl_mvm_bss_info_changed()
2522 iwl_mvm_bss_info_changed_station(mvm, vif, bss_conf, changes); in iwl_mvm_bss_info_changed()
2526 iwl_mvm_bss_info_changed_ap_ibss(mvm, vif, bss_conf, changes); in iwl_mvm_bss_info_changed()
2533 mutex_unlock(&mvm->mutex); in iwl_mvm_bss_info_changed()
2534 iwl_mvm_unref(mvm, IWL_MVM_REF_BSS_CHANGED); in iwl_mvm_bss_info_changed()
2541 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_hw_scan() local
2545 hw_req->req.n_channels > mvm->fw->ucode_capa.n_scan_channels) in iwl_mvm_mac_hw_scan()
2548 mutex_lock(&mvm->mutex); in iwl_mvm_mac_hw_scan()
2549 ret = iwl_mvm_reg_scan_start(mvm, vif, &hw_req->req, &hw_req->ies); in iwl_mvm_mac_hw_scan()
2550 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_hw_scan()
2558 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_cancel_hw_scan() local
2560 mutex_lock(&mvm->mutex); in iwl_mvm_mac_cancel_hw_scan()
2569 if (mvm->scan_status & IWL_MVM_SCAN_REGULAR) in iwl_mvm_mac_cancel_hw_scan()
2570 iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_REGULAR, true); in iwl_mvm_mac_cancel_hw_scan()
2572 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_cancel_hw_scan()
2582 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_allow_buffered_frames() local
2586 iwl_mvm_sta_modify_sleep_tx_count(mvm, sta, reason, num_frames, in iwl_mvm_mac_allow_buffered_frames()
2597 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_release_buffered_frames() local
2601 iwl_mvm_sta_modify_sleep_tx_count(mvm, sta, reason, num_frames, in iwl_mvm_mac_release_buffered_frames()
2610 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_sta_notify() local
2633 if (atomic_read(&mvm->pending_frames[mvmsta->sta_id]) > 0) in iwl_mvm_mac_sta_notify()
2640 iwl_trans_freeze_txq_timer(mvm->trans, txqs, true); in iwl_mvm_mac_sta_notify()
2652 iwl_trans_freeze_txq_timer(mvm->trans, txqs, false); in iwl_mvm_mac_sta_notify()
2653 iwl_mvm_sta_modify_ps_wake(mvm, sta); in iwl_mvm_mac_sta_notify()
2665 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_sta_pre_rcu_remove() local
2677 mutex_lock(&mvm->mutex); in iwl_mvm_sta_pre_rcu_remove()
2678 if (sta == rcu_access_pointer(mvm->fw_id_to_mac_id[mvm_sta->sta_id])) in iwl_mvm_sta_pre_rcu_remove()
2679 rcu_assign_pointer(mvm->fw_id_to_mac_id[mvm_sta->sta_id], in iwl_mvm_sta_pre_rcu_remove()
2684 iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); in iwl_mvm_sta_pre_rcu_remove()
2687 mutex_unlock(&mvm->mutex); in iwl_mvm_sta_pre_rcu_remove()
2690 static void iwl_mvm_check_uapsd(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_check_uapsd() argument
2693 if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_UAPSD_SUPPORT)) in iwl_mvm_check_uapsd()
2710 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_sta_state() local
2714 IWL_DEBUG_MAC80211(mvm, "station %pM state change %d->%d\n", in iwl_mvm_mac_sta_state()
2722 flush_work(&mvm->sta_drained_wk); in iwl_mvm_mac_sta_state()
2724 mutex_lock(&mvm->mutex); in iwl_mvm_mac_sta_state()
2736 IWL_ERR(mvm, in iwl_mvm_mac_sta_state()
2745 iwl_mvm_tdls_sta_count(mvm, NULL) == in iwl_mvm_mac_sta_state()
2747 iwl_mvm_phy_ctx_count(mvm) > 1)) { in iwl_mvm_mac_sta_state()
2748 IWL_DEBUG_MAC80211(mvm, "refusing TDLS sta\n"); in iwl_mvm_mac_sta_state()
2753 ret = iwl_mvm_add_sta(mvm, vif, sta); in iwl_mvm_mac_sta_state()
2755 iwl_mvm_recalc_tdls_state(mvm, vif, true); in iwl_mvm_mac_sta_state()
2762 mvm->last_ebs_successful = true; in iwl_mvm_mac_sta_state()
2763 iwl_mvm_check_uapsd(mvm, vif, sta->addr); in iwl_mvm_mac_sta_state()
2767 ret = iwl_mvm_update_sta(mvm, vif, sta); in iwl_mvm_mac_sta_state()
2769 iwl_mvm_rs_rate_init(mvm, sta, in iwl_mvm_mac_sta_state()
2776 if (iwl_mvm_phy_ctx_count(mvm) > 1) in iwl_mvm_mac_sta_state()
2777 iwl_mvm_teardown_tdls_peers(mvm); in iwl_mvm_mac_sta_state()
2780 WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif, 0)); in iwl_mvm_mac_sta_state()
2785 WARN_ON(iwl_mvm_disable_beacon_filter(mvm, vif, 0)); in iwl_mvm_mac_sta_state()
2795 ret = iwl_mvm_rm_sta(mvm, vif, sta); in iwl_mvm_mac_sta_state()
2797 iwl_mvm_recalc_tdls_state(mvm, vif, false); in iwl_mvm_mac_sta_state()
2802 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_sta_state()
2818 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_set_rts_threshold() local
2820 mvm->rts_threshold = value; in iwl_mvm_mac_set_rts_threshold()
2829 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_sta_rc_update() local
2833 iwl_mvm_sf_update(mvm, vif, false); in iwl_mvm_sta_rc_update()
2840 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_conf_tx() local
2852 mutex_lock(&mvm->mutex); in iwl_mvm_mac_conf_tx()
2853 ret = iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); in iwl_mvm_mac_conf_tx()
2854 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_conf_tx()
2863 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_mgd_prepare_tx() local
2876 if (iwl_mvm_ref_sync(mvm, IWL_MVM_REF_PREPARE_TX)) in iwl_mvm_mac_mgd_prepare_tx()
2879 mutex_lock(&mvm->mutex); in iwl_mvm_mac_mgd_prepare_tx()
2881 iwl_mvm_protect_session(mvm, vif, duration, min_duration, 500, false); in iwl_mvm_mac_mgd_prepare_tx()
2882 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_mgd_prepare_tx()
2884 iwl_mvm_unref(mvm, IWL_MVM_REF_PREPARE_TX); in iwl_mvm_mac_mgd_prepare_tx()
2892 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_sched_scan_start() local
2896 mutex_lock(&mvm->mutex); in iwl_mvm_mac_sched_scan_start()
2903 ret = iwl_mvm_sched_scan_start(mvm, vif, req, ies, IWL_MVM_SCAN_SCHED); in iwl_mvm_mac_sched_scan_start()
2906 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_sched_scan_start()
2913 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_sched_scan_stop() local
2916 mutex_lock(&mvm->mutex); in iwl_mvm_mac_sched_scan_stop()
2926 if (!(mvm->scan_status & IWL_MVM_SCAN_SCHED)) { in iwl_mvm_mac_sched_scan_stop()
2927 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_sched_scan_stop()
2931 ret = iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_SCHED, false); in iwl_mvm_mac_sched_scan_stop()
2932 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_sched_scan_stop()
2933 iwl_mvm_wait_for_async_handlers(mvm); in iwl_mvm_mac_sched_scan_stop()
2944 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_set_key() local
2949 IWL_DEBUG_MAC80211(mvm, "leave - hwcrypto disabled\n"); in iwl_mvm_mac_set_key()
2985 mutex_lock(&mvm->mutex); in iwl_mvm_mac_set_key()
3004 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) && in iwl_mvm_mac_set_key()
3006 IWL_DEBUG_MAC80211(mvm, in iwl_mvm_mac_set_key()
3013 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) in iwl_mvm_mac_set_key()
3018 IWL_DEBUG_MAC80211(mvm, "set hwcrypto key\n"); in iwl_mvm_mac_set_key()
3019 ret = iwl_mvm_set_sta_key(mvm, vif, sta, key, key_offset); in iwl_mvm_mac_set_key()
3021 IWL_WARN(mvm, "set key failed\n"); in iwl_mvm_mac_set_key()
3037 IWL_DEBUG_MAC80211(mvm, "disable hwcrypto key\n"); in iwl_mvm_mac_set_key()
3038 ret = iwl_mvm_remove_sta_key(mvm, vif, sta, key); in iwl_mvm_mac_set_key()
3044 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_set_key()
3054 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_update_tkip_key() local
3059 iwl_mvm_update_tkip_key(mvm, vif, keyconf, sta, iv32, phase1key); in iwl_mvm_mac_update_tkip_key()
3066 struct iwl_mvm *mvm = in iwl_mvm_rx_aux_roc() local
3076 IWL_ERR(mvm, "Invalid HOT_SPOT_CMD response\n"); in iwl_mvm_rx_aux_roc()
3082 IWL_DEBUG_TE(mvm, in iwl_mvm_rx_aux_roc()
3087 IWL_DEBUG_TE(mvm, "TIME_EVENT_CMD response - UID = 0x%x\n", in iwl_mvm_rx_aux_roc()
3090 spin_lock_bh(&mvm->time_event_lock); in iwl_mvm_rx_aux_roc()
3091 list_add_tail(&te_data->list, &mvm->aux_roc_te_list); in iwl_mvm_rx_aux_roc()
3092 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_rx_aux_roc()
3098 static int iwl_mvm_send_aux_roc_cmd(struct iwl_mvm *mvm, in iwl_mvm_send_aux_roc_cmd() argument
3112 .sta_id_and_color = cpu_to_le32(mvm->aux_sta.sta_id), in iwl_mvm_send_aux_roc_cmd()
3119 .apply_time = cpu_to_le32(iwl_read_prph(mvm->trans, time_reg)), in iwl_mvm_send_aux_roc_cmd()
3128 lockdep_assert_held(&mvm->mutex); in iwl_mvm_send_aux_roc_cmd()
3130 spin_lock_bh(&mvm->time_event_lock); in iwl_mvm_send_aux_roc_cmd()
3133 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_send_aux_roc_cmd()
3141 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_send_aux_roc_cmd()
3152 iwl_init_notification_wait(&mvm->notif_wait, &wait_time_event, in iwl_mvm_send_aux_roc_cmd()
3157 res = iwl_mvm_send_cmd_pdu(mvm, HOT_SPOT_CMD, 0, sizeof(aux_roc_req), in iwl_mvm_send_aux_roc_cmd()
3161 IWL_ERR(mvm, "Couldn't send HOT_SPOT_CMD: %d\n", res); in iwl_mvm_send_aux_roc_cmd()
3162 iwl_remove_notification(&mvm->notif_wait, &wait_time_event); in iwl_mvm_send_aux_roc_cmd()
3167 res = iwl_wait_notification(&mvm->notif_wait, &wait_time_event, 1); in iwl_mvm_send_aux_roc_cmd()
3173 spin_lock_bh(&mvm->time_event_lock); in iwl_mvm_send_aux_roc_cmd()
3174 iwl_mvm_te_clear_data(mvm, te_data); in iwl_mvm_send_aux_roc_cmd()
3175 spin_unlock_bh(&mvm->time_event_lock); in iwl_mvm_send_aux_roc_cmd()
3187 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_roc() local
3193 IWL_DEBUG_MAC80211(mvm, "enter (%d, %d, %d)\n", channel->hw_value, in iwl_mvm_roc()
3196 flush_work(&mvm->roc_done_wk); in iwl_mvm_roc()
3198 mutex_lock(&mvm->mutex); in iwl_mvm_roc()
3202 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_roc()
3205 ret = iwl_mvm_send_aux_roc_cmd(mvm, channel, in iwl_mvm_roc()
3209 IWL_ERR(mvm, "hotspot not supported\n"); in iwl_mvm_roc()
3216 IWL_ERR(mvm, "vif isn't P2P_DEVICE: %d\n", vif->type); in iwl_mvm_roc()
3222 phy_ctxt = &mvm->phy_ctxts[i]; in iwl_mvm_roc()
3231 ret = iwl_mvm_binding_remove_vif(mvm, vif); in iwl_mvm_roc()
3235 iwl_mvm_phy_ctxt_unref(mvm, mvmvif->phy_ctxt); in iwl_mvm_roc()
3240 ret = iwl_mvm_binding_add_vif(mvm, vif); in iwl_mvm_roc()
3244 iwl_mvm_phy_ctxt_ref(mvm, mvmvif->phy_ctxt); in iwl_mvm_roc()
3260 ret = iwl_mvm_phy_ctxt_changed(mvm, mvmvif->phy_ctxt, in iwl_mvm_roc()
3270 phy_ctxt = iwl_mvm_get_free_phy_ctxt(mvm); in iwl_mvm_roc()
3276 ret = iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, &chandef, in iwl_mvm_roc()
3279 IWL_ERR(mvm, "Failed to change PHY context\n"); in iwl_mvm_roc()
3284 ret = iwl_mvm_binding_remove_vif(mvm, vif); in iwl_mvm_roc()
3288 iwl_mvm_phy_ctxt_unref(mvm, mvmvif->phy_ctxt); in iwl_mvm_roc()
3293 ret = iwl_mvm_binding_add_vif(mvm, vif); in iwl_mvm_roc()
3297 iwl_mvm_phy_ctxt_ref(mvm, mvmvif->phy_ctxt); in iwl_mvm_roc()
3302 ret = iwl_mvm_start_p2p_roc(mvm, vif, duration, type); in iwl_mvm_roc()
3305 mutex_unlock(&mvm->mutex); in iwl_mvm_roc()
3306 IWL_DEBUG_MAC80211(mvm, "leave\n"); in iwl_mvm_roc()
3312 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_cancel_roc() local
3314 IWL_DEBUG_MAC80211(mvm, "enter\n"); in iwl_mvm_cancel_roc()
3316 mutex_lock(&mvm->mutex); in iwl_mvm_cancel_roc()
3317 iwl_mvm_stop_roc(mvm); in iwl_mvm_cancel_roc()
3318 mutex_unlock(&mvm->mutex); in iwl_mvm_cancel_roc()
3320 IWL_DEBUG_MAC80211(mvm, "leave\n"); in iwl_mvm_cancel_roc()
3324 static int __iwl_mvm_add_chanctx(struct iwl_mvm *mvm, in __iwl_mvm_add_chanctx() argument
3331 lockdep_assert_held(&mvm->mutex); in __iwl_mvm_add_chanctx()
3333 IWL_DEBUG_MAC80211(mvm, "Add channel context\n"); in __iwl_mvm_add_chanctx()
3335 phy_ctxt = iwl_mvm_get_free_phy_ctxt(mvm); in __iwl_mvm_add_chanctx()
3341 ret = iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, &ctx->min_def, in __iwl_mvm_add_chanctx()
3345 IWL_ERR(mvm, "Failed to add PHY context\n"); in __iwl_mvm_add_chanctx()
3349 iwl_mvm_phy_ctxt_ref(mvm, phy_ctxt); in __iwl_mvm_add_chanctx()
3358 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_add_chanctx() local
3361 mutex_lock(&mvm->mutex); in iwl_mvm_add_chanctx()
3362 ret = __iwl_mvm_add_chanctx(mvm, ctx); in iwl_mvm_add_chanctx()
3363 mutex_unlock(&mvm->mutex); in iwl_mvm_add_chanctx()
3368 static void __iwl_mvm_remove_chanctx(struct iwl_mvm *mvm, in __iwl_mvm_remove_chanctx() argument
3372 struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id]; in __iwl_mvm_remove_chanctx()
3374 lockdep_assert_held(&mvm->mutex); in __iwl_mvm_remove_chanctx()
3376 iwl_mvm_phy_ctxt_unref(mvm, phy_ctxt); in __iwl_mvm_remove_chanctx()
3382 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_remove_chanctx() local
3384 mutex_lock(&mvm->mutex); in iwl_mvm_remove_chanctx()
3385 __iwl_mvm_remove_chanctx(mvm, ctx); in iwl_mvm_remove_chanctx()
3386 mutex_unlock(&mvm->mutex); in iwl_mvm_remove_chanctx()
3393 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_change_chanctx() local
3395 struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id]; in iwl_mvm_change_chanctx()
3406 mutex_lock(&mvm->mutex); in iwl_mvm_change_chanctx()
3407 iwl_mvm_bt_coex_vif_change(mvm); in iwl_mvm_change_chanctx()
3408 iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, &ctx->min_def, in iwl_mvm_change_chanctx()
3411 mutex_unlock(&mvm->mutex); in iwl_mvm_change_chanctx()
3414 static int __iwl_mvm_assign_vif_chanctx(struct iwl_mvm *mvm, in __iwl_mvm_assign_vif_chanctx() argument
3420 struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id]; in __iwl_mvm_assign_vif_chanctx()
3424 lockdep_assert_held(&mvm->mutex); in __iwl_mvm_assign_vif_chanctx()
3453 ret = iwl_mvm_binding_add_vif(mvm, vif); in __iwl_mvm_assign_vif_chanctx()
3461 iwl_mvm_power_update_mac(mvm); in __iwl_mvm_assign_vif_chanctx()
3469 ret = iwl_mvm_update_quotas(mvm, false, NULL); in __iwl_mvm_assign_vif_chanctx()
3476 iwl_mvm_update_quotas(mvm, false, NULL); in __iwl_mvm_assign_vif_chanctx()
3477 iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); in __iwl_mvm_assign_vif_chanctx()
3487 ret = iwl_mvm_ref_sync(mvm, IWL_MVM_REF_PROTECT_CSA); in __iwl_mvm_assign_vif_chanctx()
3494 iwl_mvm_protect_session(mvm, vif, duration, duration, in __iwl_mvm_assign_vif_chanctx()
3498 iwl_mvm_unref(mvm, IWL_MVM_REF_PROTECT_CSA); in __iwl_mvm_assign_vif_chanctx()
3500 iwl_mvm_update_quotas(mvm, false, NULL); in __iwl_mvm_assign_vif_chanctx()
3506 iwl_mvm_binding_remove_vif(mvm, vif); in __iwl_mvm_assign_vif_chanctx()
3507 iwl_mvm_power_update_mac(mvm); in __iwl_mvm_assign_vif_chanctx()
3517 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_assign_vif_chanctx() local
3520 mutex_lock(&mvm->mutex); in iwl_mvm_assign_vif_chanctx()
3521 ret = __iwl_mvm_assign_vif_chanctx(mvm, vif, ctx, false); in iwl_mvm_assign_vif_chanctx()
3522 mutex_unlock(&mvm->mutex); in iwl_mvm_assign_vif_chanctx()
3527 static void __iwl_mvm_unassign_vif_chanctx(struct iwl_mvm *mvm, in __iwl_mvm_unassign_vif_chanctx() argument
3535 lockdep_assert_held(&mvm->mutex); in __iwl_mvm_unassign_vif_chanctx()
3537 iwl_mvm_remove_time_event(mvm, mvmvif, &mvmvif->time_event_data); in __iwl_mvm_unassign_vif_chanctx()
3554 iwl_mvm_modify_all_sta_disable_tx(mvm, mvmvif, true); in __iwl_mvm_unassign_vif_chanctx()
3557 rcu_assign_pointer(mvm->csa_tx_blocked_vif, vif); in __iwl_mvm_unassign_vif_chanctx()
3567 iwl_mvm_mac_ctxt_changed(mvm, vif, true, NULL); in __iwl_mvm_unassign_vif_chanctx()
3573 iwl_mvm_update_quotas(mvm, false, disabled_vif); in __iwl_mvm_unassign_vif_chanctx()
3574 iwl_mvm_binding_remove_vif(mvm, vif); in __iwl_mvm_unassign_vif_chanctx()
3578 iwl_mvm_power_update_mac(mvm); in __iwl_mvm_unassign_vif_chanctx()
3585 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_unassign_vif_chanctx() local
3587 mutex_lock(&mvm->mutex); in iwl_mvm_unassign_vif_chanctx()
3588 __iwl_mvm_unassign_vif_chanctx(mvm, vif, ctx, false); in iwl_mvm_unassign_vif_chanctx()
3589 mutex_unlock(&mvm->mutex); in iwl_mvm_unassign_vif_chanctx()
3593 iwl_mvm_switch_vif_chanctx_swap(struct iwl_mvm *mvm, in iwl_mvm_switch_vif_chanctx_swap() argument
3598 mutex_lock(&mvm->mutex); in iwl_mvm_switch_vif_chanctx_swap()
3599 __iwl_mvm_unassign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx, true); in iwl_mvm_switch_vif_chanctx_swap()
3600 __iwl_mvm_remove_chanctx(mvm, vifs[0].old_ctx); in iwl_mvm_switch_vif_chanctx_swap()
3602 ret = __iwl_mvm_add_chanctx(mvm, vifs[0].new_ctx); in iwl_mvm_switch_vif_chanctx_swap()
3604 IWL_ERR(mvm, "failed to add new_ctx during channel switch\n"); in iwl_mvm_switch_vif_chanctx_swap()
3608 ret = __iwl_mvm_assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].new_ctx, in iwl_mvm_switch_vif_chanctx_swap()
3611 IWL_ERR(mvm, in iwl_mvm_switch_vif_chanctx_swap()
3617 if (iwl_mvm_phy_ctx_count(mvm) > 1) in iwl_mvm_switch_vif_chanctx_swap()
3618 iwl_mvm_teardown_tdls_peers(mvm); in iwl_mvm_switch_vif_chanctx_swap()
3623 __iwl_mvm_remove_chanctx(mvm, vifs[0].new_ctx); in iwl_mvm_switch_vif_chanctx_swap()
3626 if (__iwl_mvm_add_chanctx(mvm, vifs[0].old_ctx)) { in iwl_mvm_switch_vif_chanctx_swap()
3627 IWL_ERR(mvm, "failed to add old_ctx back after failure.\n"); in iwl_mvm_switch_vif_chanctx_swap()
3631 if (__iwl_mvm_assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx, in iwl_mvm_switch_vif_chanctx_swap()
3633 IWL_ERR(mvm, "failed to reassign old_ctx after failure.\n"); in iwl_mvm_switch_vif_chanctx_swap()
3641 iwl_mvm_nic_restart(mvm, false); in iwl_mvm_switch_vif_chanctx_swap()
3644 mutex_unlock(&mvm->mutex); in iwl_mvm_switch_vif_chanctx_swap()
3650 iwl_mvm_switch_vif_chanctx_reassign(struct iwl_mvm *mvm, in iwl_mvm_switch_vif_chanctx_reassign() argument
3655 mutex_lock(&mvm->mutex); in iwl_mvm_switch_vif_chanctx_reassign()
3656 __iwl_mvm_unassign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx, true); in iwl_mvm_switch_vif_chanctx_reassign()
3658 ret = __iwl_mvm_assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].new_ctx, in iwl_mvm_switch_vif_chanctx_reassign()
3661 IWL_ERR(mvm, in iwl_mvm_switch_vif_chanctx_reassign()
3669 if (__iwl_mvm_assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx, in iwl_mvm_switch_vif_chanctx_reassign()
3671 IWL_ERR(mvm, "failed to reassign old_ctx after failure.\n"); in iwl_mvm_switch_vif_chanctx_reassign()
3679 iwl_mvm_nic_restart(mvm, false); in iwl_mvm_switch_vif_chanctx_reassign()
3682 mutex_unlock(&mvm->mutex); in iwl_mvm_switch_vif_chanctx_reassign()
3692 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_switch_vif_chanctx() local
3701 ret = iwl_mvm_switch_vif_chanctx_swap(mvm, vifs); in iwl_mvm_switch_vif_chanctx()
3704 ret = iwl_mvm_switch_vif_chanctx_reassign(mvm, vifs); in iwl_mvm_switch_vif_chanctx()
3718 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_set_tim() local
3722 IWL_ERR(mvm, "Station is not associated to a vif\n"); in iwl_mvm_set_tim()
3726 return iwl_mvm_mac_ctxt_beacon_changed(mvm, mvm_sta->vif); in iwl_mvm_set_tim()
3736 static int __iwl_mvm_mac_testmode_cmd(struct iwl_mvm *mvm, in __iwl_mvm_mac_testmode_cmd() argument
3762 mvm->noa_duration = noa_duration; in __iwl_mvm_mac_testmode_cmd()
3763 mvm->noa_vif = vif; in __iwl_mvm_mac_testmode_cmd()
3765 return iwl_mvm_update_quotas(mvm, false, NULL); in __iwl_mvm_mac_testmode_cmd()
3774 return iwl_mvm_enable_beacon_filter(mvm, vif, 0); in __iwl_mvm_mac_testmode_cmd()
3775 return iwl_mvm_disable_beacon_filter(mvm, vif, 0); in __iwl_mvm_mac_testmode_cmd()
3785 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_testmode_cmd() local
3788 mutex_lock(&mvm->mutex); in iwl_mvm_mac_testmode_cmd()
3789 err = __iwl_mvm_mac_testmode_cmd(mvm, vif, data, len); in iwl_mvm_mac_testmode_cmd()
3790 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_testmode_cmd()
3814 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_pre_channel_switch() local
3820 mutex_lock(&mvm->mutex); in iwl_mvm_pre_channel_switch()
3824 IWL_DEBUG_MAC80211(mvm, "pre CSA to freq %d\n", in iwl_mvm_pre_channel_switch()
3827 iwl_fw_dbg_trigger_simple_stop(mvm, vif, FW_DBG_TRIGGER_CHANNEL_SWITCH); in iwl_mvm_pre_channel_switch()
3832 rcu_dereference_protected(mvm->csa_vif, in iwl_mvm_pre_channel_switch()
3833 lockdep_is_held(&mvm->mutex)); in iwl_mvm_pre_channel_switch()
3840 rcu_assign_pointer(mvm->csa_vif, vif); in iwl_mvm_pre_channel_switch()
3859 iwl_mvm_csa_client_absent(mvm, vif); in iwl_mvm_pre_channel_switch()
3861 iwl_mvm_schedule_csa_period(mvm, vif, vif->bss_conf.beacon_int, in iwl_mvm_pre_channel_switch()
3864 ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0); in iwl_mvm_pre_channel_switch()
3876 ret = iwl_mvm_power_update_ps(mvm); in iwl_mvm_pre_channel_switch()
3881 iwl_mvm_teardown_tdls_peers(mvm); in iwl_mvm_pre_channel_switch()
3884 mutex_unlock(&mvm->mutex); in iwl_mvm_pre_channel_switch()
3893 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_post_channel_switch() local
3896 mutex_lock(&mvm->mutex); in iwl_mvm_post_channel_switch()
3907 mvmsta = iwl_mvm_sta_from_staid_protected(mvm, in iwl_mvm_post_channel_switch()
3915 iwl_mvm_sta_modify_disable_tx(mvm, mvmsta, false); in iwl_mvm_post_channel_switch()
3917 iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); in iwl_mvm_post_channel_switch()
3919 ret = iwl_mvm_enable_beacon_filter(mvm, vif, 0); in iwl_mvm_post_channel_switch()
3923 iwl_mvm_stop_session_protection(mvm, vif); in iwl_mvm_post_channel_switch()
3928 ret = iwl_mvm_power_update_ps(mvm); in iwl_mvm_post_channel_switch()
3931 mutex_unlock(&mvm->mutex); in iwl_mvm_post_channel_switch()
3939 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_flush() local
3949 mutex_lock(&mvm->mutex); in iwl_mvm_mac_flush()
3954 sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[i], in iwl_mvm_mac_flush()
3955 lockdep_is_held(&mvm->mutex)); in iwl_mvm_mac_flush()
3970 if (iwl_mvm_flush_tx_path(mvm, msk, 0)) in iwl_mvm_mac_flush()
3971 IWL_ERR(mvm, "flush request fail\n"); in iwl_mvm_mac_flush()
3972 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_flush()
3974 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_flush()
3979 iwl_trans_wait_tx_queue_empty(mvm->trans, msk); in iwl_mvm_mac_flush()
3986 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_get_survey() local
3995 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_get_survey()
3999 mutex_lock(&mvm->mutex); in iwl_mvm_mac_get_survey()
4001 if (mvm->ucode_loaded) { in iwl_mvm_mac_get_survey()
4002 ret = iwl_mvm_request_statistics(mvm, false); in iwl_mvm_mac_get_survey()
4011 survey->time = mvm->accu_radio_stats.on_time_rf + in iwl_mvm_mac_get_survey()
4012 mvm->radio_stats.on_time_rf; in iwl_mvm_mac_get_survey()
4015 survey->time_rx = mvm->accu_radio_stats.rx_time + in iwl_mvm_mac_get_survey()
4016 mvm->radio_stats.rx_time; in iwl_mvm_mac_get_survey()
4019 survey->time_tx = mvm->accu_radio_stats.tx_time + in iwl_mvm_mac_get_survey()
4020 mvm->radio_stats.tx_time; in iwl_mvm_mac_get_survey()
4023 survey->time_scan = mvm->accu_radio_stats.on_time_scan + in iwl_mvm_mac_get_survey()
4024 mvm->radio_stats.on_time_scan; in iwl_mvm_mac_get_survey()
4029 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_get_survey()
4038 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_sta_statistics() local
4042 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_sta_statistics()
4053 mutex_lock(&mvm->mutex); in iwl_mvm_mac_sta_statistics()
4058 if (iwl_mvm_request_statistics(mvm, false)) in iwl_mvm_mac_sta_statistics()
4070 mutex_unlock(&mvm->mutex); in iwl_mvm_mac_sta_statistics()
4073 static void iwl_mvm_event_mlme_callback(struct iwl_mvm *mvm, in iwl_mvm_event_mlme_callback() argument
4087 if (!iwl_fw_dbg_trigger_enabled(mvm->fw, FW_DBG_TRIGGER_MLME)) in iwl_mvm_event_mlme_callback()
4090 trig = iwl_fw_dbg_get_trigger(mvm->fw, FW_DBG_TRIGGER_MLME); in iwl_mvm_event_mlme_callback()
4092 if (!iwl_fw_dbg_trigger_check_stop(mvm, vif, trig)) in iwl_mvm_event_mlme_callback()
4097 CHECK_MLME_TRIGGER(mvm, trig, buf, in iwl_mvm_event_mlme_callback()
4102 CHECK_MLME_TRIGGER(mvm, trig, buf, in iwl_mvm_event_mlme_callback()
4107 CHECK_MLME_TRIGGER(mvm, trig, buf, in iwl_mvm_event_mlme_callback()
4112 CHECK_MLME_TRIGGER(mvm, trig, buf, in iwl_mvm_event_mlme_callback()
4116 CHECK_MLME_TRIGGER(mvm, trig, buf, in iwl_mvm_event_mlme_callback()
4120 CHECK_MLME_TRIGGER(mvm, trig, buf, in iwl_mvm_event_mlme_callback()
4127 static void iwl_mvm_event_bar_rx_callback(struct iwl_mvm *mvm, in iwl_mvm_event_bar_rx_callback() argument
4134 if (!iwl_fw_dbg_trigger_enabled(mvm->fw, FW_DBG_TRIGGER_BA)) in iwl_mvm_event_bar_rx_callback()
4137 trig = iwl_fw_dbg_get_trigger(mvm->fw, FW_DBG_TRIGGER_BA); in iwl_mvm_event_bar_rx_callback()
4139 if (!iwl_fw_dbg_trigger_check_stop(mvm, vif, trig)) in iwl_mvm_event_bar_rx_callback()
4145 iwl_mvm_fw_dbg_collect_trig(mvm, trig, in iwl_mvm_event_bar_rx_callback()
4152 iwl_mvm_event_frame_timeout_callback(struct iwl_mvm *mvm, in iwl_mvm_event_frame_timeout_callback() argument
4159 if (!iwl_fw_dbg_trigger_enabled(mvm->fw, FW_DBG_TRIGGER_BA)) in iwl_mvm_event_frame_timeout_callback()
4162 trig = iwl_fw_dbg_get_trigger(mvm->fw, FW_DBG_TRIGGER_BA); in iwl_mvm_event_frame_timeout_callback()
4164 if (!iwl_fw_dbg_trigger_check_stop(mvm, vif, trig)) in iwl_mvm_event_frame_timeout_callback()
4170 iwl_mvm_fw_dbg_collect_trig(mvm, trig, in iwl_mvm_event_frame_timeout_callback()
4179 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_mac_event_callback() local
4183 iwl_mvm_event_mlme_callback(mvm, vif, event); in iwl_mvm_mac_event_callback()
4186 iwl_mvm_event_bar_rx_callback(mvm, vif, event); in iwl_mvm_mac_event_callback()
4189 iwl_mvm_event_frame_timeout_callback(mvm, vif, event); in iwl_mvm_mac_event_callback()