Lines Matching refs:mvm

80 	struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);  in iwl_mvm_set_rekey_data()  local
86 mutex_lock(&mvm->mutex); in iwl_mvm_set_rekey_data()
94 mutex_unlock(&mvm->mutex); in iwl_mvm_set_rekey_data()
174 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_wowlan_program_keys() local
222 mutex_lock(&mvm->mutex); in iwl_mvm_wowlan_program_keys()
223 ret = iwl_mvm_send_cmd_pdu(mvm, WEP_KEY, 0, in iwl_mvm_wowlan_program_keys()
227 mvm->ptk_ivlen = key->iv_len; in iwl_mvm_wowlan_program_keys()
228 mvm->ptk_icvlen = key->icv_len; in iwl_mvm_wowlan_program_keys()
229 mvm->gtk_ivlen = key->iv_len; in iwl_mvm_wowlan_program_keys()
230 mvm->gtk_icvlen = key->icv_len; in iwl_mvm_wowlan_program_keys()
231 mutex_unlock(&mvm->mutex); in iwl_mvm_wowlan_program_keys()
323 if (sta && iwl_mvm_has_new_rx_api(mvm)) { in iwl_mvm_wowlan_program_keys()
331 lockdep_is_held(&mvm->mutex)); in iwl_mvm_wowlan_program_keys()
337 mvm->trans->num_rx_queues); in iwl_mvm_wowlan_program_keys()
363 mutex_lock(&mvm->mutex); in iwl_mvm_wowlan_program_keys()
369 mvm->ptk_ivlen = key->iv_len; in iwl_mvm_wowlan_program_keys()
370 mvm->ptk_icvlen = key->icv_len; in iwl_mvm_wowlan_program_keys()
371 ret = iwl_mvm_set_sta_key(mvm, vif, sta, key, 0); in iwl_mvm_wowlan_program_keys()
379 mvm->gtk_ivlen = key->iv_len; in iwl_mvm_wowlan_program_keys()
380 mvm->gtk_icvlen = key->icv_len; in iwl_mvm_wowlan_program_keys()
381 ret = iwl_mvm_set_sta_key(mvm, vif, sta, key, 1); in iwl_mvm_wowlan_program_keys()
383 mutex_unlock(&mvm->mutex); in iwl_mvm_wowlan_program_keys()
388 static int iwl_mvm_send_patterns_v1(struct iwl_mvm *mvm, in iwl_mvm_send_patterns_v1() argument
423 err = iwl_mvm_send_cmd(mvm, &cmd); in iwl_mvm_send_patterns_v1()
428 static int iwl_mvm_send_patterns(struct iwl_mvm *mvm, in iwl_mvm_send_patterns() argument
467 err = iwl_mvm_send_cmd(mvm, &cmd); in iwl_mvm_send_patterns()
472 static int iwl_mvm_d3_reprogram(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_d3_reprogram() argument
485 if (WARN_ON_ONCE(iwl_mvm_is_cdb_supported(mvm))) in iwl_mvm_d3_reprogram()
503 ret = iwl_mvm_phy_ctxt_add(mvm, mvmvif->phy_ctxt, &chandef, in iwl_mvm_d3_reprogram()
514 ret = iwl_mvm_mac_ctxt_add(mvm, vif); in iwl_mvm_d3_reprogram()
532 ret = iwl_mvm_send_cmd_pdu_status(mvm, BINDING_CONTEXT_CMD, in iwl_mvm_d3_reprogram()
536 IWL_ERR(mvm, "Failed to add binding: %d\n", ret); in iwl_mvm_d3_reprogram()
541 IWL_ERR(mvm, "Binding command failed: %u\n", status); in iwl_mvm_d3_reprogram()
545 ret = iwl_mvm_sta_send_to_fw(mvm, ap_sta, false, 0); in iwl_mvm_d3_reprogram()
548 rcu_assign_pointer(mvm->fw_id_to_mac_id[mvmvif->ap_sta_id], ap_sta); in iwl_mvm_d3_reprogram()
550 ret = iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); in iwl_mvm_d3_reprogram()
555 quota = iwl_mvm_quota_cmd_get_quota(mvm, &quota_cmd, 0); in iwl_mvm_d3_reprogram()
563 quota = iwl_mvm_quota_cmd_get_quota(mvm, &quota_cmd, i); in iwl_mvm_d3_reprogram()
567 ret = iwl_mvm_send_cmd_pdu(mvm, TIME_QUOTA_CMD, 0, in iwl_mvm_d3_reprogram()
568 iwl_mvm_quota_cmd_size(mvm), &quota_cmd); in iwl_mvm_d3_reprogram()
570 IWL_ERR(mvm, "Failed to send quota: %d\n", ret); in iwl_mvm_d3_reprogram()
572 if (iwl_mvm_is_lar_supported(mvm) && iwl_mvm_init_fw_regd(mvm)) in iwl_mvm_d3_reprogram()
573 IWL_ERR(mvm, "Failed to initialize D3 LAR information\n"); in iwl_mvm_d3_reprogram()
578 static int iwl_mvm_get_last_nonqos_seq(struct iwl_mvm *mvm, in iwl_mvm_get_last_nonqos_seq() argument
598 err = iwl_mvm_send_cmd(mvm, &cmd); in iwl_mvm_get_last_nonqos_seq()
615 void iwl_mvm_set_last_nonqos_seq(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_set_last_nonqos_seq() argument
632 if (iwl_mvm_send_cmd_pdu(mvm, NON_QOS_TX_COUNTER_CMD, 0, in iwl_mvm_set_last_nonqos_seq()
634 IWL_ERR(mvm, "failed to set non-QoS seqno\n"); in iwl_mvm_set_last_nonqos_seq()
637 static int iwl_mvm_switch_to_d3(struct iwl_mvm *mvm) in iwl_mvm_switch_to_d3() argument
639 iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_REGULAR, true); in iwl_mvm_switch_to_d3()
641 iwl_mvm_stop_device(mvm); in iwl_mvm_switch_to_d3()
652 set_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status); in iwl_mvm_switch_to_d3()
655 memset(mvm->fw_key_table, 0, sizeof(mvm->fw_key_table)); in iwl_mvm_switch_to_d3()
657 mvm->ptk_ivlen = 0; in iwl_mvm_switch_to_d3()
658 mvm->ptk_icvlen = 0; in iwl_mvm_switch_to_d3()
659 mvm->ptk_ivlen = 0; in iwl_mvm_switch_to_d3()
660 mvm->ptk_icvlen = 0; in iwl_mvm_switch_to_d3()
662 return iwl_mvm_load_d3_fw(mvm); in iwl_mvm_switch_to_d3()
666 iwl_mvm_get_wowlan_config(struct iwl_mvm *mvm, in iwl_mvm_get_wowlan_config() argument
683 ret = iwl_mvm_get_last_nonqos_seq(mvm, vif); in iwl_mvm_get_wowlan_config()
738 static int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm, in iwl_mvm_wowlan_config_key_params() argument
744 bool unified = fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_wowlan_config_key_params()
771 ieee80211_iter_keys(mvm->hw, vif, iwl_mvm_wowlan_program_keys, in iwl_mvm_wowlan_config_key_params()
780 ret = iwl_mvm_send_cmd_pdu(mvm, in iwl_mvm_wowlan_config_key_params()
789 !fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_wowlan_config_key_params()
791 ret = iwl_mvm_send_cmd_pdu(mvm, in iwl_mvm_wowlan_config_key_params()
810 ret = iwl_mvm_send_cmd_pdu(mvm, in iwl_mvm_wowlan_config_key_params()
824 iwl_mvm_wowlan_config(struct iwl_mvm *mvm, in iwl_mvm_wowlan_config() argument
831 bool unified_image = fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_wowlan_config()
834 mvm->offload_tid = wowlan_config_cmd->offloading_tid; in iwl_mvm_wowlan_config()
837 ret = iwl_mvm_switch_to_d3(mvm); in iwl_mvm_wowlan_config()
841 ret = iwl_mvm_d3_reprogram(mvm, vif, ap_sta); in iwl_mvm_wowlan_config()
852 mutex_unlock(&mvm->mutex); in iwl_mvm_wowlan_config()
853 ret = iwl_mvm_wowlan_config_key_params(mvm, vif, CMD_ASYNC); in iwl_mvm_wowlan_config()
854 mutex_lock(&mvm->mutex); in iwl_mvm_wowlan_config()
859 ret = iwl_mvm_send_cmd_pdu(mvm, WOWLAN_CONFIGURATION, 0, in iwl_mvm_wowlan_config()
865 if (fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_wowlan_config()
867 ret = iwl_mvm_send_patterns(mvm, wowlan); in iwl_mvm_wowlan_config()
869 ret = iwl_mvm_send_patterns_v1(mvm, wowlan); in iwl_mvm_wowlan_config()
873 return iwl_mvm_send_proto_offload(mvm, vif, false, true, 0); in iwl_mvm_wowlan_config()
877 iwl_mvm_netdetect_config(struct iwl_mvm *mvm, in iwl_mvm_netdetect_config() argument
884 bool unified_image = fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_netdetect_config()
888 ret = iwl_mvm_switch_to_d3(mvm); in iwl_mvm_netdetect_config()
897 ret = iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_SCHED, true); in iwl_mvm_netdetect_config()
907 wowlan_config_cmd.sta_id = mvm->aux_sta.sta_id; in iwl_mvm_netdetect_config()
909 ret = iwl_mvm_send_cmd_pdu(mvm, WOWLAN_CONFIGURATION, 0, in iwl_mvm_netdetect_config()
915 ret = iwl_mvm_sched_scan_start(mvm, vif, nd_config, &mvm->nd_ies, in iwl_mvm_netdetect_config()
920 if (WARN_ON(mvm->nd_match_sets || mvm->nd_channels)) in iwl_mvm_netdetect_config()
925 mvm->nd_match_sets = kmemdup(nd_config->match_sets, in iwl_mvm_netdetect_config()
929 if (mvm->nd_match_sets) in iwl_mvm_netdetect_config()
930 mvm->n_nd_match_sets = nd_config->n_match_sets; in iwl_mvm_netdetect_config()
934 mvm->nd_channels = kmemdup(nd_config->channels, in iwl_mvm_netdetect_config()
938 if (mvm->nd_channels) in iwl_mvm_netdetect_config()
939 mvm->n_nd_channels = nd_config->n_channels; in iwl_mvm_netdetect_config()
944 static void iwl_mvm_free_nd(struct iwl_mvm *mvm) in iwl_mvm_free_nd() argument
946 kfree(mvm->nd_match_sets); in iwl_mvm_free_nd()
947 mvm->nd_match_sets = NULL; in iwl_mvm_free_nd()
948 mvm->n_nd_match_sets = 0; in iwl_mvm_free_nd()
949 kfree(mvm->nd_channels); in iwl_mvm_free_nd()
950 mvm->nd_channels = NULL; in iwl_mvm_free_nd()
951 mvm->n_nd_channels = 0; in iwl_mvm_free_nd()
958 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in __iwl_mvm_suspend() local
978 bool unified_image = fw_has_capa(&mvm->fw->ucode_capa, in __iwl_mvm_suspend()
990 mutex_lock(&mvm->mutex); in __iwl_mvm_suspend()
992 vif = iwl_mvm_get_bss_vif(mvm); in __iwl_mvm_suspend()
1008 mvm, wowlan, wowlan->nd_config, vif); in __iwl_mvm_suspend()
1012 mvm->net_detect = true; in __iwl_mvm_suspend()
1019 mvm->fw_id_to_mac_id[mvmvif->ap_sta_id], in __iwl_mvm_suspend()
1020 lockdep_is_held(&mvm->mutex)); in __iwl_mvm_suspend()
1026 ret = iwl_mvm_get_wowlan_config(mvm, wowlan, &wowlan_config_cmd, in __iwl_mvm_suspend()
1030 ret = iwl_mvm_wowlan_config(mvm, wowlan, &wowlan_config_cmd, in __iwl_mvm_suspend()
1035 mvm->net_detect = false; in __iwl_mvm_suspend()
1038 ret = iwl_mvm_power_update_device(mvm); in __iwl_mvm_suspend()
1042 ret = iwl_mvm_power_update_mac(mvm); in __iwl_mvm_suspend()
1047 if (mvm->d3_wake_sysassert) in __iwl_mvm_suspend()
1057 if (mvm->trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_9000) in __iwl_mvm_suspend()
1058 iwl_fw_dbg_stop_restart_recording(&mvm->fwrt, NULL, true); in __iwl_mvm_suspend()
1061 ret = iwl_mvm_send_cmd(mvm, &d3_cfg_cmd); in __iwl_mvm_suspend()
1067 mvm->d3_test_pme_ptr = in __iwl_mvm_suspend()
1073 clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status); in __iwl_mvm_suspend()
1075 ret = iwl_trans_d3_suspend(mvm->trans, test, !unified_image); in __iwl_mvm_suspend()
1078 iwl_mvm_free_nd(mvm); in __iwl_mvm_suspend()
1081 if (mvm->fw_restart > 0) { in __iwl_mvm_suspend()
1082 mvm->fw_restart--; in __iwl_mvm_suspend()
1083 ieee80211_restart_hw(mvm->hw); in __iwl_mvm_suspend()
1088 mutex_unlock(&mvm->mutex); in __iwl_mvm_suspend()
1095 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_suspend() local
1096 struct iwl_trans *trans = mvm->trans; in iwl_mvm_suspend()
1099 iwl_mvm_pause_tcm(mvm, true); in iwl_mvm_suspend()
1101 iwl_fw_runtime_suspend(&mvm->fwrt); in iwl_mvm_suspend()
1122 static void iwl_mvm_report_wakeup_reasons(struct iwl_mvm *mvm, in iwl_mvm_report_wakeup_reasons() argument
1138 pm_wakeup_event(mvm->dev, 0); in iwl_mvm_report_wakeup_reasons()
1203 ivlen = mvm->gtk_ivlen; in iwl_mvm_report_wakeup_reasons()
1204 icvlen += mvm->gtk_icvlen; in iwl_mvm_report_wakeup_reasons()
1206 ivlen = mvm->ptk_ivlen; in iwl_mvm_report_wakeup_reasons()
1207 icvlen += mvm->ptk_icvlen; in iwl_mvm_report_wakeup_reasons()
1275 static void iwl_mvm_set_aes_rx_seq(struct iwl_mvm *mvm, struct aes_sc *scs, in iwl_mvm_set_aes_rx_seq() argument
1283 if (sta && iwl_mvm_has_new_rx_api(mvm)) { in iwl_mvm_set_aes_rx_seq()
1290 lockdep_is_held(&mvm->mutex)); in iwl_mvm_set_aes_rx_seq()
1300 for (i = 1; i < mvm->trans->num_rx_queues; i++) in iwl_mvm_set_aes_rx_seq()
1329 static void iwl_mvm_set_key_rx_seq(struct iwl_mvm *mvm, in iwl_mvm_set_key_rx_seq() argument
1337 iwl_mvm_set_aes_rx_seq(mvm, rsc->aes.multicast_rsc, NULL, key); in iwl_mvm_set_key_rx_seq()
1348 struct iwl_mvm *mvm; member
1398 iwl_mvm_set_aes_rx_seq(data->mvm, sc->aes.unicast_rsc, in iwl_mvm_d3_update_keys()
1424 iwl_mvm_set_key_rx_seq(data->mvm, key, data->status); in iwl_mvm_d3_update_keys()
1427 static bool iwl_mvm_setup_connection_keep(struct iwl_mvm *mvm, in iwl_mvm_setup_connection_keep() argument
1433 .mvm = mvm, in iwl_mvm_setup_connection_keep()
1448 ieee80211_iter_keys(mvm->hw, vif, in iwl_mvm_setup_connection_keep()
1463 ieee80211_iter_keys(mvm->hw, vif, in iwl_mvm_setup_connection_keep()
1497 iwl_mvm_set_key_rx_seq(mvm, key, status); in iwl_mvm_setup_connection_keep()
1514 struct iwl_wowlan_status *iwl_mvm_send_wowlan_get_status(struct iwl_mvm *mvm) in iwl_mvm_send_wowlan_get_status() argument
1523 lockdep_assert_held(&mvm->mutex); in iwl_mvm_send_wowlan_get_status()
1525 ret = iwl_mvm_send_cmd(mvm, &cmd); in iwl_mvm_send_wowlan_get_status()
1527 IWL_ERR(mvm, "failed to query wakeup status (%d)\n", ret); in iwl_mvm_send_wowlan_get_status()
1531 if (!fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_send_wowlan_get_status()
1540 IWL_ERR(mvm, "Invalid WoWLAN status response!\n"); in iwl_mvm_send_wowlan_get_status()
1548 IWL_ERR(mvm, "Invalid WoWLAN status response!\n"); in iwl_mvm_send_wowlan_get_status()
1596 IWL_ERR(mvm, "Invalid WoWLAN status response!\n"); in iwl_mvm_send_wowlan_get_status()
1603 IWL_ERR(mvm, "Invalid WoWLAN status response!\n"); in iwl_mvm_send_wowlan_get_status()
1616 iwl_mvm_get_wakeup_status(struct iwl_mvm *mvm) in iwl_mvm_get_wakeup_status() argument
1621 ret = iwl_mvm_send_cmd_pdu(mvm, OFFLOADS_QUERY_CMD, 0, 0, NULL); in iwl_mvm_get_wakeup_status()
1623 IWL_ERR(mvm, "failed to query offload statistics (%d)\n", ret); in iwl_mvm_get_wakeup_status()
1625 return iwl_mvm_send_wowlan_get_status(mvm); in iwl_mvm_get_wakeup_status()
1629 static bool iwl_mvm_query_wakeup_reasons(struct iwl_mvm *mvm, in iwl_mvm_query_wakeup_reasons() argument
1638 fw_status = iwl_mvm_get_wakeup_status(mvm); in iwl_mvm_query_wakeup_reasons()
1654 mvm_ap_sta = iwl_mvm_sta_from_staid_protected(mvm, 0); in iwl_mvm_query_wakeup_reasons()
1665 if (mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_22000) { in iwl_mvm_query_wakeup_reasons()
1666 i = mvm->offload_tid; in iwl_mvm_query_wakeup_reasons()
1667 iwl_trans_set_q_ptrs(mvm->trans, in iwl_mvm_query_wakeup_reasons()
1673 mutex_unlock(&mvm->mutex); in iwl_mvm_query_wakeup_reasons()
1675 iwl_mvm_report_wakeup_reasons(mvm, vif, &status); in iwl_mvm_query_wakeup_reasons()
1677 keep = iwl_mvm_setup_connection_keep(mvm, vif, fw_status); in iwl_mvm_query_wakeup_reasons()
1685 mutex_unlock(&mvm->mutex); in iwl_mvm_query_wakeup_reasons()
1698 iwl_mvm_netdetect_query_results(struct iwl_mvm *mvm, in iwl_mvm_netdetect_query_results() argument
1709 ret = iwl_mvm_send_cmd(mvm, &cmd); in iwl_mvm_netdetect_query_results()
1711 IWL_ERR(mvm, "failed to query matched profiles (%d)\n", ret); in iwl_mvm_netdetect_query_results()
1715 if (fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_netdetect_query_results()
1728 IWL_ERR(mvm, "Invalid scan offload profiles query response!\n"); in iwl_mvm_netdetect_query_results()
1739 mvm->last_netdetect_scans = le32_to_cpu(query->n_scans_done); in iwl_mvm_netdetect_query_results()
1747 static int iwl_mvm_query_num_match_chans(struct iwl_mvm *mvm, in iwl_mvm_query_num_match_chans() argument
1753 if (fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_query_num_match_chans()
1771 static void iwl_mvm_query_set_freqs(struct iwl_mvm *mvm, in iwl_mvm_query_set_freqs() argument
1778 if (fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_query_set_freqs()
1786 mvm->nd_channels[i]->center_freq; in iwl_mvm_query_set_freqs()
1794 mvm->nd_channels[i]->center_freq; in iwl_mvm_query_set_freqs()
1798 static void iwl_mvm_query_netdetect_reasons(struct iwl_mvm *mvm, in iwl_mvm_query_netdetect_reasons() argument
1812 fw_status = iwl_mvm_get_wakeup_status(mvm); in iwl_mvm_query_netdetect_reasons()
1824 ret = iwl_mvm_netdetect_query_results(mvm, &query); in iwl_mvm_query_netdetect_reasons()
1831 if (mvm->n_nd_match_sets) { in iwl_mvm_query_netdetect_reasons()
1834 IWL_ERR(mvm, "no net detect match information available\n"); in iwl_mvm_query_netdetect_reasons()
1843 for_each_set_bit(i, &matched_profiles, mvm->n_nd_match_sets) { in iwl_mvm_query_netdetect_reasons()
1847 n_channels = iwl_mvm_query_num_match_chans(mvm, &query, i); in iwl_mvm_query_netdetect_reasons()
1859 idx = mvm->n_nd_match_sets - i - 1; in iwl_mvm_query_netdetect_reasons()
1860 match->ssid.ssid_len = mvm->nd_match_sets[idx].ssid.ssid_len; in iwl_mvm_query_netdetect_reasons()
1861 memcpy(match->ssid.ssid, mvm->nd_match_sets[idx].ssid.ssid, in iwl_mvm_query_netdetect_reasons()
1864 if (mvm->n_nd_channels < n_channels) in iwl_mvm_query_netdetect_reasons()
1867 iwl_mvm_query_set_freqs(mvm, &query, match, i); in iwl_mvm_query_netdetect_reasons()
1873 iwl_mvm_free_nd(mvm); in iwl_mvm_query_netdetect_reasons()
1875 mutex_unlock(&mvm->mutex); in iwl_mvm_query_netdetect_reasons()
1896 static int iwl_mvm_check_rt_status(struct iwl_mvm *mvm, in iwl_mvm_check_rt_status() argument
1899 u32 base = mvm->trans->dbg.lmac_error_event_table[0]; in iwl_mvm_check_rt_status()
1906 iwl_trans_read_mem_bytes(mvm->trans, base, in iwl_mvm_check_rt_status()
1919 static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test) in __iwl_mvm_resume() argument
1925 bool unified_image = fw_has_capa(&mvm->fw->ucode_capa, in __iwl_mvm_resume()
1927 bool d0i3_first = fw_has_capa(&mvm->fw->ucode_capa, in __iwl_mvm_resume()
1930 mutex_lock(&mvm->mutex); in __iwl_mvm_resume()
1933 vif = iwl_mvm_get_bss_vif(mvm); in __iwl_mvm_resume()
1937 iwl_fw_dbg_read_d3_debug_data(&mvm->fwrt); in __iwl_mvm_resume()
1939 if (iwl_mvm_check_rt_status(mvm, vif)) { in __iwl_mvm_resume()
1940 set_bit(STATUS_FW_ERROR, &mvm->trans->status); in __iwl_mvm_resume()
1941 iwl_mvm_dump_nic_error_log(mvm); in __iwl_mvm_resume()
1942 iwl_fw_dbg_collect_desc(&mvm->fwrt, &iwl_dump_desc_assert, in __iwl_mvm_resume()
1948 ret = iwl_trans_d3_resume(mvm->trans, &d3_status, test, !unified_image); in __iwl_mvm_resume()
1953 IWL_INFO(mvm, "Device was reset during suspend\n"); in __iwl_mvm_resume()
1958 ret = iwl_mvm_send_cmd_pdu(mvm, D0I3_END_CMD, 0, 0, NULL); in __iwl_mvm_resume()
1960 IWL_ERR(mvm, "Failed to send D0I3_END_CMD first (%d)\n", in __iwl_mvm_resume()
1970 iwl_mvm_update_changed_regdom(mvm); in __iwl_mvm_resume()
1973 iwl_mvm_ppag_send_cmd(mvm); in __iwl_mvm_resume()
1977 iwl_mvm_sar_select_profile(mvm, 1, 1); in __iwl_mvm_resume()
1979 if (mvm->net_detect) { in __iwl_mvm_resume()
1987 ret = iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_NETDETECT, in __iwl_mvm_resume()
1990 iwl_mvm_query_netdetect_reasons(mvm, vif); in __iwl_mvm_resume()
1994 keep = iwl_mvm_query_wakeup_reasons(mvm, vif); in __iwl_mvm_resume()
1997 mvm->keep_vif = vif; in __iwl_mvm_resume()
2004 iwl_mvm_free_nd(mvm); in __iwl_mvm_resume()
2005 mutex_unlock(&mvm->mutex); in __iwl_mvm_resume()
2009 ieee80211_iterate_active_interfaces_rtnl(mvm->hw, in __iwl_mvm_resume()
2020 ret = iwl_mvm_send_cmd_pdu(mvm, D0I3_END_CMD, 0, 0, NULL); in __iwl_mvm_resume()
2030 set_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status); in __iwl_mvm_resume()
2035 static int iwl_mvm_resume_d3(struct iwl_mvm *mvm) in iwl_mvm_resume_d3() argument
2037 iwl_trans_resume(mvm->trans); in iwl_mvm_resume_d3()
2039 return __iwl_mvm_resume(mvm, false); in iwl_mvm_resume_d3()
2044 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_resume() local
2047 ret = iwl_mvm_resume_d3(mvm); in iwl_mvm_resume()
2049 mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_DISABLED; in iwl_mvm_resume()
2051 iwl_mvm_resume_tcm(mvm); in iwl_mvm_resume()
2053 iwl_fw_runtime_resume(&mvm->fwrt); in iwl_mvm_resume()
2060 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_set_wakeup() local
2062 device_set_wakeup_enable(mvm->trans->dev, enabled); in iwl_mvm_set_wakeup()
2068 struct iwl_mvm *mvm = inode->i_private; in iwl_mvm_d3_test_open() local
2071 if (mvm->d3_test_active) in iwl_mvm_d3_test_open()
2078 mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_D3; in iwl_mvm_d3_test_open()
2080 iwl_mvm_pause_tcm(mvm, true); in iwl_mvm_d3_test_open()
2082 iwl_fw_runtime_suspend(&mvm->fwrt); in iwl_mvm_d3_test_open()
2086 err = __iwl_mvm_suspend(mvm->hw, mvm->hw->wiphy->wowlan_config, true); in iwl_mvm_d3_test_open()
2093 mvm->d3_test_active = true; in iwl_mvm_d3_test_open()
2094 mvm->keep_vif = NULL; in iwl_mvm_d3_test_open()
2101 struct iwl_mvm *mvm = file->private_data; in iwl_mvm_d3_test_read() local
2106 if (mvm->d3_test_pme_ptr) { in iwl_mvm_d3_test_read()
2107 pme_asserted = iwl_trans_read_mem32(mvm->trans, in iwl_mvm_d3_test_read()
2108 mvm->d3_test_pme_ptr); in iwl_mvm_d3_test_read()
2133 struct iwl_mvm *mvm = inode->i_private; in iwl_mvm_d3_test_release() local
2134 bool unified_image = fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_d3_test_release()
2137 mvm->d3_test_active = false; in iwl_mvm_d3_test_release()
2139 iwl_fw_dbg_read_d3_debug_data(&mvm->fwrt); in iwl_mvm_d3_test_release()
2142 __iwl_mvm_resume(mvm, true); in iwl_mvm_d3_test_release()
2145 iwl_mvm_resume_tcm(mvm); in iwl_mvm_d3_test_release()
2147 iwl_fw_runtime_resume(&mvm->fwrt); in iwl_mvm_d3_test_release()
2149 mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_DISABLED; in iwl_mvm_d3_test_release()
2151 iwl_abort_notification_waits(&mvm->notif_wait); in iwl_mvm_d3_test_release()
2155 ieee80211_restart_hw(mvm->hw); in iwl_mvm_d3_test_release()
2158 while (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) && in iwl_mvm_d3_test_release()
2165 IWL_ERR(mvm, "Timed out waiting for HW restart!\n"); in iwl_mvm_d3_test_release()
2169 mvm->hw, IEEE80211_IFACE_ITER_NORMAL, in iwl_mvm_d3_test_release()
2170 iwl_mvm_d3_test_disconn_work_iter, mvm->keep_vif); in iwl_mvm_d3_test_release()