Lines Matching refs:mvm

23 	struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);  in iwl_mvm_set_rekey_data()  local
26 mutex_lock(&mvm->mutex); in iwl_mvm_set_rekey_data()
37 mutex_unlock(&mvm->mutex); in iwl_mvm_set_rekey_data()
115 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_wowlan_program_keys() local
155 mutex_lock(&mvm->mutex); in iwl_mvm_wowlan_program_keys()
156 ret = iwl_mvm_send_cmd_pdu(mvm, WEP_KEY, 0, sizeof(wkc), &wkc); in iwl_mvm_wowlan_program_keys()
159 mvm->ptk_ivlen = key->iv_len; in iwl_mvm_wowlan_program_keys()
160 mvm->ptk_icvlen = key->icv_len; in iwl_mvm_wowlan_program_keys()
161 mvm->gtk_ivlen = key->iv_len; in iwl_mvm_wowlan_program_keys()
162 mvm->gtk_icvlen = key->icv_len; in iwl_mvm_wowlan_program_keys()
163 mutex_unlock(&mvm->mutex); in iwl_mvm_wowlan_program_keys()
190 mutex_lock(&mvm->mutex); in iwl_mvm_wowlan_program_keys()
196 mvm->ptk_ivlen = key->iv_len; in iwl_mvm_wowlan_program_keys()
197 mvm->ptk_icvlen = key->icv_len; in iwl_mvm_wowlan_program_keys()
198 ret = iwl_mvm_set_sta_key(mvm, vif, sta, key, 0); in iwl_mvm_wowlan_program_keys()
206 mvm->gtk_ivlen = key->iv_len; in iwl_mvm_wowlan_program_keys()
207 mvm->gtk_icvlen = key->icv_len; in iwl_mvm_wowlan_program_keys()
208 ret = iwl_mvm_set_sta_key(mvm, vif, sta, key, 1); in iwl_mvm_wowlan_program_keys()
210 mutex_unlock(&mvm->mutex); in iwl_mvm_wowlan_program_keys()
225 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_wowlan_get_rsc_tsc_data() local
288 if (sta && iwl_mvm_has_new_rx_api(mvm)) { in iwl_mvm_wowlan_get_rsc_tsc_data()
303 mvm->trans->num_rx_queues); in iwl_mvm_wowlan_get_rsc_tsc_data()
344 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_wowlan_get_rsc_v5_data() local
424 mvm->trans->num_rx_queues); in iwl_mvm_wowlan_get_rsc_v5_data()
452 static int iwl_mvm_wowlan_config_rsc_tsc(struct iwl_mvm *mvm, in iwl_mvm_wowlan_config_rsc_tsc() argument
456 int ver = iwl_fw_lookup_cmd_ver(mvm->fw, WOWLAN_TSC_RSC_PARAM, in iwl_mvm_wowlan_config_rsc_tsc()
475 ieee80211_iter_keys(mvm->hw, vif, in iwl_mvm_wowlan_config_rsc_tsc()
480 ret = iwl_mvm_send_cmd_pdu(mvm, WOWLAN_TSC_RSC_PARAM, in iwl_mvm_wowlan_config_rsc_tsc()
502 ieee80211_iter_keys(mvm->hw, vif, in iwl_mvm_wowlan_config_rsc_tsc()
507 ret = iwl_mvm_send_cmd_pdu(mvm, WOWLAN_TSC_RSC_PARAM, in iwl_mvm_wowlan_config_rsc_tsc()
623 static int iwl_mvm_send_patterns_v1(struct iwl_mvm *mvm, in iwl_mvm_send_patterns_v1() argument
658 err = iwl_mvm_send_cmd(mvm, &cmd); in iwl_mvm_send_patterns_v1()
663 static int iwl_mvm_send_patterns(struct iwl_mvm *mvm, in iwl_mvm_send_patterns() argument
674 int ver = iwl_fw_lookup_cmd_ver(mvm->fw, cmd.id, in iwl_mvm_send_patterns()
708 err = iwl_mvm_send_cmd(mvm, &cmd); in iwl_mvm_send_patterns()
713 static int iwl_mvm_d3_reprogram(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_d3_reprogram() argument
726 if (WARN_ON_ONCE(iwl_mvm_is_cdb_supported(mvm))) in iwl_mvm_d3_reprogram()
744 ret = iwl_mvm_phy_ctxt_add(mvm, mvmvif->phy_ctxt, &chandef, in iwl_mvm_d3_reprogram()
755 ret = iwl_mvm_mac_ctxt_add(mvm, vif); in iwl_mvm_d3_reprogram()
773 ret = iwl_mvm_send_cmd_pdu_status(mvm, BINDING_CONTEXT_CMD, in iwl_mvm_d3_reprogram()
777 IWL_ERR(mvm, "Failed to add binding: %d\n", ret); in iwl_mvm_d3_reprogram()
782 IWL_ERR(mvm, "Binding command failed: %u\n", status); in iwl_mvm_d3_reprogram()
786 ret = iwl_mvm_sta_send_to_fw(mvm, ap_sta, false, 0); in iwl_mvm_d3_reprogram()
789 rcu_assign_pointer(mvm->fw_id_to_mac_id[mvmvif->ap_sta_id], ap_sta); in iwl_mvm_d3_reprogram()
791 ret = iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); in iwl_mvm_d3_reprogram()
796 quota = iwl_mvm_quota_cmd_get_quota(mvm, &quota_cmd, 0); in iwl_mvm_d3_reprogram()
804 quota = iwl_mvm_quota_cmd_get_quota(mvm, &quota_cmd, i); in iwl_mvm_d3_reprogram()
808 ret = iwl_mvm_send_cmd_pdu(mvm, TIME_QUOTA_CMD, 0, in iwl_mvm_d3_reprogram()
809 iwl_mvm_quota_cmd_size(mvm), &quota_cmd); in iwl_mvm_d3_reprogram()
811 IWL_ERR(mvm, "Failed to send quota: %d\n", ret); in iwl_mvm_d3_reprogram()
813 if (iwl_mvm_is_lar_supported(mvm) && iwl_mvm_init_fw_regd(mvm)) in iwl_mvm_d3_reprogram()
814 IWL_ERR(mvm, "Failed to initialize D3 LAR information\n"); in iwl_mvm_d3_reprogram()
819 static int iwl_mvm_get_last_nonqos_seq(struct iwl_mvm *mvm, in iwl_mvm_get_last_nonqos_seq() argument
839 err = iwl_mvm_send_cmd(mvm, &cmd); in iwl_mvm_get_last_nonqos_seq()
856 void iwl_mvm_set_last_nonqos_seq(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_set_last_nonqos_seq() argument
873 if (iwl_mvm_send_cmd_pdu(mvm, NON_QOS_TX_COUNTER_CMD, 0, in iwl_mvm_set_last_nonqos_seq()
875 IWL_ERR(mvm, "failed to set non-QoS seqno\n"); in iwl_mvm_set_last_nonqos_seq()
878 static int iwl_mvm_switch_to_d3(struct iwl_mvm *mvm) in iwl_mvm_switch_to_d3() argument
880 iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_REGULAR, true); in iwl_mvm_switch_to_d3()
882 iwl_mvm_stop_device(mvm); in iwl_mvm_switch_to_d3()
893 set_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status); in iwl_mvm_switch_to_d3()
896 memset(mvm->fw_key_table, 0, sizeof(mvm->fw_key_table)); in iwl_mvm_switch_to_d3()
898 mvm->ptk_ivlen = 0; in iwl_mvm_switch_to_d3()
899 mvm->ptk_icvlen = 0; in iwl_mvm_switch_to_d3()
900 mvm->ptk_ivlen = 0; in iwl_mvm_switch_to_d3()
901 mvm->ptk_icvlen = 0; in iwl_mvm_switch_to_d3()
903 return iwl_mvm_load_d3_fw(mvm); in iwl_mvm_switch_to_d3()
907 iwl_mvm_get_wowlan_config(struct iwl_mvm *mvm, in iwl_mvm_get_wowlan_config() argument
922 if (iwl_fw_lookup_cmd_ver(mvm->fw, WOWLAN_CONFIGURATION, 0) < 6) { in iwl_mvm_get_wowlan_config()
924 int ret = iwl_mvm_get_last_nonqos_seq(mvm, vif); in iwl_mvm_get_wowlan_config()
981 static int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm, in iwl_mvm_wowlan_config_key_params() argument
984 bool unified = fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_wowlan_config_key_params()
1004 ieee80211_iter_keys(mvm->hw, vif, iwl_mvm_wowlan_program_keys, in iwl_mvm_wowlan_config_key_params()
1011 ret = iwl_mvm_wowlan_config_rsc_tsc(mvm, vif); in iwl_mvm_wowlan_config_key_params()
1015 if (!fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_wowlan_config_key_params()
1017 int ver = iwl_fw_lookup_cmd_ver(mvm->fw, WOWLAN_TKIP_PARAM, in iwl_mvm_wowlan_config_key_params()
1033 ieee80211_iter_keys(mvm->hw, vif, iwl_mvm_wowlan_get_tkip_data, in iwl_mvm_wowlan_config_key_params()
1038 ret = iwl_mvm_send_cmd_pdu(mvm, in iwl_mvm_wowlan_config_key_params()
1056 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, in iwl_mvm_wowlan_config_key_params()
1063 ieee80211_iter_keys(mvm->hw, vif, iwl_mvm_wowlan_gtk_type_iter, in iwl_mvm_wowlan_config_key_params()
1090 IWL_DEBUG_WOWLAN(mvm, "setting akm %d\n", in iwl_mvm_wowlan_config_key_params()
1093 ret = iwl_mvm_send_cmd_pdu(mvm, WOWLAN_KEK_KCK_MATERIAL, in iwl_mvm_wowlan_config_key_params()
1103 iwl_mvm_wowlan_config(struct iwl_mvm *mvm, in iwl_mvm_wowlan_config() argument
1110 bool unified_image = fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_wowlan_config()
1113 mvm->offload_tid = wowlan_config_cmd->offloading_tid; in iwl_mvm_wowlan_config()
1116 ret = iwl_mvm_switch_to_d3(mvm); in iwl_mvm_wowlan_config()
1120 ret = iwl_mvm_d3_reprogram(mvm, vif, ap_sta); in iwl_mvm_wowlan_config()
1130 mutex_unlock(&mvm->mutex); in iwl_mvm_wowlan_config()
1131 ret = iwl_mvm_wowlan_config_key_params(mvm, vif); in iwl_mvm_wowlan_config()
1132 mutex_lock(&mvm->mutex); in iwl_mvm_wowlan_config()
1136 ret = iwl_mvm_send_cmd_pdu(mvm, WOWLAN_CONFIGURATION, 0, in iwl_mvm_wowlan_config()
1142 if (fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_wowlan_config()
1144 ret = iwl_mvm_send_patterns(mvm, vif, wowlan); in iwl_mvm_wowlan_config()
1146 ret = iwl_mvm_send_patterns_v1(mvm, wowlan); in iwl_mvm_wowlan_config()
1150 return iwl_mvm_send_proto_offload(mvm, vif, false, true, 0); in iwl_mvm_wowlan_config()
1154 iwl_mvm_netdetect_config(struct iwl_mvm *mvm, in iwl_mvm_netdetect_config() argument
1160 bool unified_image = fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_netdetect_config()
1164 ret = iwl_mvm_switch_to_d3(mvm); in iwl_mvm_netdetect_config()
1173 ret = iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_SCHED, true); in iwl_mvm_netdetect_config()
1178 ret = iwl_mvm_sched_scan_start(mvm, vif, nd_config, &mvm->nd_ies, in iwl_mvm_netdetect_config()
1183 if (WARN_ON(mvm->nd_match_sets || mvm->nd_channels)) in iwl_mvm_netdetect_config()
1188 mvm->nd_match_sets = kmemdup(nd_config->match_sets, in iwl_mvm_netdetect_config()
1192 if (mvm->nd_match_sets) in iwl_mvm_netdetect_config()
1193 mvm->n_nd_match_sets = nd_config->n_match_sets; in iwl_mvm_netdetect_config()
1197 mvm->nd_channels = kmemdup(nd_config->channels, in iwl_mvm_netdetect_config()
1201 if (mvm->nd_channels) in iwl_mvm_netdetect_config()
1202 mvm->n_nd_channels = nd_config->n_channels; in iwl_mvm_netdetect_config()
1207 static void iwl_mvm_free_nd(struct iwl_mvm *mvm) in iwl_mvm_free_nd() argument
1209 kfree(mvm->nd_match_sets); in iwl_mvm_free_nd()
1210 mvm->nd_match_sets = NULL; in iwl_mvm_free_nd()
1211 mvm->n_nd_match_sets = 0; in iwl_mvm_free_nd()
1212 kfree(mvm->nd_channels); in iwl_mvm_free_nd()
1213 mvm->nd_channels = NULL; in iwl_mvm_free_nd()
1214 mvm->n_nd_channels = 0; in iwl_mvm_free_nd()
1221 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in __iwl_mvm_suspend() local
1241 bool unified_image = fw_has_capa(&mvm->fw->ucode_capa, in __iwl_mvm_suspend()
1253 mutex_lock(&mvm->mutex); in __iwl_mvm_suspend()
1255 set_bit(IWL_MVM_STATUS_IN_D3, &mvm->status); in __iwl_mvm_suspend()
1259 vif = iwl_mvm_get_bss_vif(mvm); in __iwl_mvm_suspend()
1275 mvm, wowlan, wowlan->nd_config, vif); in __iwl_mvm_suspend()
1279 mvm->net_detect = true; in __iwl_mvm_suspend()
1286 mvm->fw_id_to_mac_id[mvmvif->ap_sta_id], in __iwl_mvm_suspend()
1287 lockdep_is_held(&mvm->mutex)); in __iwl_mvm_suspend()
1293 ret = iwl_mvm_get_wowlan_config(mvm, wowlan, &wowlan_config_cmd, in __iwl_mvm_suspend()
1297 ret = iwl_mvm_wowlan_config(mvm, wowlan, &wowlan_config_cmd, in __iwl_mvm_suspend()
1302 mvm->net_detect = false; in __iwl_mvm_suspend()
1305 ret = iwl_mvm_power_update_device(mvm); in __iwl_mvm_suspend()
1309 ret = iwl_mvm_power_update_mac(mvm); in __iwl_mvm_suspend()
1314 if (mvm->d3_wake_sysassert) in __iwl_mvm_suspend()
1324 if (mvm->trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_9000) in __iwl_mvm_suspend()
1325 iwl_fw_dbg_stop_restart_recording(&mvm->fwrt, NULL, true); in __iwl_mvm_suspend()
1327 mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_D3; in __iwl_mvm_suspend()
1330 ret = iwl_mvm_send_cmd(mvm, &d3_cfg_cmd); in __iwl_mvm_suspend()
1336 mvm->d3_test_pme_ptr = in __iwl_mvm_suspend()
1342 clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status); in __iwl_mvm_suspend()
1344 ret = iwl_trans_d3_suspend(mvm->trans, test, !unified_image); in __iwl_mvm_suspend()
1347 iwl_mvm_free_nd(mvm); in __iwl_mvm_suspend()
1350 if (mvm->fw_restart > 0) { in __iwl_mvm_suspend()
1351 mvm->fw_restart--; in __iwl_mvm_suspend()
1352 ieee80211_restart_hw(mvm->hw); in __iwl_mvm_suspend()
1356 clear_bit(IWL_MVM_STATUS_IN_D3, &mvm->status); in __iwl_mvm_suspend()
1359 mutex_unlock(&mvm->mutex); in __iwl_mvm_suspend()
1366 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_suspend() local
1368 iwl_mvm_pause_tcm(mvm, true); in iwl_mvm_suspend()
1370 iwl_fw_runtime_suspend(&mvm->fwrt); in iwl_mvm_suspend()
1433 static void iwl_mvm_report_wakeup_reasons(struct iwl_mvm *mvm, in iwl_mvm_report_wakeup_reasons() argument
1449 pm_wakeup_event(mvm->dev, 0); in iwl_mvm_report_wakeup_reasons()
1514 ivlen = mvm->gtk_ivlen; in iwl_mvm_report_wakeup_reasons()
1515 icvlen += mvm->gtk_icvlen; in iwl_mvm_report_wakeup_reasons()
1517 ivlen = mvm->ptk_ivlen; in iwl_mvm_report_wakeup_reasons()
1518 icvlen += mvm->ptk_icvlen; in iwl_mvm_report_wakeup_reasons()
1607 static void iwl_mvm_set_aes_ptk_rx_seq(struct iwl_mvm *mvm, in iwl_mvm_set_aes_ptk_rx_seq() argument
1618 if (!iwl_mvm_has_new_rx_api(mvm)) in iwl_mvm_set_aes_ptk_rx_seq()
1632 for (i = 1; i < mvm->trans->num_rx_queues; i++) in iwl_mvm_set_aes_ptk_rx_seq()
1770 struct iwl_mvm *mvm; member
1822 iwl_mvm_set_aes_ptk_rx_seq(data->mvm, status, sta, key); in iwl_mvm_d3_update_keys()
1847 static bool iwl_mvm_setup_connection_keep(struct iwl_mvm *mvm, in iwl_mvm_setup_connection_keep() argument
1853 .mvm = mvm, in iwl_mvm_setup_connection_keep()
1868 ieee80211_iter_keys(mvm->hw, vif, in iwl_mvm_setup_connection_keep()
1883 ieee80211_iter_keys(mvm->hw, vif, in iwl_mvm_setup_connection_keep()
1886 IWL_DEBUG_WOWLAN(mvm, "num of GTK rekeying %d\n", in iwl_mvm_setup_connection_keep()
1900 IWL_DEBUG_WOWLAN(mvm, in iwl_mvm_setup_connection_keep()
1937 if (iwl_fw_lookup_notif_ver(mvm->fw, LONG_GROUP, in iwl_mvm_setup_connection_keep()
1950 iwl_mvm_parse_wowlan_status_common_ ## _ver(struct iwl_mvm *mvm, \
1958 IWL_ERR(mvm, "Invalid WoWLAN status response!\n"); \
1964 IWL_ERR(mvm, "Invalid WoWLAN status response!\n"); \
2058 iwl_mvm_send_wowlan_get_status(struct iwl_mvm *mvm, u8 sta_id) in iwl_mvm_send_wowlan_get_status() argument
2072 u8 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, cmd.id, in iwl_mvm_send_wowlan_get_status()
2078 lockdep_assert_held(&mvm->mutex); in iwl_mvm_send_wowlan_get_status()
2080 ret = iwl_mvm_send_cmd(mvm, &cmd); in iwl_mvm_send_wowlan_get_status()
2082 IWL_ERR(mvm, "failed to query wakeup status (%d)\n", ret); in iwl_mvm_send_wowlan_get_status()
2089 notif_ver = iwl_fw_lookup_notif_ver(mvm->fw, LONG_GROUP, in iwl_mvm_send_wowlan_get_status()
2092 notif_ver = iwl_fw_lookup_notif_ver(mvm->fw, LEGACY_GROUP, in iwl_mvm_send_wowlan_get_status()
2095 if (!fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_send_wowlan_get_status()
2099 status = iwl_mvm_parse_wowlan_status_common_v6(mvm, v6, len); in iwl_mvm_send_wowlan_get_status()
2130 status = iwl_mvm_parse_wowlan_status_common_v7(mvm, v7, len); in iwl_mvm_send_wowlan_get_status()
2143 status = iwl_mvm_parse_wowlan_status_common_v9(mvm, v9, len); in iwl_mvm_send_wowlan_get_status()
2155 status = iwl_mvm_parse_wowlan_status_common_v12(mvm, v12, len); in iwl_mvm_send_wowlan_get_status()
2165 IWL_ERR(mvm, in iwl_mvm_send_wowlan_get_status()
2177 iwl_mvm_get_wakeup_status(struct iwl_mvm *mvm, u8 sta_id) in iwl_mvm_get_wakeup_status() argument
2179 u8 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, OFFLOADS_QUERY_CMD, in iwl_mvm_get_wakeup_status()
2184 if (!mvm->net_detect) { in iwl_mvm_get_wakeup_status()
2186 int ret = iwl_mvm_send_cmd_pdu(mvm, OFFLOADS_QUERY_CMD, 0, in iwl_mvm_get_wakeup_status()
2189 IWL_ERR(mvm, "failed to query offload statistics (%d)\n", ret); in iwl_mvm_get_wakeup_status()
2192 return iwl_mvm_send_wowlan_get_status(mvm, sta_id); in iwl_mvm_get_wakeup_status()
2196 static bool iwl_mvm_query_wakeup_reasons(struct iwl_mvm *mvm, in iwl_mvm_query_wakeup_reasons() argument
2205 status = iwl_mvm_get_wakeup_status(mvm, mvmvif->ap_sta_id); in iwl_mvm_query_wakeup_reasons()
2209 IWL_DEBUG_WOWLAN(mvm, "wakeup reason 0x%x\n", in iwl_mvm_query_wakeup_reasons()
2213 mvm_ap_sta = iwl_mvm_sta_from_staid_protected(mvm, 0); in iwl_mvm_query_wakeup_reasons()
2224 if (mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_22000) { in iwl_mvm_query_wakeup_reasons()
2225 i = mvm->offload_tid; in iwl_mvm_query_wakeup_reasons()
2226 iwl_trans_set_q_ptrs(mvm->trans, in iwl_mvm_query_wakeup_reasons()
2232 mutex_unlock(&mvm->mutex); in iwl_mvm_query_wakeup_reasons()
2234 iwl_mvm_report_wakeup_reasons(mvm, vif, status); in iwl_mvm_query_wakeup_reasons()
2236 keep = iwl_mvm_setup_connection_keep(mvm, vif, status); in iwl_mvm_query_wakeup_reasons()
2244 mutex_unlock(&mvm->mutex); in iwl_mvm_query_wakeup_reasons()
2257 iwl_mvm_netdetect_query_results(struct iwl_mvm *mvm, in iwl_mvm_netdetect_query_results() argument
2267 int max_profiles = iwl_umac_scan_get_max_profiles(mvm->fw); in iwl_mvm_netdetect_query_results()
2269 ret = iwl_mvm_send_cmd(mvm, &cmd); in iwl_mvm_netdetect_query_results()
2271 IWL_ERR(mvm, "failed to query matched profiles (%d)\n", ret); in iwl_mvm_netdetect_query_results()
2275 if (fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_netdetect_query_results()
2288 IWL_ERR(mvm, "Invalid scan offload profiles query response!\n"); in iwl_mvm_netdetect_query_results()
2299 mvm->last_netdetect_scans = le32_to_cpu(query->n_scans_done); in iwl_mvm_netdetect_query_results()
2307 static int iwl_mvm_query_num_match_chans(struct iwl_mvm *mvm, in iwl_mvm_query_num_match_chans() argument
2313 if (fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_query_num_match_chans()
2331 static void iwl_mvm_query_set_freqs(struct iwl_mvm *mvm, in iwl_mvm_query_set_freqs() argument
2338 if (fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_query_set_freqs()
2346 mvm->nd_channels[i]->center_freq; in iwl_mvm_query_set_freqs()
2354 mvm->nd_channels[i]->center_freq; in iwl_mvm_query_set_freqs()
2358 static void iwl_mvm_query_netdetect_reasons(struct iwl_mvm *mvm, in iwl_mvm_query_netdetect_reasons() argument
2372 status = iwl_mvm_get_wakeup_status(mvm, IWL_MVM_INVALID_STA); in iwl_mvm_query_netdetect_reasons()
2384 ret = iwl_mvm_netdetect_query_results(mvm, &query); in iwl_mvm_query_netdetect_reasons()
2391 if (mvm->n_nd_match_sets) { in iwl_mvm_query_netdetect_reasons()
2394 IWL_ERR(mvm, "no net detect match information available\n"); in iwl_mvm_query_netdetect_reasons()
2403 for_each_set_bit(i, &matched_profiles, mvm->n_nd_match_sets) { in iwl_mvm_query_netdetect_reasons()
2407 n_channels = iwl_mvm_query_num_match_chans(mvm, &query, i); in iwl_mvm_query_netdetect_reasons()
2419 idx = mvm->n_nd_match_sets - i - 1; in iwl_mvm_query_netdetect_reasons()
2420 match->ssid.ssid_len = mvm->nd_match_sets[idx].ssid.ssid_len; in iwl_mvm_query_netdetect_reasons()
2421 memcpy(match->ssid.ssid, mvm->nd_match_sets[idx].ssid.ssid, in iwl_mvm_query_netdetect_reasons()
2424 if (mvm->n_nd_channels < n_channels) in iwl_mvm_query_netdetect_reasons()
2427 iwl_mvm_query_set_freqs(mvm, &query, match, i); in iwl_mvm_query_netdetect_reasons()
2433 iwl_mvm_free_nd(mvm); in iwl_mvm_query_netdetect_reasons()
2435 mutex_unlock(&mvm->mutex); in iwl_mvm_query_netdetect_reasons()
2475 static bool iwl_mvm_check_rt_status(struct iwl_mvm *mvm, in iwl_mvm_check_rt_status() argument
2481 if (iwl_mvm_rt_status(mvm->trans, in iwl_mvm_check_rt_status()
2482 mvm->trans->dbg.lmac_error_event_table[0], in iwl_mvm_check_rt_status()
2495 if (iwl_mvm_rt_status(mvm->trans, in iwl_mvm_check_rt_status()
2496 mvm->trans->dbg.lmac_error_event_table[1], NULL)) in iwl_mvm_check_rt_status()
2500 if (iwl_mvm_rt_status(mvm->trans, in iwl_mvm_check_rt_status()
2501 mvm->trans->dbg.umac_error_event_table, NULL)) in iwl_mvm_check_rt_status()
2507 static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test) in __iwl_mvm_resume() argument
2513 bool unified_image = fw_has_capa(&mvm->fw->ucode_capa, in __iwl_mvm_resume()
2515 bool d0i3_first = fw_has_capa(&mvm->fw->ucode_capa, in __iwl_mvm_resume()
2518 mutex_lock(&mvm->mutex); in __iwl_mvm_resume()
2520 mvm->last_reset_or_resume_time_jiffies = jiffies; in __iwl_mvm_resume()
2523 vif = iwl_mvm_get_bss_vif(mvm); in __iwl_mvm_resume()
2527 iwl_fw_dbg_read_d3_debug_data(&mvm->fwrt); in __iwl_mvm_resume()
2529 if (iwl_mvm_check_rt_status(mvm, vif)) { in __iwl_mvm_resume()
2530 set_bit(STATUS_FW_ERROR, &mvm->trans->status); in __iwl_mvm_resume()
2531 iwl_mvm_dump_nic_error_log(mvm); in __iwl_mvm_resume()
2532 iwl_dbg_tlv_time_point(&mvm->fwrt, in __iwl_mvm_resume()
2534 iwl_fw_dbg_collect_desc(&mvm->fwrt, &iwl_dump_desc_assert, in __iwl_mvm_resume()
2540 ret = iwl_trans_d3_resume(mvm->trans, &d3_status, test, !unified_image); in __iwl_mvm_resume()
2545 IWL_INFO(mvm, "Device was reset during suspend\n"); in __iwl_mvm_resume()
2556 ret = iwl_mvm_send_cmd(mvm, &cmd); in __iwl_mvm_resume()
2558 IWL_ERR(mvm, "Failed to send D0I3_END_CMD first (%d)\n", in __iwl_mvm_resume()
2562 switch (mvm->cmd_ver.d0i3_resp) { in __iwl_mvm_resume()
2568 IWL_ERR(mvm, in __iwl_mvm_resume()
2575 iwl_write32(mvm->trans, CSR_RESET, in __iwl_mvm_resume()
2586 mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_DISABLED; in __iwl_mvm_resume()
2592 iwl_mvm_update_changed_regdom(mvm); in __iwl_mvm_resume()
2595 iwl_mvm_ppag_send_cmd(mvm); in __iwl_mvm_resume()
2599 iwl_mvm_sar_select_profile(mvm, 1, 1); in __iwl_mvm_resume()
2601 if (mvm->net_detect) { in __iwl_mvm_resume()
2609 ret = iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_NETDETECT, in __iwl_mvm_resume()
2612 iwl_mvm_query_netdetect_reasons(mvm, vif); in __iwl_mvm_resume()
2616 keep = iwl_mvm_query_wakeup_reasons(mvm, vif); in __iwl_mvm_resume()
2619 mvm->keep_vif = vif; in __iwl_mvm_resume()
2626 iwl_mvm_free_nd(mvm); in __iwl_mvm_resume()
2627 mutex_unlock(&mvm->mutex); in __iwl_mvm_resume()
2631 ieee80211_iterate_active_interfaces_mtx(mvm->hw, in __iwl_mvm_resume()
2636 clear_bit(IWL_MVM_STATUS_IN_D3, &mvm->status); in __iwl_mvm_resume()
2644 ret = iwl_mvm_send_cmd_pdu(mvm, D0I3_END_CMD, 0, 0, NULL); in __iwl_mvm_resume()
2654 set_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status); in __iwl_mvm_resume()
2657 mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_DISABLED; in __iwl_mvm_resume()
2664 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_resume() local
2667 ret = __iwl_mvm_resume(mvm, false); in iwl_mvm_resume()
2669 iwl_mvm_resume_tcm(mvm); in iwl_mvm_resume()
2671 iwl_fw_runtime_resume(&mvm->fwrt); in iwl_mvm_resume()
2678 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_set_wakeup() local
2680 device_set_wakeup_enable(mvm->trans->dev, enabled); in iwl_mvm_set_wakeup()
2686 struct iwl_mvm *mvm = inode->i_private; in iwl_mvm_d3_test_open() local
2689 if (mvm->d3_test_active) in iwl_mvm_d3_test_open()
2694 iwl_mvm_pause_tcm(mvm, true); in iwl_mvm_d3_test_open()
2696 iwl_fw_runtime_suspend(&mvm->fwrt); in iwl_mvm_d3_test_open()
2700 wiphy_lock(mvm->hw->wiphy); in iwl_mvm_d3_test_open()
2701 err = __iwl_mvm_suspend(mvm->hw, mvm->hw->wiphy->wowlan_config, true); in iwl_mvm_d3_test_open()
2702 wiphy_unlock(mvm->hw->wiphy); in iwl_mvm_d3_test_open()
2709 mvm->d3_test_active = true; in iwl_mvm_d3_test_open()
2710 mvm->keep_vif = NULL; in iwl_mvm_d3_test_open()
2717 struct iwl_mvm *mvm = file->private_data; in iwl_mvm_d3_test_read() local
2722 if (mvm->d3_test_pme_ptr) { in iwl_mvm_d3_test_read()
2723 pme_asserted = iwl_trans_read_mem32(mvm->trans, in iwl_mvm_d3_test_read()
2724 mvm->d3_test_pme_ptr); in iwl_mvm_d3_test_read()
2749 struct iwl_mvm *mvm = inode->i_private; in iwl_mvm_d3_test_release() local
2750 bool unified_image = fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_d3_test_release()
2753 mvm->d3_test_active = false; in iwl_mvm_d3_test_release()
2755 iwl_fw_dbg_read_d3_debug_data(&mvm->fwrt); in iwl_mvm_d3_test_release()
2758 wiphy_lock(mvm->hw->wiphy); in iwl_mvm_d3_test_release()
2759 __iwl_mvm_resume(mvm, true); in iwl_mvm_d3_test_release()
2760 wiphy_unlock(mvm->hw->wiphy); in iwl_mvm_d3_test_release()
2763 iwl_mvm_resume_tcm(mvm); in iwl_mvm_d3_test_release()
2765 iwl_fw_runtime_resume(&mvm->fwrt); in iwl_mvm_d3_test_release()
2767 iwl_abort_notification_waits(&mvm->notif_wait); in iwl_mvm_d3_test_release()
2771 ieee80211_restart_hw(mvm->hw); in iwl_mvm_d3_test_release()
2774 while (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) && in iwl_mvm_d3_test_release()
2781 IWL_ERR(mvm, "Timed out waiting for HW restart!\n"); in iwl_mvm_d3_test_release()
2785 mvm->hw, IEEE80211_IFACE_ITER_NORMAL, in iwl_mvm_d3_test_release()
2786 iwl_mvm_d3_test_disconn_work_iter, mvm->keep_vif); in iwl_mvm_d3_test_release()