Lines Matching refs:mvm
21 #include "mvm.h"
36 static int iwl_send_tx_ant_cfg(struct iwl_mvm *mvm, u8 valid_tx_ant)
42 IWL_DEBUG_FW(mvm, "select valid tx ant: %u\n", valid_tx_ant);
43 return iwl_mvm_send_cmd_pdu(mvm, TX_ANT_CONFIGURATION_CMD, 0,
47 static int iwl_send_rss_cfg_cmd(struct iwl_mvm *mvm)
60 if (mvm->trans->num_rx_queues == 1)
66 1 + (i % (mvm->trans->num_rx_queues - 1));
69 return iwl_mvm_send_cmd_pdu(mvm, RSS_CONFIG_CMD, 0, sizeof(cmd), &cmd);
72 static int iwl_mvm_send_dqa_cmd(struct iwl_mvm *mvm)
80 ret = iwl_mvm_send_cmd_pdu(mvm, cmd_id, 0, sizeof(dqa_cmd), &dqa_cmd);
82 IWL_ERR(mvm, "Failed to send DQA enabling command: %d\n", ret);
84 IWL_DEBUG_FW(mvm, "Working in DQA mode\n");
89 void iwl_mvm_mfu_assert_dump_notif(struct iwl_mvm *mvm,
96 IWL_INFO(mvm, "MFUART assert id 0x%x occurred\n",
104 struct iwl_mvm *mvm =
112 u32 version = iwl_fw_lookup_notif_ver(mvm->fw, LEGACY_GROUP,
124 mvm->trans->dbg.imr_data.imr_enable =
126 mvm->trans->dbg.imr_data.imr_size =
128 mvm->trans->dbg.imr_data.imr2sram_remainbyte =
129 mvm->trans->dbg.imr_data.imr_size;
130 mvm->trans->dbg.imr_data.imr_base_addr =
132 mvm->trans->dbg.imr_data.imr_curr_addr =
133 le64_to_cpu(mvm->trans->dbg.imr_data.imr_base_addr);
134 IWL_DEBUG_FW(mvm, "IMR Enabled: 0x0%x size 0x0%x Address 0x%016llx\n",
135 mvm->trans->dbg.imr_data.imr_enable,
136 mvm->trans->dbg.imr_data.imr_size,
137 le64_to_cpu(mvm->trans->dbg.imr_data.imr_base_addr));
139 if (!mvm->trans->dbg.imr_data.imr_enable) {
140 for (i = 0; i < ARRAY_SIZE(mvm->trans->dbg.active_regions); i++) {
144 reg_tlv = mvm->trans->dbg.active_regions[i];
155 mvm->trans->dbg.unsupported_region_msk |= BIT(i);
174 mvm->trans->sku_id[0] = le32_to_cpu(palive->sku_id.data[0]);
175 mvm->trans->sku_id[1] = le32_to_cpu(palive->sku_id.data[1]);
176 mvm->trans->sku_id[2] = le32_to_cpu(palive->sku_id.data[2]);
178 IWL_DEBUG_FW(mvm, "Got sku_id: 0x0%x 0x0%x 0x0%x\n",
179 mvm->trans->sku_id[0],
180 mvm->trans->sku_id[1],
181 mvm->trans->sku_id[2]);
213 iwl_fw_lmac1_set_alive_err_table(mvm->trans, lmac_error_event_table);
216 mvm->trans->dbg.lmac_error_event_table[1] =
224 mvm->trans->cfg->min_umac_error_event_table) {
225 iwl_fw_umac_set_alive_err_table(mvm->trans,
228 IWL_ERR(mvm,
231 (mvm->fwrt.cur_fw_img == IWL_UCODE_INIT) ?
239 IWL_DEBUG_FW(mvm,
244 IWL_DEBUG_FW(mvm, "Alive ucode CDB\n");
246 IWL_DEBUG_FW(mvm,
251 iwl_fwrt_update_fw_versions(&mvm->fwrt, lmac1, umac);
279 static void iwl_mvm_print_pd_notification(struct iwl_mvm *mvm)
282 IWL_ERR(mvm, #reg_name ": 0x%x\n", iwl_read_umac_prph(trans, reg_name))
284 struct iwl_trans *trans = mvm->trans;
302 static int iwl_mvm_load_ucode_wait_alive(struct iwl_mvm *mvm,
309 enum iwl_ucode_type old_type = mvm->fwrt.cur_fw_img;
312 ucode_type == IWL_UCODE_INIT || iwl_mvm_has_unified_ucode(mvm);
317 iwl_fw_dbg_conf_usniffer(mvm->fw, FW_DBG_START_FROM_ALIVE) &&
318 !(fw_has_capa(&mvm->fw->ucode_capa,
320 fw = iwl_get_ucode_image(mvm->fw, IWL_UCODE_REGULAR_USNIFFER);
322 fw = iwl_get_ucode_image(mvm->fw, ucode_type);
325 iwl_fw_set_current_image(&mvm->fwrt, ucode_type);
326 clear_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status);
328 iwl_init_notification_wait(&mvm->notif_wait, &alive_wait,
337 ret = iwl_trans_start_fw(mvm->trans, fw, run_in_rfkill);
339 iwl_fw_set_current_image(&mvm->fwrt, old_type);
340 iwl_remove_notification(&mvm->notif_wait, &alive_wait);
348 ret = iwl_wait_notification(&mvm->notif_wait, &alive_wait,
351 if (mvm->trans->trans_cfg->device_family ==
354 IWL_INFO(mvm, "WFPM_UMAC_PD_NOTIFICATION: 0x%x\n",
355 iwl_read_umac_prph(mvm->trans, WFPM_ARC1_PD_NOTIFICATION));
356 IWL_INFO(mvm, "WFPM_LMAC2_PD_NOTIFICATION: 0x%x\n",
357 iwl_read_umac_prph(mvm->trans, WFPM_LMAC2_PD_NOTIFICATION));
358 IWL_INFO(mvm, "WFPM_AUTH_KEY_0: 0x%x\n",
359 iwl_read_umac_prph(mvm->trans, SB_MODIFY_CFG_FLAG));
360 IWL_INFO(mvm, "CNVI_SCU_SEQ_DATA_DW9: 0x%x\n",
361 iwl_read_prph(mvm->trans, CNVI_SCU_SEQ_DATA_DW9));
365 struct iwl_trans *trans = mvm->trans;
370 IWL_ERR(mvm,
377 IWL_ERR(mvm,
383 iwl_mvm_print_pd_notification(mvm);
391 IWL_ERR(mvm, "%s: 0x%x\n",
396 IWL_ERR(mvm, "UMAC PC: 0x%x\n",
399 IWL_ERR(mvm, "LMAC PC: 0x%x\n",
402 if (iwl_mvm_is_cdb_supported(mvm))
403 IWL_ERR(mvm, "LMAC2 PC: 0x%x\n",
408 if (ret == -ETIMEDOUT && !mvm->fw_product_reset)
409 iwl_fw_dbg_error_collect(&mvm->fwrt,
412 iwl_fw_set_current_image(&mvm->fwrt, old_type);
417 IWL_ERR(mvm, "Loaded ucode is not valid!\n");
418 iwl_fw_set_current_image(&mvm->fwrt, old_type);
425 ret = iwl_pnvm_load(mvm->trans, &mvm->notif_wait,
426 &mvm->fw->ucode_capa);
428 IWL_ERR(mvm, "Timeout waiting for PNVM load!\n");
429 iwl_fw_set_current_image(&mvm->fwrt, old_type);
433 iwl_trans_fw_alive(mvm->trans, alive_data.scd_base_addr);
444 memset(&mvm->queue_info, 0, sizeof(mvm->queue_info));
451 mvm->queue_info[IWL_MVM_DQA_CMD_QUEUE].tid_bitmap =
454 set_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status);
456 iwl_fw_set_dbg_rec_on(&mvm->fwrt);
466 if (!mvm->mld_api_is_used)
467 cfg80211_bss_flush(mvm->hw->wiphy);
472 static void iwl_mvm_phy_filter_init(struct iwl_mvm *mvm,
476 *phy_filters = mvm->phy_filters;
480 static void iwl_mvm_uats_init(struct iwl_mvm *mvm)
488 .data[0] = &mvm->fwrt.uats_table,
489 .len[0] = sizeof(mvm->fwrt.uats_table),
493 if (mvm->trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_AX210) {
494 IWL_DEBUG_RADIO(mvm, "UATS feature is not supported\n");
498 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, cmd.id,
501 IWL_DEBUG_RADIO(mvm,
507 ret = iwl_uefi_get_uats_table(mvm->trans, &mvm->fwrt);
509 IWL_DEBUG_FW(mvm, "failed to read UATS table (%d)\n", ret);
513 ret = iwl_mvm_send_cmd(mvm, &cmd);
515 IWL_ERR(mvm, "failed to send MCC_ALLOWED_AP_TYPE_CMD (%d)\n",
518 IWL_DEBUG_RADIO(mvm, "MCC_ALLOWED_AP_TYPE_CMD sent to FW\n");
521 static int iwl_mvm_sgom_init(struct iwl_mvm *mvm)
529 .data[0] = &mvm->fwrt.sgom_table,
530 .len[0] = sizeof(mvm->fwrt.sgom_table),
534 if (!mvm->fwrt.sgom_enabled) {
535 IWL_DEBUG_RADIO(mvm, "SGOM table is disabled\n");
539 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, cmd.id,
543 IWL_DEBUG_RADIO(mvm, "command version is unsupported. version = %d\n",
548 ret = iwl_mvm_send_cmd(mvm, &cmd);
550 IWL_ERR(mvm, "failed to send SAR_OFFSET_MAPPING_CMD (%d)\n", ret);
555 static int iwl_send_phy_cfg_cmd(struct iwl_mvm *mvm)
559 enum iwl_ucode_type ucode_type = mvm->fwrt.cur_fw_img;
563 if (iwl_mvm_has_unified_ucode(mvm) &&
564 !mvm->trans->cfg->tx_with_siso_diversity)
567 if (mvm->trans->cfg->tx_with_siso_diversity) {
577 phy_cfg_cmd.phy_cfg = cpu_to_le32(iwl_mvm_get_phy_config(mvm));
581 cpu_to_le32(mvm->trans->trans_cfg->extra_phy_cfg_flags);
584 mvm->fw->default_calib[ucode_type].event_trigger;
586 mvm->fw->default_calib[ucode_type].flow_trigger;
588 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, cmd_id,
591 iwl_mvm_phy_filter_init(mvm, &phy_cfg_cmd.phy_specific_cfg);
593 IWL_DEBUG_INFO(mvm, "Sending Phy CFG command: 0x%x\n",
597 return iwl_mvm_send_cmd_pdu(mvm, cmd_id, 0, cmd_size, &phy_cfg_cmd);
600 static int iwl_run_unified_mvm_ucode(struct iwl_mvm *mvm)
613 if (mvm->trans->cfg->tx_with_siso_diversity)
616 lockdep_assert_held(&mvm->mutex);
618 mvm->rfkill_safe_init_done = false;
620 if (mvm->trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_AX210) {
621 sb_cfg = iwl_read_umac_prph(mvm->trans, SB_MODIFY_CFG_FLAG);
623 mvm->fw_product_reset = sb_cfg == SB_CFG_RESIDES_IN_ROM;
624 if (mvm->fw_product_reset && iwl_mei_pldr_req())
628 iwl_init_notification_wait(&mvm->notif_wait,
635 iwl_dbg_tlv_time_point(&mvm->fwrt, IWL_FW_INI_TIME_POINT_EARLY, NULL);
638 ret = iwl_mvm_load_ucode_wait_alive(mvm, IWL_UCODE_REGULAR);
640 IWL_ERR(mvm, "Failed to start RT ucode: %d\n", ret);
643 if (mvm->fw_product_reset) {
645 iwl_trans_pcie_remove(mvm->trans, true);
650 iwl_dbg_tlv_time_point(&mvm->fwrt, IWL_FW_INI_TIME_POINT_AFTER_ALIVE,
653 if (mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_BZ)
654 mvm->trans->step_urm = !!(iwl_read_umac_prph(mvm->trans,
661 ret = iwl_mvm_send_cmd_pdu(mvm, WIDE_ID(SYSTEM_GROUP,
666 IWL_ERR(mvm, "Failed to run init config command: %d\n",
672 if (mvm->nvm_file_name) {
673 ret = iwl_read_external_nvm(mvm->trans, mvm->nvm_file_name,
674 mvm->nvm_sections);
677 ret = iwl_mvm_load_nvm_to_nic(mvm);
682 ret = iwl_mvm_send_cmd_pdu(mvm, WIDE_ID(REGULATORY_AND_NVM_GROUP,
687 IWL_ERR(mvm, "Failed to run complete NVM access: %d\n",
692 ret = iwl_send_phy_cfg_cmd(mvm);
694 IWL_ERR(mvm, "Failed to run PHY configuration: %d\n",
700 ret = iwl_wait_notification(&mvm->notif_wait, &init_wait,
706 if (!mvm->nvm_data) {
707 mvm->nvm_data = iwl_get_nvm(mvm->trans, mvm->fw,
708 mvm->set_tx_ant, mvm->set_rx_ant);
709 if (IS_ERR(mvm->nvm_data)) {
710 ret = PTR_ERR(mvm->nvm_data);
711 mvm->nvm_data = NULL;
712 IWL_ERR(mvm, "Failed to read NVM: %d\n", ret);
717 mvm->rfkill_safe_init_done = true;
722 iwl_remove_notification(&mvm->notif_wait, &init_wait);
726 int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm)
735 if (iwl_mvm_has_unified_ucode(mvm))
736 return iwl_run_unified_mvm_ucode(mvm);
738 lockdep_assert_held(&mvm->mutex);
740 mvm->rfkill_safe_init_done = false;
742 iwl_init_notification_wait(&mvm->notif_wait,
747 mvm->phy_db);
749 iwl_dbg_tlv_time_point(&mvm->fwrt, IWL_FW_INI_TIME_POINT_EARLY, NULL);
752 ret = iwl_mvm_load_ucode_wait_alive(mvm, IWL_UCODE_INIT);
754 IWL_ERR(mvm, "Failed to start INIT ucode: %d\n", ret);
758 if (mvm->trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_8000) {
759 ret = iwl_mvm_send_bt_init_conf(mvm);
765 if (!mvm->nvm_data) {
766 ret = iwl_nvm_init(mvm);
768 IWL_ERR(mvm, "Failed to read NVM: %d\n", ret);
774 if (mvm->nvm_file_name) {
775 ret = iwl_mvm_load_nvm_to_nic(mvm);
780 WARN_ONCE(mvm->nvm_data->nvm_version < mvm->trans->cfg->nvm_ver,
782 mvm->nvm_data->nvm_version, mvm->trans->cfg->nvm_ver);
788 if (iwl_mvm_is_radio_hw_killed(mvm)) {
789 IWL_DEBUG_RF_KILL(mvm,
794 mvm->rfkill_safe_init_done = true;
797 ret = iwl_send_tx_ant_cfg(mvm, iwl_mvm_get_valid_tx_ant(mvm));
801 ret = iwl_send_phy_cfg_cmd(mvm);
803 IWL_ERR(mvm, "Failed to run INIT calibrations: %d\n",
812 ret = iwl_wait_notification(&mvm->notif_wait, &calib_wait,
817 if (iwl_mvm_is_radio_hw_killed(mvm)) {
818 IWL_DEBUG_RF_KILL(mvm, "RFKILL while calibrating.\n");
821 IWL_ERR(mvm, "Failed to run INIT calibrations: %d\n",
828 iwl_remove_notification(&mvm->notif_wait, &calib_wait);
830 mvm->rfkill_safe_init_done = false;
831 if (!mvm->nvm_data) {
833 mvm->nvm_data = kzalloc(sizeof(struct iwl_nvm_data) +
837 if (!mvm->nvm_data)
839 mvm->nvm_data->bands[0].channels = mvm->nvm_data->channels;
840 mvm->nvm_data->bands[0].n_channels = 1;
841 mvm->nvm_data->bands[0].n_bitrates = 1;
842 mvm->nvm_data->bands[0].bitrates =
843 (void *)(mvm->nvm_data->channels + 1);
844 mvm->nvm_data->bands[0].bitrates->hw_value = 10;
850 static int iwl_mvm_config_ltr(struct iwl_mvm *mvm)
856 if (!mvm->trans->ltr_enabled)
859 return iwl_mvm_send_cmd_pdu(mvm, LTR_CONFIG, 0,
863 int iwl_mvm_sar_select_profile(struct iwl_mvm *mvm, int prof_a, int prof_b)
873 u8 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, cmd_id, 3);
879 cmd.v7.flags = cpu_to_le32(mvm->fwrt.reduced_power_flags);
886 } else if (fw_has_api(&mvm->fw->ucode_capa,
891 } else if (fw_has_capa(&mvm->fw->ucode_capa,
905 ret = iwl_sar_fill_profile(&mvm->fwrt, per_chain,
915 IWL_DEBUG_RADIO(mvm, "Sending REDUCE_TX_POWER_CMD per chain\n");
916 return iwl_mvm_send_cmd_pdu(mvm, cmd_id, 0, len, &cmd);
919 int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm)
930 u8 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, cmd.id,
943 else if (fw_has_api(&mvm->fwrt.fw->ucode_capa,
949 if (!iwl_sar_geo_support(&mvm->fwrt))
954 ret = iwl_mvm_send_cmd(mvm, &cmd);
956 IWL_ERR(mvm, "Failed to get geographic profile info %d\n", ret);
970 static int iwl_mvm_sar_geo_init(struct iwl_mvm *mvm)
979 u8 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, cmd_id,
995 if (mvm->fwrt.geo_rev == 1)
1013 } else if (fw_has_api(&mvm->fwrt.fw->ucode_capa,
1034 ret = iwl_sar_geo_fill_table(&mvm->fwrt, &cmd.v1.table[0][0],
1044 return iwl_mvm_send_cmd_pdu(mvm, cmd_id, 0, len, &cmd);
1047 int iwl_mvm_ppag_send_cmd(struct iwl_mvm *mvm)
1052 ret = iwl_fill_ppag_table(&mvm->fwrt, &cmd, &cmd_size);
1057 IWL_DEBUG_RADIO(mvm, "Sending PER_PLATFORM_ANT_GAIN_CMD\n");
1058 ret = iwl_mvm_send_cmd_pdu(mvm, WIDE_ID(PHY_OPS_GROUP,
1062 IWL_ERR(mvm, "failed to send PER_PLATFORM_ANT_GAIN_CMD (%d)\n",
1068 static int iwl_mvm_ppag_init(struct iwl_mvm *mvm)
1071 if (!(iwl_is_ppag_approved(&mvm->fwrt)))
1074 return iwl_mvm_ppag_send_cmd(mvm);
1096 static void iwl_mvm_tas_init(struct iwl_mvm *mvm)
1109 if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TAS_CFG)) {
1110 IWL_DEBUG_RADIO(mvm, "TAS not enabled in FW\n");
1114 ret = iwl_bios_get_tas_table(&mvm->fwrt, &data);
1116 IWL_DEBUG_RADIO(mvm,
1126 IWL_DEBUG_RADIO(mvm,
1135 IWL_DEBUG_RADIO(mvm,
1140 IWL_DEBUG_RADIO(mvm,
1145 fw_ver = iwl_fw_lookup_cmd_ver(mvm->fw, cmd_id,
1165 ret = iwl_mvm_send_cmd_pdu(mvm, cmd_id, 0, cmd_size, &cmd);
1167 IWL_DEBUG_RADIO(mvm, "failed to send TAS_CONFIG (%d)\n", ret);
1170 static bool iwl_mvm_eval_dsm_rfi(struct iwl_mvm *mvm)
1175 int ret = iwl_bios_get_dsm(&mvm->fwrt, DSM_FUNC_RFI_CONFIG, &value);
1179 IWL_DEBUG_RADIO(mvm, "Failed to get DSM RFI, ret=%d\n", ret);
1190 IWL_DEBUG_RADIO(mvm, "DSM RFI is evaluated to enable\n");
1193 IWL_DEBUG_RADIO(mvm, "DSM RFI is evaluated to disable\n");
1195 IWL_DEBUG_RADIO(mvm,
1202 static void iwl_mvm_lari_cfg(struct iwl_mvm *mvm)
1208 ret = iwl_fill_lari_config(&mvm->fwrt, &cmd, &cmd_size);
1210 ret = iwl_mvm_send_cmd_pdu(mvm,
1215 IWL_DEBUG_RADIO(mvm,
1221 void iwl_mvm_get_bios_tables(struct iwl_mvm *mvm)
1225 iwl_acpi_get_guid_lock_status(&mvm->fwrt);
1228 ret = iwl_bios_get_ppag_table(&mvm->fwrt);
1230 IWL_DEBUG_RADIO(mvm,
1236 ret = iwl_bios_get_wrds_table(&mvm->fwrt);
1238 IWL_DEBUG_RADIO(mvm,
1245 if (!iwl_bios_get_wgds_table(&mvm->fwrt)) {
1252 IWL_ERR(mvm, "BIOS contains WGDS but no WRDS\n");
1256 ret = iwl_bios_get_ewrd_table(&mvm->fwrt);
1260 IWL_DEBUG_RADIO(mvm,
1265 if (iwl_sar_geo_support(&mvm->fwrt)) {
1266 ret = iwl_bios_get_wgds_table(&mvm->fwrt);
1268 IWL_DEBUG_RADIO(mvm,
1275 iwl_acpi_get_phy_filters(&mvm->fwrt, &mvm->phy_filters);
1277 if (iwl_bios_get_eckv(&mvm->fwrt, &mvm->ext_clock_valid))
1278 IWL_DEBUG_RADIO(mvm, "ECKV table doesn't exist in BIOS\n");
1288 void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags)
1290 u32 error_log_size = mvm->fw->ucode_capa.error_log_size;
1311 if (!mvm->error_recovery_buf)
1314 host_cmd.data[1] = mvm->error_recovery_buf;
1320 ret = iwl_mvm_send_cmd(mvm, &host_cmd);
1321 kfree(mvm->error_recovery_buf);
1322 mvm->error_recovery_buf = NULL;
1325 IWL_ERR(mvm, "Failed to send recovery cmd %d\n", ret);
1333 IWL_ERR(mvm,
1337 ieee80211_iterate_interfaces(mvm->hw, 0,
1339 mvm);
1344 static int iwl_mvm_sar_init(struct iwl_mvm *mvm)
1346 return iwl_mvm_sar_select_profile(mvm, 1, 1);
1349 static int iwl_mvm_load_rt_fw(struct iwl_mvm *mvm)
1353 if (iwl_mvm_has_unified_ucode(mvm))
1354 return iwl_run_unified_mvm_ucode(mvm);
1356 ret = iwl_run_init_mvm_ucode(mvm);
1359 IWL_ERR(mvm, "Failed to run INIT ucode: %d\n", ret);
1363 iwl_fw_dbg_stop_sync(&mvm->fwrt);
1364 iwl_trans_stop_device(mvm->trans);
1365 ret = iwl_trans_start_hw(mvm->trans);
1369 mvm->rfkill_safe_init_done = false;
1370 ret = iwl_mvm_load_ucode_wait_alive(mvm, IWL_UCODE_REGULAR);
1374 mvm->rfkill_safe_init_done = true;
1376 iwl_dbg_tlv_time_point(&mvm->fwrt, IWL_FW_INI_TIME_POINT_AFTER_ALIVE,
1379 return iwl_init_paging(&mvm->fwrt, mvm->fwrt.cur_fw_img);
1382 int iwl_mvm_up(struct iwl_mvm *mvm)
1387 lockdep_assert_held(&mvm->mutex);
1389 ret = iwl_trans_start_hw(mvm->trans);
1393 ret = iwl_mvm_load_rt_fw(mvm);
1395 IWL_ERR(mvm, "Failed to start RT ucode: %d\n", ret);
1396 if (ret != -ERFKILL && !mvm->fw_product_reset)
1397 iwl_fw_dbg_error_collect(&mvm->fwrt,
1403 mvm->fw_product_reset = false;
1405 iwl_fw_disable_dbg_asserts(&mvm->fwrt);
1406 iwl_get_shared_mem_conf(&mvm->fwrt);
1408 ret = iwl_mvm_sf_update(mvm, NULL, false);
1410 IWL_ERR(mvm, "Failed to initialize Smart Fifo\n");
1412 if (!iwl_trans_dbg_ini_valid(mvm->trans)) {
1413 mvm->fwrt.dump.conf = FW_DBG_INVALID;
1415 if (mvm->fw->dbg.dest_tlv)
1416 mvm->fwrt.dump.conf = FW_DBG_START_FROM_ALIVE;
1417 iwl_fw_start_dbg_conf(&mvm->fwrt, FW_DBG_START_FROM_ALIVE);
1420 ret = iwl_send_tx_ant_cfg(mvm, iwl_mvm_get_valid_tx_ant(mvm));
1424 if (!iwl_mvm_has_unified_ucode(mvm)) {
1426 ret = iwl_send_phy_db_data(mvm->phy_db);
1429 ret = iwl_send_phy_cfg_cmd(mvm);
1434 ret = iwl_mvm_send_bt_init_conf(mvm);
1438 if (fw_has_capa(&mvm->fw->ucode_capa,
1440 ret = iwl_set_soc_latency(&mvm->fwrt);
1445 iwl_mvm_lari_cfg(mvm);
1448 ret = iwl_configure_rxq(&mvm->fwrt);
1452 if (iwl_mvm_has_new_rx_api(mvm)) {
1453 ret = iwl_send_rss_cfg_cmd(mvm);
1455 IWL_ERR(mvm, "Failed to configure RSS queues: %d\n",
1462 for (i = 0; i < mvm->fw->ucode_capa.num_stations; i++) {
1463 RCU_INIT_POINTER(mvm->fw_id_to_mac_id[i], NULL);
1464 RCU_INIT_POINTER(mvm->fw_id_to_link_sta[i], NULL);
1468 RCU_INIT_POINTER(mvm->link_id_to_link_conf[i], NULL);
1470 mvm->tdls_cs.peer.sta_id = IWL_MVM_INVALID_STA;
1473 memset(&mvm->last_quota_cmd, 0xff, sizeof(mvm->last_quota_cmd));
1475 if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_DQA_SUPPORT)) {
1476 ret = iwl_mvm_send_dqa_cmd(mvm);
1487 if (!iwl_mvm_has_new_station_api(mvm->fw)) {
1492 ret = iwl_mvm_add_aux_sta(mvm, MAC_INDEX_AUX);
1500 sband = mvm->hw->wiphy->bands[i++];
1507 if (iwl_mvm_is_tt_in_fw(mvm)) {
1512 iwl_mvm_send_temp_report_ths_cmd(mvm);
1515 iwl_mvm_tt_tx_backoff(mvm, 0);
1525 if (iwl_mvm_is_ctdp_supported(mvm)) {
1526 ret = iwl_mvm_ctdp_command(mvm, CTDP_CMD_OPERATION_START,
1527 mvm->cooling_dev.cur_state);
1533 if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_SET_LTR_GEN2))
1534 WARN_ON(iwl_mvm_config_ltr(mvm));
1536 ret = iwl_mvm_power_update_device(mvm);
1544 if (!test_bit(IWL_MVM_STATUS_HW_CTKILL, &mvm->status)) {
1545 ret = iwl_mvm_init_mcc(mvm);
1550 if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_UMAC_SCAN)) {
1551 mvm->scan_type = IWL_SCAN_TYPE_NOT_SET;
1552 mvm->hb_scan_type = IWL_SCAN_TYPE_NOT_SET;
1553 ret = iwl_mvm_config_scan(mvm);
1558 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) {
1559 iwl_mvm_send_recovery_cmd(mvm, ERROR_RECOVERY_UPDATE_DB);
1561 if (mvm->time_sync.active)
1562 iwl_mvm_time_sync_config(mvm, mvm->time_sync.peer_addr,
1567 if (!mvm->ptp_data.ptp_clock)
1568 iwl_mvm_ptp_init(mvm);
1570 ret = iwl_mvm_ppag_init(mvm);
1574 ret = iwl_mvm_sar_init(mvm);
1576 ret = iwl_mvm_sar_geo_init(mvm);
1580 ret = iwl_mvm_sgom_init(mvm);
1584 iwl_mvm_tas_init(mvm);
1585 iwl_mvm_leds_sync(mvm);
1586 iwl_mvm_uats_init(mvm);
1588 if (iwl_rfi_supported(mvm)) {
1589 if (iwl_mvm_eval_dsm_rfi(mvm))
1590 iwl_rfi_send_config_cmd(mvm, NULL);
1593 iwl_mvm_mei_device_state(mvm, true);
1595 IWL_DEBUG_INFO(mvm, "RT uCode started.\n");
1598 iwl_mvm_stop_device(mvm);
1602 int iwl_mvm_load_d3_fw(struct iwl_mvm *mvm)
1606 lockdep_assert_held(&mvm->mutex);
1608 ret = iwl_trans_start_hw(mvm->trans);
1612 ret = iwl_mvm_load_ucode_wait_alive(mvm, IWL_UCODE_WOWLAN);
1614 IWL_ERR(mvm, "Failed to start WoWLAN firmware: %d\n", ret);
1618 ret = iwl_send_tx_ant_cfg(mvm, iwl_mvm_get_valid_tx_ant(mvm));
1623 ret = iwl_send_phy_db_data(mvm->phy_db);
1627 ret = iwl_send_phy_cfg_cmd(mvm);
1632 for (i = 0; i < mvm->fw->ucode_capa.num_stations; i++) {
1633 RCU_INIT_POINTER(mvm->fw_id_to_mac_id[i], NULL);
1634 RCU_INIT_POINTER(mvm->fw_id_to_link_sta[i], NULL);
1637 if (!iwl_mvm_has_new_station_api(mvm->fw)) {
1646 ret = iwl_mvm_add_aux_sta(mvm, MAC_INDEX_AUX);
1653 iwl_mvm_stop_device(mvm);
1657 void iwl_mvm_rx_mfuart_notif(struct iwl_mvm *mvm,
1663 IWL_DEBUG_INFO(mvm,
1671 IWL_DEBUG_INFO(mvm,