Lines Matching refs:mvm

83 	struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode);  in iwl_mvm_nic_config()  local
86 u32 phy_config = iwl_mvm_get_phy_config(mvm); in iwl_mvm_nic_config()
96 reg_val = CSR_HW_REV_STEP_DASH(mvm->trans->hw_rev); in iwl_mvm_nic_config()
114 if (mvm->trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_8000) in iwl_mvm_nic_config()
117 if (iwl_fw_dbg_is_d3_debug_enabled(&mvm->fwrt)) in iwl_mvm_nic_config()
120 iwl_trans_set_bits_mask(mvm->trans, CSR_HW_IF_CONFIG_REG, in iwl_mvm_nic_config()
130 IWL_DEBUG_INFO(mvm, "Radio type=0x%x-0x%x-0x%x\n", radio_cfg_type, in iwl_mvm_nic_config()
138 if (!mvm->trans->cfg->apmg_not_supported) in iwl_mvm_nic_config()
139 iwl_set_bits_mask_prph(mvm->trans, APMG_PS_CTRL_REG, in iwl_mvm_nic_config()
144 static void iwl_mvm_rx_monitor_notif(struct iwl_mvm *mvm, in iwl_mvm_rx_monitor_notif() argument
156 vif = iwl_mvm_get_vif_by_macid(mvm, notif->mac_id); in iwl_mvm_rx_monitor_notif()
169 if (mvm->cca_40mhz_workaround) in iwl_mvm_rx_monitor_notif()
176 mvm->cca_40mhz_workaround = 2; in iwl_mvm_rx_monitor_notif()
185 sband = mvm->hw->wiphy->bands[NL80211_BAND_2GHZ]; in iwl_mvm_rx_monitor_notif()
211 struct iwl_mvm *mvm = mvmvif->mvm; in iwl_mvm_apply_fw_smps_request() local
214 if (mvm->fw_static_smps_request && in iwl_mvm_apply_fw_smps_request()
219 iwl_mvm_update_smps(mvm, vif, IWL_MVM_SMPS_REQ_FW, mode); in iwl_mvm_apply_fw_smps_request()
228 static void iwl_mvm_rx_thermal_dual_chain_req(struct iwl_mvm *mvm, in iwl_mvm_rx_thermal_dual_chain_req() argument
238 mvm->fw_static_smps_request = in iwl_mvm_rx_thermal_dual_chain_req()
240 ieee80211_iterate_interfaces(mvm->hw, in iwl_mvm_rx_thermal_dual_chain_req()
271 void (*fn)(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb);
605 static u32 iwl_mvm_min_backoff(struct iwl_mvm *mvm) in iwl_mvm_min_backoff() argument
607 const struct iwl_pwr_tx_backoff *backoff = mvm->cfg->pwr_tx_backoffs; in iwl_mvm_min_backoff()
613 dflt_pwr_limit = iwl_acpi_get_pwr_limit(mvm->dev); in iwl_mvm_min_backoff()
627 struct iwl_mvm *mvm = in iwl_mvm_tx_unblock_dwork() local
632 mutex_lock(&mvm->mutex); in iwl_mvm_tx_unblock_dwork()
635 rcu_dereference_protected(mvm->csa_tx_blocked_vif, in iwl_mvm_tx_unblock_dwork()
636 lockdep_is_held(&mvm->mutex)); in iwl_mvm_tx_unblock_dwork()
642 iwl_mvm_modify_all_sta_disable_tx(mvm, mvmvif, false); in iwl_mvm_tx_unblock_dwork()
643 RCU_INIT_POINTER(mvm->csa_tx_blocked_vif, NULL); in iwl_mvm_tx_unblock_dwork()
645 mutex_unlock(&mvm->mutex); in iwl_mvm_tx_unblock_dwork()
650 struct iwl_mvm *mvm = ctx; in iwl_mvm_fwrt_dump_start() local
652 mutex_lock(&mvm->mutex); in iwl_mvm_fwrt_dump_start()
657 struct iwl_mvm *mvm = ctx; in iwl_mvm_fwrt_dump_end() local
659 mutex_unlock(&mvm->mutex); in iwl_mvm_fwrt_dump_end()
669 struct iwl_mvm *mvm = (struct iwl_mvm *)ctx; in iwl_mvm_fwrt_send_hcmd() local
672 mutex_lock(&mvm->mutex); in iwl_mvm_fwrt_send_hcmd()
673 ret = iwl_mvm_send_cmd(mvm, host_cmd); in iwl_mvm_fwrt_send_hcmd()
674 mutex_unlock(&mvm->mutex); in iwl_mvm_fwrt_send_hcmd()
692 static int iwl_mvm_start_get_nvm(struct iwl_mvm *mvm) in iwl_mvm_start_get_nvm() argument
694 struct iwl_trans *trans = mvm->trans; in iwl_mvm_start_get_nvm()
698 if (WARN(!mvm->mei_registered, in iwl_mvm_start_get_nvm()
702 mvm->mei_nvm_data = iwl_mei_get_nvm(); in iwl_mvm_start_get_nvm()
703 if (mvm->mei_nvm_data) { in iwl_mvm_start_get_nvm()
709 mvm->nvm_data = in iwl_mvm_start_get_nvm()
711 mvm->mei_nvm_data, mvm->fw); in iwl_mvm_start_get_nvm()
715 IWL_ERR(mvm, in iwl_mvm_start_get_nvm()
721 wiphy_lock(mvm->hw->wiphy); in iwl_mvm_start_get_nvm()
722 mutex_lock(&mvm->mutex); in iwl_mvm_start_get_nvm()
724 ret = iwl_trans_start_hw(mvm->trans); in iwl_mvm_start_get_nvm()
726 mutex_unlock(&mvm->mutex); in iwl_mvm_start_get_nvm()
727 wiphy_unlock(mvm->hw->wiphy); in iwl_mvm_start_get_nvm()
732 ret = iwl_run_init_mvm_ucode(mvm); in iwl_mvm_start_get_nvm()
734 iwl_fw_dbg_error_collect(&mvm->fwrt, FW_DBG_TRIGGER_DRIVER); in iwl_mvm_start_get_nvm()
735 if (!ret && iwl_mvm_is_lar_supported(mvm)) { in iwl_mvm_start_get_nvm()
736 mvm->hw->wiphy->regulatory_flags |= REGULATORY_WIPHY_SELF_MANAGED; in iwl_mvm_start_get_nvm()
737 ret = iwl_mvm_init_mcc(mvm); in iwl_mvm_start_get_nvm()
741 iwl_mvm_stop_device(mvm); in iwl_mvm_start_get_nvm()
743 mutex_unlock(&mvm->mutex); in iwl_mvm_start_get_nvm()
744 wiphy_unlock(mvm->hw->wiphy); in iwl_mvm_start_get_nvm()
748 IWL_ERR(mvm, "Failed to run INIT ucode: %d\n", ret); in iwl_mvm_start_get_nvm()
753 static int iwl_mvm_start_post_nvm(struct iwl_mvm *mvm) in iwl_mvm_start_post_nvm() argument
758 iwl_mvm_toggle_tx_ant(mvm, &mvm->mgmt_last_antenna_idx); in iwl_mvm_start_post_nvm()
760 ret = iwl_mvm_mac_setup_register(mvm); in iwl_mvm_start_post_nvm()
764 mvm->hw_registered = true; in iwl_mvm_start_post_nvm()
766 iwl_mvm_dbgfs_register(mvm); in iwl_mvm_start_post_nvm()
768 wiphy_rfkill_set_hw_state_reason(mvm->hw->wiphy, in iwl_mvm_start_post_nvm()
769 mvm->mei_rfkill_blocked, in iwl_mvm_start_post_nvm()
772 iwl_mvm_mei_set_sw_rfkill_state(mvm); in iwl_mvm_start_post_nvm()
848 struct iwl_mvm *mvm = ctx; in iwl_mvm_frob_txf() local
851 if (iwl_mvm_has_new_tx_api(mvm)) in iwl_mvm_frob_txf()
855 ieee80211_iter_keys_rcu(mvm->hw, NULL, iwl_mvm_frob_txf_key_iter, &txf); in iwl_mvm_frob_txf()
906 struct iwl_mvm *mvm = ctx; in iwl_mvm_frob_mem() local
909 switch (mvm->fwrt.cur_fw_img) { in iwl_mvm_frob_mem()
916 excl = mvm->fw->dump_excl; in iwl_mvm_frob_mem()
919 excl = mvm->fw->dump_excl_wowlan; in iwl_mvm_frob_mem()
923 BUILD_BUG_ON(sizeof(mvm->fw->dump_excl) != in iwl_mvm_frob_mem()
924 sizeof(mvm->fw->dump_excl_wowlan)); in iwl_mvm_frob_mem()
926 for (i = 0; i < ARRAY_SIZE(mvm->fw->dump_excl); i++) { in iwl_mvm_frob_mem()
956 struct iwl_mvm *mvm = priv; in iwl_mvm_me_conn_status() local
963 prev_conn_info = rcu_dereference_protected(mvm->csme_conn_info, true); in iwl_mvm_me_conn_status()
971 rcu_assign_pointer(mvm->csme_conn_info, curr_conn_info); in iwl_mvm_me_conn_status()
979 struct iwl_mvm *mvm = priv; in iwl_mvm_mei_rfkill() local
981 mvm->mei_rfkill_blocked = blocked; in iwl_mvm_mei_rfkill()
982 if (!mvm->hw_registered) in iwl_mvm_mei_rfkill()
985 wiphy_rfkill_set_hw_state_reason(mvm->hw->wiphy, in iwl_mvm_mei_rfkill()
986 mvm->mei_rfkill_blocked, in iwl_mvm_mei_rfkill()
992 struct iwl_mvm *mvm = priv; in iwl_mvm_mei_roaming_forbidden() local
994 if (!mvm->hw_registered || !mvm->csme_vif) in iwl_mvm_mei_roaming_forbidden()
997 iwl_mvm_send_roaming_forbidden_event(mvm, mvm->csme_vif, forbidden); in iwl_mvm_mei_roaming_forbidden()
1002 struct iwl_mvm *mvm = in iwl_mvm_sap_connected_wk() local
1006 ret = iwl_mvm_start_get_nvm(mvm); in iwl_mvm_sap_connected_wk()
1010 ret = iwl_mvm_start_post_nvm(mvm); in iwl_mvm_sap_connected_wk()
1017 IWL_ERR(mvm, "Couldn't get started...\n"); in iwl_mvm_sap_connected_wk()
1020 iwl_fw_flush_dumps(&mvm->fwrt); in iwl_mvm_sap_connected_wk()
1021 iwl_mvm_thermal_exit(mvm); in iwl_mvm_sap_connected_wk()
1022 iwl_fw_runtime_free(&mvm->fwrt); in iwl_mvm_sap_connected_wk()
1023 iwl_phy_db_free(mvm->phy_db); in iwl_mvm_sap_connected_wk()
1024 kfree(mvm->scan_cmd); in iwl_mvm_sap_connected_wk()
1025 iwl_trans_op_mode_leave(mvm->trans); in iwl_mvm_sap_connected_wk()
1026 kfree(mvm->nvm_data); in iwl_mvm_sap_connected_wk()
1027 kfree(mvm->mei_nvm_data); in iwl_mvm_sap_connected_wk()
1029 ieee80211_free_hw(mvm->hw); in iwl_mvm_sap_connected_wk()
1034 struct iwl_mvm *mvm = priv; in iwl_mvm_mei_sap_connected() local
1036 if (!mvm->hw_registered) in iwl_mvm_mei_sap_connected()
1037 schedule_work(&mvm->sap_connected_wk); in iwl_mvm_mei_sap_connected()
1042 struct iwl_mvm *mvm = priv; in iwl_mvm_mei_nic_stolen() local
1045 cfg80211_shutdown_all_interfaces(mvm->hw->wiphy); in iwl_mvm_mei_nic_stolen()
1063 struct iwl_mvm *mvm; in iwl_op_mode_mvm_start() local
1077 BUILD_BUG_ON(ARRAY_SIZE(mvm->fw_id_to_mac_id) != in iwl_op_mode_mvm_start()
1098 mvm = IWL_OP_MODE_GET_MVM(op_mode); in iwl_op_mode_mvm_start()
1099 mvm->dev = trans->dev; in iwl_op_mode_mvm_start()
1100 mvm->trans = trans; in iwl_op_mode_mvm_start()
1101 mvm->cfg = cfg; in iwl_op_mode_mvm_start()
1102 mvm->fw = fw; in iwl_op_mode_mvm_start()
1103 mvm->hw = hw; in iwl_op_mode_mvm_start()
1105 iwl_fw_runtime_init(&mvm->fwrt, trans, fw, &iwl_mvm_fwrt_ops, mvm, in iwl_op_mode_mvm_start()
1106 &iwl_mvm_sanitize_ops, mvm, dbgfs_dir); in iwl_op_mode_mvm_start()
1108 iwl_mvm_get_acpi_tables(mvm); in iwl_op_mode_mvm_start()
1109 iwl_uefi_get_sgom_table(trans, &mvm->fwrt); in iwl_op_mode_mvm_start()
1111 mvm->init_status = 0; in iwl_op_mode_mvm_start()
1113 if (iwl_mvm_has_new_rx_api(mvm)) { in iwl_op_mode_mvm_start()
1129 mvm->fw_restart = iwlwifi_mod_params.fw_restart ? -1 : 0; in iwl_op_mode_mvm_start()
1131 if (iwl_mvm_has_new_tx_api(mvm)) { in iwl_op_mode_mvm_start()
1141 mvm->aux_queue = IWL_MVM_INVALID_QUEUE; in iwl_op_mode_mvm_start()
1142 mvm->snif_queue = IWL_MVM_INVALID_QUEUE; in iwl_op_mode_mvm_start()
1143 mvm->probe_queue = IWL_MVM_INVALID_QUEUE; in iwl_op_mode_mvm_start()
1144 mvm->p2p_dev_queue = IWL_MVM_INVALID_QUEUE; in iwl_op_mode_mvm_start()
1146 mvm->aux_queue = IWL_MVM_DQA_AUX_QUEUE; in iwl_op_mode_mvm_start()
1147 mvm->snif_queue = IWL_MVM_DQA_INJECT_MONITOR_QUEUE; in iwl_op_mode_mvm_start()
1148 mvm->probe_queue = IWL_MVM_DQA_AP_PROBE_RESP_QUEUE; in iwl_op_mode_mvm_start()
1149 mvm->p2p_dev_queue = IWL_MVM_DQA_P2P_DEVICE_QUEUE; in iwl_op_mode_mvm_start()
1152 mvm->sf_state = SF_UNINIT; in iwl_op_mode_mvm_start()
1153 if (iwl_mvm_has_unified_ucode(mvm)) in iwl_op_mode_mvm_start()
1154 iwl_fw_set_current_image(&mvm->fwrt, IWL_UCODE_REGULAR); in iwl_op_mode_mvm_start()
1156 iwl_fw_set_current_image(&mvm->fwrt, IWL_UCODE_INIT); in iwl_op_mode_mvm_start()
1157 mvm->drop_bcn_ap_mode = true; in iwl_op_mode_mvm_start()
1159 mutex_init(&mvm->mutex); in iwl_op_mode_mvm_start()
1160 spin_lock_init(&mvm->async_handlers_lock); in iwl_op_mode_mvm_start()
1161 INIT_LIST_HEAD(&mvm->time_event_list); in iwl_op_mode_mvm_start()
1162 INIT_LIST_HEAD(&mvm->aux_roc_te_list); in iwl_op_mode_mvm_start()
1163 INIT_LIST_HEAD(&mvm->async_handlers_list); in iwl_op_mode_mvm_start()
1164 spin_lock_init(&mvm->time_event_lock); in iwl_op_mode_mvm_start()
1165 INIT_LIST_HEAD(&mvm->ftm_initiator.loc_list); in iwl_op_mode_mvm_start()
1166 INIT_LIST_HEAD(&mvm->ftm_initiator.pasn_list); in iwl_op_mode_mvm_start()
1167 INIT_LIST_HEAD(&mvm->resp_pasn_list); in iwl_op_mode_mvm_start()
1169 INIT_WORK(&mvm->async_handlers_wk, iwl_mvm_async_handlers_wk); in iwl_op_mode_mvm_start()
1170 INIT_WORK(&mvm->roc_done_wk, iwl_mvm_roc_done_wk); in iwl_op_mode_mvm_start()
1171 INIT_WORK(&mvm->sap_connected_wk, iwl_mvm_sap_connected_wk); in iwl_op_mode_mvm_start()
1172 INIT_DELAYED_WORK(&mvm->tdls_cs.dwork, iwl_mvm_tdls_ch_switch_work); in iwl_op_mode_mvm_start()
1173 INIT_DELAYED_WORK(&mvm->scan_timeout_dwork, iwl_mvm_scan_timeout_wk); in iwl_op_mode_mvm_start()
1174 INIT_WORK(&mvm->add_stream_wk, iwl_mvm_add_new_dqa_stream_wk); in iwl_op_mode_mvm_start()
1175 INIT_LIST_HEAD(&mvm->add_stream_txqs); in iwl_op_mode_mvm_start()
1177 init_waitqueue_head(&mvm->rx_sync_waitq); in iwl_op_mode_mvm_start()
1179 mvm->queue_sync_state = 0; in iwl_op_mode_mvm_start()
1181 SET_IEEE80211_DEV(mvm->hw, mvm->trans->dev); in iwl_op_mode_mvm_start()
1183 spin_lock_init(&mvm->tcm.lock); in iwl_op_mode_mvm_start()
1184 INIT_DELAYED_WORK(&mvm->tcm.work, iwl_mvm_tcm_work); in iwl_op_mode_mvm_start()
1185 mvm->tcm.ts = jiffies; in iwl_op_mode_mvm_start()
1186 mvm->tcm.ll_ts = jiffies; in iwl_op_mode_mvm_start()
1187 mvm->tcm.uapsd_nonagg_ts = jiffies; in iwl_op_mode_mvm_start()
1189 INIT_DELAYED_WORK(&mvm->cs_tx_unblock_dwork, iwl_mvm_tx_unblock_dwork); in iwl_op_mode_mvm_start()
1191 mvm->cmd_ver.d0i3_resp = in iwl_op_mode_mvm_start()
1192 iwl_fw_lookup_notif_ver(mvm->fw, LEGACY_GROUP, D0I3_END_CMD, in iwl_op_mode_mvm_start()
1195 if (WARN_ON_ONCE(mvm->cmd_ver.d0i3_resp > 1)) in iwl_op_mode_mvm_start()
1198 mvm->cmd_ver.range_resp = in iwl_op_mode_mvm_start()
1199 iwl_fw_lookup_notif_ver(mvm->fw, LOCATION_GROUP, in iwl_op_mode_mvm_start()
1202 if (WARN_ON_ONCE(mvm->cmd_ver.range_resp > 9)) in iwl_op_mode_mvm_start()
1234 mvm->trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_AX210; in iwl_op_mode_mvm_start()
1248 iwl_mvm_get_wd_timeout(mvm, NULL, false, true); in iwl_op_mode_mvm_start()
1250 snprintf(mvm->hw->wiphy->fw_version, in iwl_op_mode_mvm_start()
1251 sizeof(mvm->hw->wiphy->fw_version), in iwl_op_mode_mvm_start()
1254 trans_cfg.fw_reset_handshake = fw_has_capa(&mvm->fw->ucode_capa, in iwl_op_mode_mvm_start()
1258 iwl_fw_lookup_cmd_ver(mvm->fw, in iwl_op_mode_mvm_start()
1262 mvm->sta_remove_requires_queue_remove = in iwl_op_mode_mvm_start()
1266 iwl_trans_configure(mvm->trans, &trans_cfg); in iwl_op_mode_mvm_start()
1269 trans->dbg.dest_tlv = mvm->fw->dbg.dest_tlv; in iwl_op_mode_mvm_start()
1270 trans->dbg.n_dest_reg = mvm->fw->dbg.n_dest_reg; in iwl_op_mode_mvm_start()
1271 memcpy(trans->dbg.conf_tlv, mvm->fw->dbg.conf_tlv, in iwl_op_mode_mvm_start()
1273 trans->dbg.trigger_tlv = mvm->fw->dbg.trigger_tlv; in iwl_op_mode_mvm_start()
1275 trans->iml = mvm->fw->iml; in iwl_op_mode_mvm_start()
1276 trans->iml_len = mvm->fw->iml_len; in iwl_op_mode_mvm_start()
1279 iwl_notification_wait_init(&mvm->notif_wait); in iwl_op_mode_mvm_start()
1282 mvm->phy_db = iwl_phy_db_init(trans); in iwl_op_mode_mvm_start()
1283 if (!mvm->phy_db) { in iwl_op_mode_mvm_start()
1284 IWL_ERR(mvm, "Cannot init phy_db\n"); in iwl_op_mode_mvm_start()
1288 IWL_INFO(mvm, "Detected %s, REV=0x%X\n", in iwl_op_mode_mvm_start()
1289 mvm->trans->name, mvm->trans->hw_rev); in iwl_op_mode_mvm_start()
1292 mvm->nvm_file_name = iwlwifi_mod_params.nvm_file; in iwl_op_mode_mvm_start()
1294 IWL_DEBUG_EEPROM(mvm->trans->dev, in iwl_op_mode_mvm_start()
1297 scan_size = iwl_mvm_scan_size(mvm); in iwl_op_mode_mvm_start()
1299 mvm->scan_cmd = kmalloc(scan_size, GFP_KERNEL); in iwl_op_mode_mvm_start()
1300 if (!mvm->scan_cmd) in iwl_op_mode_mvm_start()
1304 mvm->aux_sta.sta_id = IWL_MVM_INVALID_STA; in iwl_op_mode_mvm_start()
1305 mvm->snif_sta.sta_id = IWL_MVM_INVALID_STA; in iwl_op_mode_mvm_start()
1308 mvm->last_ebs_successful = true; in iwl_op_mode_mvm_start()
1310 min_backoff = iwl_mvm_min_backoff(mvm); in iwl_op_mode_mvm_start()
1311 iwl_mvm_thermal_initialize(mvm, min_backoff); in iwl_op_mode_mvm_start()
1313 if (!iwl_mvm_has_new_rx_stats_api(mvm)) in iwl_op_mode_mvm_start()
1314 memset(&mvm->rx_stats_v3, 0, in iwl_op_mode_mvm_start()
1317 memset(&mvm->rx_stats, 0, sizeof(struct mvm_statistics_rx)); in iwl_op_mode_mvm_start()
1319 mvm->debugfs_dir = dbgfs_dir; in iwl_op_mode_mvm_start()
1321 mvm->mei_registered = !iwl_mei_register(mvm, &mei_ops); in iwl_op_mode_mvm_start()
1323 if (iwl_mvm_start_get_nvm(mvm)) { in iwl_op_mode_mvm_start()
1329 if (trans->csme_own && mvm->mei_registered) in iwl_op_mode_mvm_start()
1336 if (iwl_mvm_start_post_nvm(mvm)) in iwl_op_mode_mvm_start()
1342 iwl_mvm_thermal_exit(mvm); in iwl_op_mode_mvm_start()
1343 if (mvm->mei_registered) { in iwl_op_mode_mvm_start()
1348 iwl_fw_flush_dumps(&mvm->fwrt); in iwl_op_mode_mvm_start()
1349 iwl_fw_runtime_free(&mvm->fwrt); in iwl_op_mode_mvm_start()
1353 iwl_phy_db_free(mvm->phy_db); in iwl_op_mode_mvm_start()
1354 kfree(mvm->scan_cmd); in iwl_op_mode_mvm_start()
1357 ieee80211_free_hw(mvm->hw); in iwl_op_mode_mvm_start()
1361 void iwl_mvm_stop_device(struct iwl_mvm *mvm) in iwl_mvm_stop_device() argument
1363 lockdep_assert_held(&mvm->mutex); in iwl_mvm_stop_device()
1365 iwl_fw_cancel_timestamp(&mvm->fwrt); in iwl_mvm_stop_device()
1367 clear_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status); in iwl_mvm_stop_device()
1369 iwl_fw_dbg_stop_sync(&mvm->fwrt); in iwl_mvm_stop_device()
1370 iwl_trans_stop_device(mvm->trans); in iwl_mvm_stop_device()
1371 iwl_free_fw_paging(&mvm->fwrt); in iwl_mvm_stop_device()
1372 iwl_fw_dump_conf_clear(&mvm->fwrt); in iwl_mvm_stop_device()
1373 iwl_mvm_mei_device_down(mvm); in iwl_mvm_stop_device()
1378 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode); in iwl_op_mode_mvm_stop() local
1381 if (mvm->mei_registered) { in iwl_op_mode_mvm_stop()
1392 cancel_work_sync(&mvm->sap_connected_wk); in iwl_op_mode_mvm_stop()
1394 iwl_mvm_leds_exit(mvm); in iwl_op_mode_mvm_stop()
1396 iwl_mvm_thermal_exit(mvm); in iwl_op_mode_mvm_stop()
1406 if (mvm->hw_registered) in iwl_op_mode_mvm_stop()
1407 ieee80211_unregister_hw(mvm->hw); in iwl_op_mode_mvm_stop()
1409 kfree(mvm->scan_cmd); in iwl_op_mode_mvm_stop()
1410 kfree(mvm->mcast_filter_cmd); in iwl_op_mode_mvm_stop()
1411 mvm->mcast_filter_cmd = NULL; in iwl_op_mode_mvm_stop()
1413 kfree(mvm->error_recovery_buf); in iwl_op_mode_mvm_stop()
1414 mvm->error_recovery_buf = NULL; in iwl_op_mode_mvm_stop()
1416 iwl_trans_op_mode_leave(mvm->trans); in iwl_op_mode_mvm_stop()
1418 iwl_phy_db_free(mvm->phy_db); in iwl_op_mode_mvm_stop()
1419 mvm->phy_db = NULL; in iwl_op_mode_mvm_stop()
1421 kfree(mvm->nvm_data); in iwl_op_mode_mvm_stop()
1422 kfree(mvm->mei_nvm_data); in iwl_op_mode_mvm_stop()
1423 kfree(rcu_access_pointer(mvm->csme_conn_info)); in iwl_op_mode_mvm_stop()
1424 kfree(mvm->temp_nvm_data); in iwl_op_mode_mvm_stop()
1426 kfree(mvm->nvm_sections[i].data); in iwl_op_mode_mvm_stop()
1428 cancel_delayed_work_sync(&mvm->tcm.work); in iwl_op_mode_mvm_stop()
1430 iwl_fw_runtime_free(&mvm->fwrt); in iwl_op_mode_mvm_stop()
1431 mutex_destroy(&mvm->mutex); in iwl_op_mode_mvm_stop()
1433 if (mvm->mei_registered) in iwl_op_mode_mvm_stop()
1436 ieee80211_free_hw(mvm->hw); in iwl_op_mode_mvm_stop()
1443 void (*fn)(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb);
1446 void iwl_mvm_async_handlers_purge(struct iwl_mvm *mvm) in iwl_mvm_async_handlers_purge() argument
1450 spin_lock_bh(&mvm->async_handlers_lock); in iwl_mvm_async_handlers_purge()
1451 list_for_each_entry_safe(entry, tmp, &mvm->async_handlers_list, list) { in iwl_mvm_async_handlers_purge()
1456 spin_unlock_bh(&mvm->async_handlers_lock); in iwl_mvm_async_handlers_purge()
1461 struct iwl_mvm *mvm = in iwl_mvm_async_handlers_wk() local
1472 spin_lock_bh(&mvm->async_handlers_lock); in iwl_mvm_async_handlers_wk()
1473 list_splice_init(&mvm->async_handlers_list, &local_list); in iwl_mvm_async_handlers_wk()
1474 spin_unlock_bh(&mvm->async_handlers_lock); in iwl_mvm_async_handlers_wk()
1478 mutex_lock(&mvm->mutex); in iwl_mvm_async_handlers_wk()
1479 entry->fn(mvm, &entry->rxb); in iwl_mvm_async_handlers_wk()
1483 mutex_unlock(&mvm->mutex); in iwl_mvm_async_handlers_wk()
1488 static inline void iwl_mvm_rx_check_trigger(struct iwl_mvm *mvm, in iwl_mvm_rx_check_trigger() argument
1495 trig = iwl_fw_dbg_trigger_on(&mvm->fwrt, NULL, in iwl_mvm_rx_check_trigger()
1511 iwl_fw_dbg_collect_trig(&mvm->fwrt, trig, in iwl_mvm_rx_check_trigger()
1518 static void iwl_mvm_rx_common(struct iwl_mvm *mvm, in iwl_mvm_rx_common() argument
1526 iwl_dbg_tlv_time_point(&mvm->fwrt, in iwl_mvm_rx_common()
1528 iwl_mvm_rx_check_trigger(mvm, pkt); in iwl_mvm_rx_common()
1535 iwl_notification_wait_notify(&mvm->notif_wait, pkt); in iwl_mvm_rx_common()
1548 rx_h->fn(mvm, rxb); in iwl_mvm_rx_common()
1562 spin_lock(&mvm->async_handlers_lock); in iwl_mvm_rx_common()
1563 list_add_tail(&entry->list, &mvm->async_handlers_list); in iwl_mvm_rx_common()
1564 spin_unlock(&mvm->async_handlers_lock); in iwl_mvm_rx_common()
1565 schedule_work(&mvm->async_handlers_wk); in iwl_mvm_rx_common()
1575 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode); in iwl_mvm_rx() local
1579 iwl_mvm_rx_rx_mpdu(mvm, napi, rxb); in iwl_mvm_rx()
1581 iwl_mvm_rx_rx_phy_cmd(mvm, rxb); in iwl_mvm_rx()
1583 iwl_mvm_rx_common(mvm, rxb, pkt); in iwl_mvm_rx()
1591 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode); in iwl_mvm_rx_mq() local
1595 iwl_mvm_rx_mpdu_mq(mvm, napi, rxb, 0); in iwl_mvm_rx_mq()
1598 iwl_mvm_rx_queue_notif(mvm, napi, rxb, 0); in iwl_mvm_rx_mq()
1600 iwl_mvm_rx_frame_release(mvm, napi, rxb, 0); in iwl_mvm_rx_mq()
1602 iwl_mvm_rx_bar_frame_release(mvm, napi, rxb, 0); in iwl_mvm_rx_mq()
1604 iwl_mvm_rx_monitor_no_data(mvm, napi, rxb, 0); in iwl_mvm_rx_mq()
1606 iwl_mvm_rx_common(mvm, rxb, pkt); in iwl_mvm_rx_mq()
1612 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode); in iwl_mvm_async_cb() local
1618 iwl_trans_block_txq_ptrs(mvm->trans, false); in iwl_mvm_async_cb()
1621 static int iwl_mvm_is_static_queue(struct iwl_mvm *mvm, int queue) in iwl_mvm_is_static_queue() argument
1623 return queue == mvm->aux_queue || queue == mvm->probe_queue || in iwl_mvm_is_static_queue()
1624 queue == mvm->p2p_dev_queue || queue == mvm->snif_queue; in iwl_mvm_is_static_queue()
1630 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode); in iwl_mvm_queue_state_change() local
1639 sta_id = iwl_mvm_has_new_tx_api(mvm) ? in iwl_mvm_queue_state_change()
1640 mvm->tvqm_info[hw_queue].sta_id : in iwl_mvm_queue_state_change()
1641 mvm->queue_info[hw_queue].ra_sta_id; in iwl_mvm_queue_state_change()
1643 if (WARN_ON_ONCE(sta_id >= mvm->fw->ucode_capa.num_stations)) in iwl_mvm_queue_state_change()
1648 sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); in iwl_mvm_queue_state_change()
1653 if (iwl_mvm_is_static_queue(mvm, hw_queue)) { in iwl_mvm_queue_state_change()
1655 ieee80211_stop_queues(mvm->hw); in iwl_mvm_queue_state_change()
1657 ieee80211_wake_queues(mvm->hw); in iwl_mvm_queue_state_change()
1662 if (iwl_mvm_has_new_tx_api(mvm)) { in iwl_mvm_queue_state_change()
1663 int tid = mvm->tvqm_info[hw_queue].txq_tid; in iwl_mvm_queue_state_change()
1667 tid_bitmap = mvm->queue_info[hw_queue].tid_bitmap; in iwl_mvm_queue_state_change()
1681 iwl_mvm_mac_itxq_xmit(mvm->hw, txq); in iwl_mvm_queue_state_change()
1698 static void iwl_mvm_set_rfkill_state(struct iwl_mvm *mvm) in iwl_mvm_set_rfkill_state() argument
1700 bool state = iwl_mvm_is_radio_killed(mvm); in iwl_mvm_set_rfkill_state()
1703 wake_up(&mvm->rx_sync_waitq); in iwl_mvm_set_rfkill_state()
1705 wiphy_rfkill_set_hw_state(mvm->hw->wiphy, state); in iwl_mvm_set_rfkill_state()
1708 void iwl_mvm_set_hw_ctkill_state(struct iwl_mvm *mvm, bool state) in iwl_mvm_set_hw_ctkill_state() argument
1711 set_bit(IWL_MVM_STATUS_HW_CTKILL, &mvm->status); in iwl_mvm_set_hw_ctkill_state()
1713 clear_bit(IWL_MVM_STATUS_HW_CTKILL, &mvm->status); in iwl_mvm_set_hw_ctkill_state()
1715 iwl_mvm_set_rfkill_state(mvm); in iwl_mvm_set_hw_ctkill_state()
1718 struct iwl_mvm_csme_conn_info *iwl_mvm_get_csme_conn_info(struct iwl_mvm *mvm) in iwl_mvm_get_csme_conn_info() argument
1720 return rcu_dereference_protected(mvm->csme_conn_info, in iwl_mvm_get_csme_conn_info()
1721 lockdep_is_held(&mvm->mutex)); in iwl_mvm_get_csme_conn_info()
1726 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode); in iwl_mvm_set_hw_rfkill_state() local
1727 bool rfkill_safe_init_done = READ_ONCE(mvm->rfkill_safe_init_done); in iwl_mvm_set_hw_rfkill_state()
1728 bool unified = iwl_mvm_has_unified_ucode(mvm); in iwl_mvm_set_hw_rfkill_state()
1731 set_bit(IWL_MVM_STATUS_HW_RFKILL, &mvm->status); in iwl_mvm_set_hw_rfkill_state()
1733 clear_bit(IWL_MVM_STATUS_HW_RFKILL, &mvm->status); in iwl_mvm_set_hw_rfkill_state()
1735 iwl_mvm_set_rfkill_state(mvm); in iwl_mvm_set_hw_rfkill_state()
1739 iwl_abort_notification_waits(&mvm->notif_wait); in iwl_mvm_set_hw_rfkill_state()
1757 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode); in iwl_mvm_free_skb() local
1761 iwl_trans_free_tx_cmd(mvm->trans, info->driver_data[1]); in iwl_mvm_free_skb()
1762 ieee80211_free_txskb(mvm->hw, skb); in iwl_mvm_free_skb()
1782 void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error) in iwl_mvm_nic_restart() argument
1784 iwl_abort_notification_waits(&mvm->notif_wait); in iwl_mvm_nic_restart()
1785 iwl_dbg_tlv_del_timers(mvm->trans); in iwl_mvm_nic_restart()
1797 iwl_mvm_report_scan_aborted(mvm); in iwl_mvm_nic_restart()
1805 if (!mvm->fw_restart && fw_error) { in iwl_mvm_nic_restart()
1806 iwl_fw_error_collect(&mvm->fwrt, false); in iwl_mvm_nic_restart()
1808 &mvm->status)) { in iwl_mvm_nic_restart()
1809 IWL_ERR(mvm, "Starting mac, retry will be triggered anyway\n"); in iwl_mvm_nic_restart()
1810 } else if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { in iwl_mvm_nic_restart()
1813 IWL_ERR(mvm, in iwl_mvm_nic_restart()
1822 IWL_ERR(mvm, "Module is being unloaded - abort\n"); in iwl_mvm_nic_restart()
1831 reprobe->dev = get_device(mvm->trans->dev); in iwl_mvm_nic_restart()
1835 &mvm->status)) { in iwl_mvm_nic_restart()
1836 IWL_ERR(mvm, "HW restart already requested, but not started\n"); in iwl_mvm_nic_restart()
1837 } else if (mvm->fwrt.cur_fw_img == IWL_UCODE_REGULAR && in iwl_mvm_nic_restart()
1838 mvm->hw_registered && in iwl_mvm_nic_restart()
1839 !test_bit(STATUS_TRANS_DEAD, &mvm->trans->status)) { in iwl_mvm_nic_restart()
1844 set_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status); in iwl_mvm_nic_restart()
1846 if (mvm->fw->ucode_capa.error_log_size) { in iwl_mvm_nic_restart()
1847 u32 src_size = mvm->fw->ucode_capa.error_log_size; in iwl_mvm_nic_restart()
1848 u32 src_addr = mvm->fw->ucode_capa.error_log_addr; in iwl_mvm_nic_restart()
1852 mvm->error_recovery_buf = recover_buf; in iwl_mvm_nic_restart()
1853 iwl_trans_read_mem_bytes(mvm->trans, in iwl_mvm_nic_restart()
1860 iwl_fw_error_collect(&mvm->fwrt, false); in iwl_mvm_nic_restart()
1862 if (fw_error && mvm->fw_restart > 0) { in iwl_mvm_nic_restart()
1863 mvm->fw_restart--; in iwl_mvm_nic_restart()
1864 ieee80211_restart_hw(mvm->hw); in iwl_mvm_nic_restart()
1865 } else if (mvm->fwrt.trans->dbg.restart_required) { in iwl_mvm_nic_restart()
1866 IWL_DEBUG_INFO(mvm, "FW restart requested after debug collection\n"); in iwl_mvm_nic_restart()
1867 mvm->fwrt.trans->dbg.restart_required = FALSE; in iwl_mvm_nic_restart()
1868 ieee80211_restart_hw(mvm->hw); in iwl_mvm_nic_restart()
1869 } else if (mvm->trans->trans_cfg->device_family <= IWL_DEVICE_FAMILY_8000) { in iwl_mvm_nic_restart()
1870 ieee80211_restart_hw(mvm->hw); in iwl_mvm_nic_restart()
1877 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode); in iwl_mvm_nic_error() local
1879 if (!test_bit(STATUS_TRANS_DEAD, &mvm->trans->status) && in iwl_mvm_nic_error()
1881 &mvm->status)) in iwl_mvm_nic_error()
1882 iwl_mvm_dump_nic_error_log(mvm); in iwl_mvm_nic_error()
1885 iwl_fw_error_collect(&mvm->fwrt, true); in iwl_mvm_nic_error()
1899 if (!test_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status)) in iwl_mvm_nic_error()
1902 iwl_mvm_nic_restart(mvm, false); in iwl_mvm_nic_error()
1907 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode); in iwl_mvm_cmd_queue_full() local
1910 iwl_mvm_nic_restart(mvm, true); in iwl_mvm_cmd_queue_full()
1917 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode); in iwl_op_mode_mvm_time_point() local
1919 iwl_dbg_tlv_time_point(&mvm->fwrt, tp_id, tp_data); in iwl_op_mode_mvm_time_point()
1947 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode); in iwl_mvm_rx_mq_rss() local
1951 if (unlikely(queue >= mvm->trans->num_rx_queues)) in iwl_mvm_rx_mq_rss()
1955 iwl_mvm_rx_frame_release(mvm, napi, rxb, queue); in iwl_mvm_rx_mq_rss()
1958 iwl_mvm_rx_queue_notif(mvm, napi, rxb, queue); in iwl_mvm_rx_mq_rss()
1960 iwl_mvm_rx_mpdu_mq(mvm, napi, rxb, queue); in iwl_mvm_rx_mq_rss()