]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: iwlwifi: add iwl_trans_is_dead() API
authorRotem Kerem <rotem.kerem@intel.com>
Thu, 10 Jul 2025 18:28:25 +0000 (21:28 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Fri, 11 Jul 2025 15:28:31 +0000 (18:28 +0300)
Add iwl_trans_is_dead() function to be called by the op modes instead
of directly checking the trans status bits. This hides the trans
internal implementation details from callers.

Signed-off-by: Rotem Kerem <rotem.kerem@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250710212632.cd89d8013261.I214b7ffbabc393593fb57831d61d1a9ffa318a1e@changeid
drivers/net/wireless/intel/iwlwifi/fw/dbg.c
drivers/net/wireless/intel/iwlwifi/iwl-drv.c
drivers/net/wireless/intel/iwlwifi/iwl-trans.h
drivers/net/wireless/intel/iwlwifi/mld/mld.c
drivers/net/wireless/intel/iwlwifi/mvm/ops.c

index ed72199c0b2133661015caf3c89856bcae01e90a..2879be4b8fcb34cad2b9f8c2cf349ba8e3146c3e 100644 (file)
@@ -3186,7 +3186,7 @@ static void iwl_fw_dbg_collect_sync(struct iwl_fw_runtime *fwrt, u8 wk_idx)
        }
 
        /* there's no point in fw dump if the bus is dead */
-       if (test_bit(STATUS_TRANS_DEAD, &fwrt->trans->status)) {
+       if (iwl_trans_is_dead(fwrt->trans)) {
                IWL_ERR(fwrt, "Skip fw error dump since bus is dead\n");
                goto out;
        }
index 2dff87c0751278d29b486092f59e740a1c5f0eee..6d983fe2ee448a0c8ebd61622ccb1757ac084b5c 100644 (file)
@@ -1545,7 +1545,7 @@ _iwl_op_mode_start(struct iwl_drv *drv, struct iwlwifi_opmode_table *op)
                if (!IS_ERR(op_mode))
                        return op_mode;
 
-               if (test_bit(STATUS_TRANS_DEAD, &drv->trans->status))
+               if (iwl_trans_is_dead(drv->trans))
                        break;
 
 #ifdef CONFIG_IWLWIFI_DEBUGFS
index 200a8d5d5bb622e7bdb7d92d0fce9cd381a7570f..d0e658801c2e01c9442d4b8133c7d7bfef030970 100644 (file)
@@ -1240,6 +1240,11 @@ static inline bool iwl_trans_device_enabled(struct iwl_trans *trans)
        return test_bit(STATUS_DEVICE_ENABLED, &trans->status);
 }
 
+static inline bool iwl_trans_is_dead(struct iwl_trans *trans)
+{
+       return test_bit(STATUS_TRANS_DEAD, &trans->status);
+}
+
 /*****************************************************
  * PCIe handling
  *****************************************************/
index 7ade5b7144577c557b51590e6256830e692052b6..12682396bdc36171848c144fbc7d16991cb733df 100644 (file)
@@ -630,7 +630,7 @@ iwl_mld_nic_error(struct iwl_op_mode *op_mode,
                  enum iwl_fw_error_type type)
 {
        struct iwl_mld *mld = IWL_OP_MODE_GET_MLD(op_mode);
-       bool trans_dead = test_bit(STATUS_TRANS_DEAD, &mld->trans->status);
+       bool trans_dead = iwl_trans_is_dead(mld->trans);
 
        if (type == IWL_ERR_TYPE_CMD_QUEUE_FULL)
                IWL_ERR(mld, "Command queue full!\n");
index 7dfae8b1a43e2a28ae5d43346da1eedf5a90e48a..eb1b2f182be53637511650676ed0fb210b735a90 100644 (file)
@@ -2053,7 +2053,7 @@ static void iwl_mvm_nic_error(struct iwl_op_mode *op_mode,
 
        if (type == IWL_ERR_TYPE_CMD_QUEUE_FULL)
                IWL_ERR(mvm, "Command queue full!\n");
-       else if (!test_bit(STATUS_TRANS_DEAD, &mvm->trans->status) &&
+       else if (!iwl_trans_is_dead(mvm->trans) &&
                 !test_and_clear_bit(IWL_MVM_STATUS_SUPPRESS_ERROR_LOG_ONCE,
                                     &mvm->status))
                iwl_mvm_dump_nic_error_log(mvm);