aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShahar S Matityahu <shahar.s.matityahu@intel.com>2017-12-28 03:19:43 -0500
committerLuca Coelho <luciano.coelho@intel.com>2018-03-28 15:43:40 -0400
commit378c8931342f99c5a6fce21e38ef46ac39395464 (patch)
tree0468ddcb4342037e75bc26b0d62409171a8b36a9
parent9b137866f9a2699698cfffb0b7729331a419d617 (diff)
iwlwifi: wrt: add fw force restart via triggers
We can set triggers that cause a debug data collection when something of interest happens (e.g. when too many probes are lost conscutively). Normally, this triggers don't cause the FW to be restarted, but in some cases that may be desired, so we recover from the problem. To support this, add a flag that indicates that the FW should be restarted when the trigger fires. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
-rw-r--r--drivers/net/wireless/intel/iwlwifi/fw/dbg.c6
-rw-r--r--drivers/net/wireless/intel/iwlwifi/fw/file.h12
2 files changed, 17 insertions, 1 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
index d27a43ea0d7c..fa283285fcbe 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
@@ -1008,6 +1008,12 @@ int iwl_fw_dbg_collect(struct iwl_fw_runtime *fwrt,
1008{ 1008{
1009 struct iwl_fw_dump_desc *desc; 1009 struct iwl_fw_dump_desc *desc;
1010 1010
1011 if (trigger && trigger->flags & IWL_FW_DBG_FORCE_RESTART) {
1012 IWL_WARN(fwrt, "Force restart: trigger %d fired.\n", trig);
1013 iwl_force_nmi(fwrt->trans);
1014 return 0;
1015 }
1016
1011 desc = kzalloc(sizeof(*desc) + len, GFP_ATOMIC); 1017 desc = kzalloc(sizeof(*desc) + len, GFP_ATOMIC);
1012 if (!desc) 1018 if (!desc)
1013 return -ENOMEM; 1019 return -ENOMEM;
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/file.h b/drivers/net/wireless/intel/iwlwifi/fw/file.h
index 2bea95bf4fc9..9b2805e1e3b1 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/file.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/file.h
@@ -621,6 +621,14 @@ enum iwl_fw_dbg_trigger_mode {
621}; 621};
622 622
623/** 623/**
624 * enum iwl_fw_dbg_trigger_flags - the flags supported by wrt triggers
625 * @IWL_FW_DBG_FORCE_RESTART: force a firmware restart
626 */
627enum iwl_fw_dbg_trigger_flags {
628 IWL_FW_DBG_FORCE_RESTART = BIT(0),
629};
630
631/**
624 * enum iwl_fw_dbg_trigger_vif_type - define the VIF type for a trigger 632 * enum iwl_fw_dbg_trigger_vif_type - define the VIF type for a trigger
625 * @IWL_FW_DBG_CONF_VIF_ANY: any vif type 633 * @IWL_FW_DBG_CONF_VIF_ANY: any vif type
626 * @IWL_FW_DBG_CONF_VIF_IBSS: IBSS mode 634 * @IWL_FW_DBG_CONF_VIF_IBSS: IBSS mode
@@ -656,6 +664,7 @@ enum iwl_fw_dbg_trigger_vif_type {
656 * @occurrences: number of occurrences. 0 means the trigger will never fire. 664 * @occurrences: number of occurrences. 0 means the trigger will never fire.
657 * @trig_dis_ms: the time, in milliseconds, after an occurrence of this 665 * @trig_dis_ms: the time, in milliseconds, after an occurrence of this
658 * trigger in which another occurrence should be ignored. 666 * trigger in which another occurrence should be ignored.
667 * @flags: &enum iwl_fw_dbg_trigger_flags
659 */ 668 */
660struct iwl_fw_dbg_trigger_tlv { 669struct iwl_fw_dbg_trigger_tlv {
661 __le32 id; 670 __le32 id;
@@ -666,7 +675,8 @@ struct iwl_fw_dbg_trigger_tlv {
666 u8 start_conf_id; 675 u8 start_conf_id;
667 __le16 occurrences; 676 __le16 occurrences;
668 __le16 trig_dis_ms; 677 __le16 trig_dis_ms;
669 __le16 reserved[3]; 678 u8 flags;
679 u8 reserved[5];
670 680
671 u8 data[0]; 681 u8 data[0];
672} __packed; 682} __packed;