]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: iwlwifi: pcie: move ltr_enabled to the specific transport
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Tue, 9 Sep 2025 03:21:18 +0000 (06:21 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Tue, 9 Sep 2025 09:08:34 +0000 (12:08 +0300)
Currently it is under iwl_trans, which is the bus agnostic part of the
transport. But really it is relevant for pcie only, so move it to the
iwl_trans_pcie and export it via an API to the opmode.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250909061931.9f9dc80ab06c.I3eeca8b17abeba6ed30f0d681518c81ede0acf30@changeid
drivers/net/wireless/intel/iwlwifi/iwl-trans.c
drivers/net/wireless/intel/iwlwifi/iwl-trans.h
drivers/net/wireless/intel/iwlwifi/mvm/fw.c
drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/internal.h
drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans.c

index b428cb522d0d319b5405158e56d27228f988e660..5232f66c2d52ab4371a6f8783c6e29205f72d325 100644 (file)
@@ -816,3 +816,9 @@ bool iwl_trans_is_pm_supported(struct iwl_trans *trans)
        return iwl_pcie_gen1_is_pm_supported(trans);
 }
 IWL_EXPORT_SYMBOL(iwl_trans_is_pm_supported);
+
+bool iwl_trans_is_ltr_enabled(struct iwl_trans *trans)
+{
+       return iwl_pcie_gen1_2_is_ltr_enabled(trans);
+}
+IWL_EXPORT_SYMBOL(iwl_trans_is_ltr_enabled);
index e5d38b3bd76a416df9534b8e76666623d676f97f..a0cc5d7745e8f6a5ad12c75a379ad56aabc8cf60 100644 (file)
@@ -844,7 +844,6 @@ struct iwl_trans_info {
  * @dev: pointer to struct device * that represents the device
  * @info: device information for use by other layers
  * @pnvm_loaded: indicates PNVM was loaded
- * @ltr_enabled: set to true if the LTR is enabled
  * @suppress_cmd_error_once: suppress "FW error in SYNC CMD" once,
  *     e.g. for testing
  * @fail_to_parse_pnvm_image: set to true if pnvm parsing failed
@@ -883,7 +882,6 @@ struct iwl_trans {
        bool step_urm;
        bool suppress_cmd_error_once;
 
-       bool ltr_enabled;
        u8 pnvm_loaded:1;
        u8 fail_to_parse_pnvm_image:1;
        u8 reduce_power_loaded:1;
@@ -1262,4 +1260,6 @@ static inline u16 iwl_trans_get_device_id(struct iwl_trans *trans)
 
 bool iwl_trans_is_pm_supported(struct iwl_trans *trans);
 
+bool iwl_trans_is_ltr_enabled(struct iwl_trans *trans);
+
 #endif /* __iwl_trans_h__ */
index d931c6eaf12f84b07f4156730855ae885cffdc78..865f973f677dbae2f3537169cc5077c3795e217f 100644 (file)
@@ -837,7 +837,7 @@ static int iwl_mvm_config_ltr(struct iwl_mvm *mvm)
                .flags = cpu_to_le32(LTR_CFG_FLAG_FEATURE_ENABLE),
        };
 
-       if (!mvm->trans->ltr_enabled)
+       if (!iwl_trans_is_ltr_enabled(mvm->trans))
                return 0;
 
        return iwl_mvm_send_cmd_pdu(mvm, LTR_CONFIG, 0,
index 2ee3bf4869d25defe696f7261d024e6addcded62..207c56e338dde260734c98977373f691a6c5d486 100644 (file)
@@ -404,6 +404,7 @@ struct iwl_pcie_txqs {
  *     The user should use iwl_trans_{alloc,free}_tx_cmd.
  * @dev_cmd_pool_name: name for the TX command allocation pool
  * @pm_support: set to true in start_hw if link pm is supported
+ * @ltr_enabled: set to true if the LTR is enabled
  */
 struct iwl_trans_pcie {
        struct iwl_rxq *rxq;
@@ -515,6 +516,7 @@ struct iwl_trans_pcie {
        char dev_cmd_pool_name[50];
 
        bool pm_support;
+       bool ltr_enabled;
 };
 
 static inline struct iwl_trans_pcie *
@@ -1161,4 +1163,10 @@ static inline bool iwl_pcie_gen1_is_pm_supported(struct iwl_trans *trans)
        return trans_pcie->pm_support;
 }
 
+static inline bool iwl_pcie_gen1_2_is_ltr_enabled(struct iwl_trans *trans)
+{
+       struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
+
+       return trans_pcie->ltr_enabled;
+}
 #endif /* __iwl_trans_int_pcie_h__ */
index c1fe87fb64c682d935e99cb3c53f939bd472b64b..59307b5df4417d2cf13099f8e5f6513e090cba73 100644 (file)
@@ -217,10 +217,10 @@ void iwl_pcie_apm_config(struct iwl_trans *trans)
        trans_pcie->pm_support = !(lctl & PCI_EXP_LNKCTL_ASPM_L0S);
 
        pcie_capability_read_word(trans_pcie->pci_dev, PCI_EXP_DEVCTL2, &cap);
-       trans->ltr_enabled = cap & PCI_EXP_DEVCTL2_LTR_EN;
+       trans_pcie->ltr_enabled = cap & PCI_EXP_DEVCTL2_LTR_EN;
        IWL_DEBUG_POWER(trans, "L1 %sabled - LTR %sabled\n",
                        (lctl & PCI_EXP_LNKCTL_ASPM_L1) ? "En" : "Dis",
-                       trans->ltr_enabled ? "En" : "Dis");
+                       trans_pcie->ltr_enabled ? "En" : "Dis");
 }
 
 /*