diff options
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/ops.c')
| -rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 103 | 
1 files changed, 37 insertions, 66 deletions
| diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index f1c5b3a9c26f..98f62d78cf9c 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c @@ -1,64 +1,9 @@ -/****************************************************************************** - * - * This file is provided under a dual BSD/GPLv2 license.  When using or - * redistributing this file, you may do so under either license. - * - * GPL LICENSE SUMMARY - * - * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation. All rights reserved. - * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH - * Copyright(c) 2016 - 2017 Intel Deutschland GmbH - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU - * General Public License for more details. - * - * The full GNU General Public License is included in this distribution - * in the file called COPYING. - * - * Contact Information: - *  Intel Linux Wireless <linuxwifi@intel.com> - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 - * - * BSD LICENSE - * - * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation. All rights reserved. - * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH - * Copyright(c) 2016 - 2017 Intel Deutschland GmbH - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - *  * Redistributions of source code must retain the above copyright - *    notice, this list of conditions and the following disclaimer. - *  * Redistributions in binary form must reproduce the above copyright - *    notice, this list of conditions and the following disclaimer in - *    the documentation and/or other materials provided with the - *    distribution. - *  * Neither the name Intel Corporation nor the names of its - *    contributors may be used to endorse or promote products derived - *    from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - *****************************************************************************/ +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause +/* + * Copyright (C) 2012-2014, 2018-2020 Intel Corporation + * Copyright (C) 2013-2015 Intel Mobile Communications GmbH + * Copyright (C) 2016-2017 Intel Deutschland GmbH + */  #include <linux/module.h>  #include <linux/vmalloc.h>  #include <net/mac80211.h> @@ -315,6 +260,12 @@ static const struct iwl_rx_handlers iwl_mvm_rx_handlers[] = {  		       iwl_mvm_mu_mimo_grp_notif, RX_HANDLER_SYNC),  	RX_HANDLER_GRP(DATA_PATH_GROUP, STA_PM_NOTIF,  		       iwl_mvm_sta_pm_notif, RX_HANDLER_SYNC), +	RX_HANDLER_GRP(MAC_CONF_GROUP, PROBE_RESPONSE_DATA_NOTIF, +		       iwl_mvm_probe_resp_data_notif, +		       RX_HANDLER_ASYNC_LOCKED), +	RX_HANDLER_GRP(MAC_CONF_GROUP, CHANNEL_SWITCH_NOA_NOTIF, +		       iwl_mvm_channel_switch_noa_notif, +		       RX_HANDLER_SYNC),  };  #undef RX_HANDLER  #undef RX_HANDLER_GRP @@ -703,7 +654,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,  	init_waitqueue_head(&mvm->rx_sync_waitq); -	atomic_set(&mvm->queue_sync_counter, 0); +	mvm->queue_sync_state = 0;  	SET_IEEE80211_DEV(mvm->hw, mvm->trans->dev); @@ -775,8 +726,6 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,  	trans_cfg.cb_data_offs = offsetof(struct ieee80211_tx_info,  					  driver_data[2]); -	trans_cfg.sw_csum_tx = IWL_MVM_SW_TX_CSUM_OFFLOAD; -  	/* Set a short watchdog for the command queue */  	trans_cfg.cmd_q_wdg_timeout =  		iwl_mvm_get_wd_timeout(mvm, NULL, false, true); @@ -785,6 +734,9 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,  		 sizeof(mvm->hw->wiphy->fw_version),  		 "%s", fw->fw_version); +	trans_cfg.fw_reset_handshake = fw_has_capa(&mvm->fw->ucode_capa, +						   IWL_UCODE_TLV_CAPA_FW_RESET_HANDSHAKE); +  	/* Configure transport layer */  	iwl_trans_configure(mvm->trans, &trans_cfg); @@ -822,7 +774,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,  		goto out_free;  	mutex_lock(&mvm->mutex); -	err = iwl_run_init_mvm_ucode(mvm, true); +	err = iwl_run_init_mvm_ucode(mvm);  	if (err && err != -ERFKILL)  		iwl_fw_dbg_error_collect(&mvm->fwrt, FW_DBG_TRIGGER_DRIVER);  	if (!iwlmvm_mod_params.init_dbg || !err) @@ -876,6 +828,20 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,  	return NULL;  } +void iwl_mvm_stop_device(struct iwl_mvm *mvm) +{ +	lockdep_assert_held(&mvm->mutex); + +	iwl_fw_cancel_timestamp(&mvm->fwrt); + +	clear_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status); + +	iwl_fw_dbg_stop_sync(&mvm->fwrt); +	iwl_trans_stop_device(mvm->trans); +	iwl_free_fw_paging(&mvm->fwrt); +	iwl_fw_dump_conf_clear(&mvm->fwrt); +} +  static void iwl_op_mode_mvm_stop(struct iwl_op_mode *op_mode)  {  	struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode); @@ -1298,6 +1264,12 @@ void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error)  	} else if (mvm->fwrt.cur_fw_img == IWL_UCODE_REGULAR &&  		   mvm->hw_registered &&  		   !test_bit(STATUS_TRANS_DEAD, &mvm->trans->status)) { +		/* This should be first thing before trying to collect any +		 * data to avoid endless loops if any HW error happens while +		 * collecting debug data. +		 */ +		set_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status); +  		if (mvm->fw->ucode_capa.error_log_size) {  			u32 src_size = mvm->fw->ucode_capa.error_log_size;  			u32 src_addr = mvm->fw->ucode_capa.error_log_addr; @@ -1316,7 +1288,6 @@ void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error)  		if (fw_error && mvm->fw_restart > 0)  			mvm->fw_restart--; -		set_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status);  		ieee80211_restart_hw(mvm->hw);  	}  } | 
