diff options
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/fw')
| -rw-r--r-- | drivers/net/wireless/intel/iwlwifi/fw/api/time-event.h | 4 | ||||
| -rw-r--r-- | drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 13 | ||||
| -rw-r--r-- | drivers/net/wireless/intel/iwlwifi/fw/dbg.h | 3 | ||||
| -rw-r--r-- | drivers/net/wireless/intel/iwlwifi/fw/debugfs.h | 18 | ||||
| -rw-r--r-- | drivers/net/wireless/intel/iwlwifi/fw/init.c | 12 | ||||
| -rw-r--r-- | drivers/net/wireless/intel/iwlwifi/fw/runtime.h | 7 | 
6 files changed, 50 insertions, 7 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/time-event.h b/drivers/net/wireless/intel/iwlwifi/fw/api/time-event.h index 3721a3ed358b..f824bebceb06 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/api/time-event.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/time-event.h @@ -211,7 +211,7 @@ enum {   * @TE_V2_NOTIF_HOST_FRAG_END:request/receive notification on frag end   * @TE_V2_NOTIF_INTERNAL_FRAG_START: internal FW use.   * @TE_V2_NOTIF_INTERNAL_FRAG_END: internal FW use. - * @T2_V2_START_IMMEDIATELY: start time event immediately + * @TE_V2_START_IMMEDIATELY: start time event immediately   * @TE_V2_DEP_OTHER: depends on another time event   * @TE_V2_DEP_TSF: depends on a specific time   * @TE_V2_EVENT_SOCIOPATHIC: can't co-exist with other events of tha same MAC @@ -230,7 +230,7 @@ enum iwl_time_event_policy {  	TE_V2_NOTIF_HOST_FRAG_END = BIT(5),  	TE_V2_NOTIF_INTERNAL_FRAG_START = BIT(6),  	TE_V2_NOTIF_INTERNAL_FRAG_END = BIT(7), -	T2_V2_START_IMMEDIATELY = BIT(11), +	TE_V2_START_IMMEDIATELY = BIT(11),  	/* placement characteristics */  	TE_V2_DEP_OTHER = BIT(TE_V2_PLACEMENT_POS), diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c index 67aefc8fc9ac..7bd704a3e640 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c @@ -8,6 +8,7 @@   * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.   * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH   * Copyright(c) 2015 - 2017 Intel Deutschland GmbH + * Copyright(c) 2018        Intel Corporation   *   * 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 @@ -33,6 +34,7 @@   * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.   * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH   * Copyright(c) 2015 - 2017 Intel Deutschland GmbH + * Copyright(c) 2018        Intel Corporation   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without @@ -942,7 +944,6 @@ dump_trans_data:  out:  	iwl_fw_free_dump_desc(fwrt); -	fwrt->dump.trig = NULL;  	clear_bit(IWL_FWRT_STATUS_DUMPING, &fwrt->status);  	IWL_DEBUG_INFO(fwrt, "WRT dump done\n");  } @@ -1112,6 +1113,14 @@ void iwl_fw_error_dump_wk(struct work_struct *work)  	    fwrt->ops->dump_start(fwrt->ops_ctx))  		return; +	if (fwrt->ops && fwrt->ops->fw_running && +	    !fwrt->ops->fw_running(fwrt->ops_ctx)) { +		IWL_ERR(fwrt, "Firmware not running - cannot dump error\n"); +		iwl_fw_free_dump_desc(fwrt); +		clear_bit(IWL_FWRT_STATUS_DUMPING, &fwrt->status); +		goto out; +	} +  	if (fwrt->trans->cfg->device_family == IWL_DEVICE_FAMILY_7000) {  		/* stop recording */  		iwl_fw_dbg_stop_recording(fwrt); @@ -1145,7 +1154,7 @@ void iwl_fw_error_dump_wk(struct work_struct *work)  			iwl_write_prph(fwrt->trans, DBGC_OUT_CTRL, out_ctrl);  		}  	} - +out:  	if (fwrt->ops && fwrt->ops->dump_end)  		fwrt->ops->dump_end(fwrt->ops_ctx);  } diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.h b/drivers/net/wireless/intel/iwlwifi/fw/dbg.h index 223fb77a3aa9..72259bff9922 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.h @@ -8,6 +8,7 @@   * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.   * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH   * Copyright(c) 2015 - 2017 Intel Deutschland GmbH + * Copyright(c) 2018        Intel Corporation   *   * 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 @@ -33,6 +34,7 @@   * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.   * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH   * Copyright(c) 2015 - 2017 Intel Deutschland GmbH + * Copyright(c) 2018        Intel Corporation   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without @@ -91,6 +93,7 @@ static inline void iwl_fw_free_dump_desc(struct iwl_fw_runtime *fwrt)  	if (fwrt->dump.desc != &iwl_dump_desc_assert)  		kfree(fwrt->dump.desc);  	fwrt->dump.desc = NULL; +	fwrt->dump.trig = NULL;  }  void iwl_fw_error_dump(struct iwl_fw_runtime *fwrt); diff --git a/drivers/net/wireless/intel/iwlwifi/fw/debugfs.h b/drivers/net/wireless/intel/iwlwifi/fw/debugfs.h index e57ff92a68ae..3da468d2cc92 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/debugfs.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/debugfs.h @@ -75,6 +75,20 @@ static inline void iwl_fw_cancel_timestamp(struct iwl_fw_runtime *fwrt)  	cancel_delayed_work_sync(&fwrt->timestamp.wk);  } +static inline void iwl_fw_suspend_timestamp(struct iwl_fw_runtime *fwrt) +{ +	cancel_delayed_work_sync(&fwrt->timestamp.wk); +} + +static inline void iwl_fw_resume_timestamp(struct iwl_fw_runtime *fwrt) +{ +	if (!fwrt->timestamp.delay) +		return; + +	schedule_delayed_work(&fwrt->timestamp.wk, +			      round_jiffies_relative(fwrt->timestamp.delay)); +} +  #else  static inline int iwl_fwrt_dbgfs_register(struct iwl_fw_runtime *fwrt,  					  struct dentry *dbgfs_dir) @@ -84,4 +98,8 @@ static inline int iwl_fwrt_dbgfs_register(struct iwl_fw_runtime *fwrt,  static inline void iwl_fw_cancel_timestamp(struct iwl_fw_runtime *fwrt) {} +static inline void iwl_fw_suspend_timestamp(struct iwl_fw_runtime *fwrt) {} + +static inline void iwl_fw_resume_timestamp(struct iwl_fw_runtime *fwrt) {} +  #endif /* CONFIG_IWLWIFI_DEBUGFS */ diff --git a/drivers/net/wireless/intel/iwlwifi/fw/init.c b/drivers/net/wireless/intel/iwlwifi/fw/init.c index c39fe84bb4c4..2efac307909e 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/init.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/init.c @@ -77,8 +77,14 @@ void iwl_fw_runtime_init(struct iwl_fw_runtime *fwrt, struct iwl_trans *trans,  }  IWL_EXPORT_SYMBOL(iwl_fw_runtime_init); -void iwl_fw_runtime_exit(struct iwl_fw_runtime *fwrt) +void iwl_fw_runtime_suspend(struct iwl_fw_runtime *fwrt)  { -	iwl_fw_cancel_timestamp(fwrt); +	iwl_fw_suspend_timestamp(fwrt);  } -IWL_EXPORT_SYMBOL(iwl_fw_runtime_exit); +IWL_EXPORT_SYMBOL(iwl_fw_runtime_suspend); + +void iwl_fw_runtime_resume(struct iwl_fw_runtime *fwrt) +{ +	iwl_fw_resume_timestamp(fwrt); +} +IWL_EXPORT_SYMBOL(iwl_fw_runtime_resume); diff --git a/drivers/net/wireless/intel/iwlwifi/fw/runtime.h b/drivers/net/wireless/intel/iwlwifi/fw/runtime.h index e25c049f980f..3fb940ebd74a 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/runtime.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/runtime.h @@ -6,6 +6,7 @@   * GPL LICENSE SUMMARY   *   * Copyright(c) 2017 Intel Deutschland GmbH + * Copyright(c) 2018 Intel Corporation   *   * 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 @@ -26,6 +27,7 @@   * BSD LICENSE   *   * Copyright(c) 2017 Intel Deutschland GmbH + * Copyright(c) 2018 Intel Corporation   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without @@ -68,6 +70,7 @@  struct iwl_fw_runtime_ops {  	int (*dump_start)(void *ctx);  	void (*dump_end)(void *ctx); +	bool (*fw_running)(void *ctx);  };  #define MAX_NUM_LMAC 2 @@ -150,6 +153,10 @@ void iwl_fw_runtime_init(struct iwl_fw_runtime *fwrt, struct iwl_trans *trans,  void iwl_fw_runtime_exit(struct iwl_fw_runtime *fwrt); +void iwl_fw_runtime_suspend(struct iwl_fw_runtime *fwrt); + +void iwl_fw_runtime_resume(struct iwl_fw_runtime *fwrt); +  static inline void iwl_fw_set_current_image(struct iwl_fw_runtime *fwrt,  					    enum iwl_ucode_type cur_fw_img)  {  | 

