]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: iwlwifi: fw: add an error table status getter
authorYedidya Benshimol <yedidya.ben.shimol@intel.com>
Tue, 8 Oct 2024 04:25:26 +0000 (07:25 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 23 Oct 2024 14:44:03 +0000 (16:44 +0200)
Add a function for getting the error status and error
code for given error table.
Remove a static function of same purpose from mvm/d3.c

Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241008072037.610a38614ce6.Iab5f795bc30ce5d08550cff1772fe051527bcb95@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/dbg.h
drivers/net/wireless/intel/iwlwifi/fw/dump.c
drivers/net/wireless/intel/iwlwifi/mvm/d3.c

index 98d56e778d99ecd8b3711c459a963289eaac43f8..9d8f89adc322856af1c91878eeee2fde96322343 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
 /*
- * Copyright (C) 2005-2014, 2018-2019, 2021-2023 Intel Corporation
+ * Copyright (C) 2005-2014, 2018-2019, 2021-2024 Intel Corporation
  * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
  * Copyright (C) 2015-2017 Intel Deutschland GmbH
  */
@@ -327,6 +327,7 @@ void iwl_fwrt_dump_error_logs(struct iwl_fw_runtime *fwrt);
 void iwl_send_dbg_dump_complete_cmd(struct iwl_fw_runtime *fwrt,
                                    u32 timepoint,
                                    u32 timepoint_data);
+bool iwl_fwrt_read_err_table(struct iwl_trans *trans, u32 base, u32 *err_id);
 void iwl_fw_disable_dbg_asserts(struct iwl_fw_runtime *fwrt);
 void iwl_fw_dbg_clear_monitor_buf(struct iwl_fw_runtime *fwrt);
 
index 8f107ceec40767a56273e4fca8627e1d80cc16d7..3cabdeb53e99c8c9d65bb59d9c062ed75d838f6b 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
- * Copyright (C) 2012-2014, 2018-2023 Intel Corporation
+ * Copyright (C) 2012-2014, 2018-2024 Intel Corporation
  * Copyright (C) 2013-2014 Intel Mobile Communications GmbH
  * Copyright (C) 2015-2017 Intel Deutschland GmbH
  */
@@ -530,3 +530,23 @@ void iwl_fwrt_dump_error_logs(struct iwl_fw_runtime *fwrt)
        }
 }
 IWL_EXPORT_SYMBOL(iwl_fwrt_dump_error_logs);
+
+bool iwl_fwrt_read_err_table(struct iwl_trans *trans, u32 base, u32 *err_id)
+{
+       struct error_table_start {
+               /* cf. struct iwl_error_event_table */
+               u32 valid;
+               __le32 err_id;
+       } err_info;
+
+       if (!base)
+               return false;
+
+       iwl_trans_read_mem_bytes(trans, base,
+                                &err_info, sizeof(err_info));
+       if (err_info.valid && err_id)
+               *err_id = le32_to_cpu(err_info.err_id);
+
+       return !!err_info.valid;
+}
+IWL_EXPORT_SYMBOL(iwl_fwrt_read_err_table);
index 49a6aff42376b5f0cb8af791542247327dde5431..9f41b9af52693c2a6db9850de5c7053e5c18c916 100644 (file)
@@ -3024,24 +3024,6 @@ static void iwl_mvm_d3_disconnect_iter(void *data, u8 *mac,
                ieee80211_resume_disconnect(vif);
 }
 
-static bool iwl_mvm_rt_status(struct iwl_trans *trans, u32 base, u32 *err_id)
-{
-       struct error_table_start {
-               /* cf. struct iwl_error_event_table */
-               u32 valid;
-               __le32 err_id;
-       } err_info;
-
-       if (!base)
-               return false;
-
-       iwl_trans_read_mem_bytes(trans, base,
-                                &err_info, sizeof(err_info));
-       if (err_info.valid && err_id)
-               *err_id = le32_to_cpu(err_info.err_id);
-
-       return !!err_info.valid;
-}
 
 static bool iwl_mvm_check_rt_status(struct iwl_mvm *mvm,
                                   struct ieee80211_vif *vif)
@@ -3049,9 +3031,9 @@ static bool iwl_mvm_check_rt_status(struct iwl_mvm *mvm,
        u32 err_id;
 
        /* check for lmac1 error */
-       if (iwl_mvm_rt_status(mvm->trans,
-                             mvm->trans->dbg.lmac_error_event_table[0],
-                             &err_id)) {
+       if (iwl_fwrt_read_err_table(mvm->trans,
+                                   mvm->trans->dbg.lmac_error_event_table[0],
+                                   &err_id)) {
                if (err_id == RF_KILL_INDICATOR_FOR_WOWLAN && vif) {
                        struct cfg80211_wowlan_wakeup wakeup = {
                                .rfkill_release = true,
@@ -3063,13 +3045,15 @@ static bool iwl_mvm_check_rt_status(struct iwl_mvm *mvm,
        }
 
        /* check if we have lmac2 set and check for error */
-       if (iwl_mvm_rt_status(mvm->trans,
-                             mvm->trans->dbg.lmac_error_event_table[1], NULL))
+       if (iwl_fwrt_read_err_table(mvm->trans,
+                                   mvm->trans->dbg.lmac_error_event_table[1],
+                                   NULL))
                return true;
 
        /* check for umac error */
-       if (iwl_mvm_rt_status(mvm->trans,
-                             mvm->trans->dbg.umac_error_event_table, NULL))
+       if (iwl_fwrt_read_err_table(mvm->trans,
+                                   mvm->trans->dbg.umac_error_event_table,
+                                   NULL))
                return true;
 
        return false;