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

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.bb957ba9e130.I6ab825caf41308fb0f7aa1c266f50457fd0c496e@changeid
drivers/net/wireless/intel/iwlwifi/fw/dbg.c
drivers/net/wireless/intel/iwlwifi/fw/dump.c
drivers/net/wireless/intel/iwlwifi/iwl-trans.h
drivers/net/wireless/intel/iwlwifi/mvm/scan.c

index fd60a68161508192ae4bc9cf7e2f48d1cf549f43..ed72199c0b2133661015caf3c89856bcae01e90a 100644 (file)
@@ -2978,7 +2978,7 @@ IWL_EXPORT_SYMBOL(iwl_fw_dbg_collect_desc);
 int iwl_fw_dbg_error_collect(struct iwl_fw_runtime *fwrt,
                             enum iwl_fw_dbg_trigger trig_type)
 {
-       if (!test_bit(STATUS_DEVICE_ENABLED, &fwrt->trans->status))
+       if (!iwl_trans_device_enabled(fwrt->trans))
                return -EIO;
 
        if (iwl_trans_dbg_ini_valid(fwrt->trans)) {
@@ -3180,7 +3180,7 @@ static void iwl_fw_dbg_collect_sync(struct iwl_fw_runtime *fwrt, u8 wk_idx)
                goto out;
        }
 
-       if (!test_bit(STATUS_DEVICE_ENABLED, &fwrt->trans->status)) {
+       if (!iwl_trans_device_enabled(fwrt->trans)) {
                IWL_ERR(fwrt, "Device is not enabled - cannot dump error\n");
                goto out;
        }
index 4e1ef165f05864a3dfabb1da3cc13c483133ab0c..f633124979ab364aa6d7cbd02fe481b6cc254541 100644 (file)
@@ -490,7 +490,7 @@ void iwl_fwrt_dump_error_logs(struct iwl_fw_runtime *fwrt)
        struct iwl_pc_data *pc_data;
        u8 count;
 
-       if (!test_bit(STATUS_DEVICE_ENABLED, &fwrt->trans->status)) {
+       if (!iwl_trans_device_enabled(fwrt->trans)) {
                IWL_ERR(fwrt,
                        "DEVICE_ENABLED bit is not set. Aborting dump.\n");
                return;
index aa0c8ca828054f522a1c3749b64d30b7de6da043..200a8d5d5bb622e7bdb7d92d0fce9cd381a7570f 100644 (file)
@@ -1235,6 +1235,11 @@ static inline void iwl_trans_suppress_cmd_error_once(struct iwl_trans *trans)
        set_bit(STATUS_SUPPRESS_CMD_ERROR_ONCE, &trans->status);
 }
 
+static inline bool iwl_trans_device_enabled(struct iwl_trans *trans)
+{
+       return test_bit(STATUS_DEVICE_ENABLED, &trans->status);
+}
+
 /*****************************************************
  * PCIe handling
  *****************************************************/
index 79660138ae976c0514cb154128879a6f96c94e30..9ce1ce0dab340d7f95a4e2722442102394ac0313 100644 (file)
@@ -3547,7 +3547,7 @@ int iwl_mvm_scan_stop(struct iwl_mvm *mvm, int type, bool notify)
        if (!(mvm->scan_status & type))
                return 0;
 
-       if (!test_bit(STATUS_DEVICE_ENABLED, &mvm->trans->status)) {
+       if (!iwl_trans_device_enabled(mvm->trans)) {
                ret = 0;
                goto out;
        }