Skip to content

Commit 6a5114d

Browse files
committed
wifi: iwlwifi: pcie: move ltr_enabled to the specific transport
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 <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20250909061931.9f9dc80ab06c.I3eeca8b17abeba6ed30f0d681518c81ede0acf30@changeid
1 parent 579c6a6 commit 6a5114d

File tree

5 files changed

+19
-5
lines changed

5 files changed

+19
-5
lines changed

drivers/net/wireless/intel/iwlwifi/iwl-trans.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,3 +816,9 @@ bool iwl_trans_is_pm_supported(struct iwl_trans *trans)
816816
return iwl_pcie_gen1_is_pm_supported(trans);
817817
}
818818
IWL_EXPORT_SYMBOL(iwl_trans_is_pm_supported);
819+
820+
bool iwl_trans_is_ltr_enabled(struct iwl_trans *trans)
821+
{
822+
return iwl_pcie_gen1_2_is_ltr_enabled(trans);
823+
}
824+
IWL_EXPORT_SYMBOL(iwl_trans_is_ltr_enabled);

drivers/net/wireless/intel/iwlwifi/iwl-trans.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,6 @@ struct iwl_trans_info {
844844
* @dev: pointer to struct device * that represents the device
845845
* @info: device information for use by other layers
846846
* @pnvm_loaded: indicates PNVM was loaded
847-
* @ltr_enabled: set to true if the LTR is enabled
848847
* @suppress_cmd_error_once: suppress "FW error in SYNC CMD" once,
849848
* e.g. for testing
850849
* @fail_to_parse_pnvm_image: set to true if pnvm parsing failed
@@ -883,7 +882,6 @@ struct iwl_trans {
883882
bool step_urm;
884883
bool suppress_cmd_error_once;
885884

886-
bool ltr_enabled;
887885
u8 pnvm_loaded:1;
888886
u8 fail_to_parse_pnvm_image:1;
889887
u8 reduce_power_loaded:1;
@@ -1262,4 +1260,6 @@ static inline u16 iwl_trans_get_device_id(struct iwl_trans *trans)
12621260

12631261
bool iwl_trans_is_pm_supported(struct iwl_trans *trans);
12641262

1263+
bool iwl_trans_is_ltr_enabled(struct iwl_trans *trans);
1264+
12651265
#endif /* __iwl_trans_h__ */

drivers/net/wireless/intel/iwlwifi/mvm/fw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ static int iwl_mvm_config_ltr(struct iwl_mvm *mvm)
837837
.flags = cpu_to_le32(LTR_CFG_FLAG_FEATURE_ENABLE),
838838
};
839839

840-
if (!mvm->trans->ltr_enabled)
840+
if (!iwl_trans_is_ltr_enabled(mvm->trans))
841841
return 0;
842842

843843
return iwl_mvm_send_cmd_pdu(mvm, LTR_CONFIG, 0,

drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/internal.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ struct iwl_pcie_txqs {
404404
* The user should use iwl_trans_{alloc,free}_tx_cmd.
405405
* @dev_cmd_pool_name: name for the TX command allocation pool
406406
* @pm_support: set to true in start_hw if link pm is supported
407+
* @ltr_enabled: set to true if the LTR is enabled
407408
*/
408409
struct iwl_trans_pcie {
409410
struct iwl_rxq *rxq;
@@ -515,6 +516,7 @@ struct iwl_trans_pcie {
515516
char dev_cmd_pool_name[50];
516517

517518
bool pm_support;
519+
bool ltr_enabled;
518520
};
519521

520522
static inline struct iwl_trans_pcie *
@@ -1161,4 +1163,10 @@ static inline bool iwl_pcie_gen1_is_pm_supported(struct iwl_trans *trans)
11611163
return trans_pcie->pm_support;
11621164
}
11631165

1166+
static inline bool iwl_pcie_gen1_2_is_ltr_enabled(struct iwl_trans *trans)
1167+
{
1168+
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
1169+
1170+
return trans_pcie->ltr_enabled;
1171+
}
11641172
#endif /* __iwl_trans_int_pcie_h__ */

drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,10 @@ void iwl_pcie_apm_config(struct iwl_trans *trans)
217217
trans_pcie->pm_support = !(lctl & PCI_EXP_LNKCTL_ASPM_L0S);
218218

219219
pcie_capability_read_word(trans_pcie->pci_dev, PCI_EXP_DEVCTL2, &cap);
220-
trans->ltr_enabled = cap & PCI_EXP_DEVCTL2_LTR_EN;
220+
trans_pcie->ltr_enabled = cap & PCI_EXP_DEVCTL2_LTR_EN;
221221
IWL_DEBUG_POWER(trans, "L1 %sabled - LTR %sabled\n",
222222
(lctl & PCI_EXP_LNKCTL_ASPM_L1) ? "En" : "Dis",
223-
trans->ltr_enabled ? "En" : "Dis");
223+
trans_pcie->ltr_enabled ? "En" : "Dis");
224224
}
225225

226226
/*

0 commit comments

Comments
 (0)