Skip to content

Commit 579c6a6

Browse files
committed
wifi: iwlwifi: pcie: move pm_support 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.997193cabd04.Ic6648f040430c94150d0fa11601f50a6a630b862@changeid
1 parent da4234c commit 579c6a6

File tree

5 files changed

+23
-4
lines changed

5 files changed

+23
-4
lines changed

drivers/net/wireless/intel/iwlwifi/dvm/power.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ int iwl_power_update_mode(struct iwl_priv *priv, bool force)
368368
/* initialize to default */
369369
void iwl_power_initialize(struct iwl_priv *priv)
370370
{
371-
priv->power_data.bus_pm = priv->trans->pm_support;
371+
priv->power_data.bus_pm = iwl_trans_is_pm_supported(priv->trans);
372372

373373
priv->power_data.debug_sleep_level_override = -1;
374374

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,3 +807,12 @@ void iwl_trans_set_reduce_power(struct iwl_trans *trans,
807807
{
808808
iwl_trans_pcie_ctx_info_v2_set_reduce_power(trans, capa);
809809
}
810+
811+
bool iwl_trans_is_pm_supported(struct iwl_trans *trans)
812+
{
813+
if (WARN_ON(trans->mac_cfg->gen2))
814+
return false;
815+
816+
return iwl_pcie_gen1_is_pm_supported(trans);
817+
}
818+
IWL_EXPORT_SYMBOL(iwl_trans_is_pm_supported);

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-
* @pm_support: set to true in start_hw if link pm is supported
848847
* @ltr_enabled: set to true if the LTR is enabled
849848
* @suppress_cmd_error_once: suppress "FW error in SYNC CMD" once,
850849
* e.g. for testing
@@ -884,7 +883,6 @@ struct iwl_trans {
884883
bool step_urm;
885884
bool suppress_cmd_error_once;
886885

887-
bool pm_support;
888886
bool ltr_enabled;
889887
u8 pnvm_loaded:1;
890888
u8 fail_to_parse_pnvm_image:1;
@@ -1262,4 +1260,6 @@ static inline u16 iwl_trans_get_device_id(struct iwl_trans *trans)
12621260
return u32_get_bits(trans->info.hw_id, GENMASK(31, 16));
12631261
}
12641262

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

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ struct iwl_pcie_txqs {
403403
* @dev_cmd_pool: pool for Tx cmd allocation - for internal use only.
404404
* The user should use iwl_trans_{alloc,free}_tx_cmd.
405405
* @dev_cmd_pool_name: name for the TX command allocation pool
406+
* @pm_support: set to true in start_hw if link pm is supported
406407
*/
407408
struct iwl_trans_pcie {
408409
struct iwl_rxq *rxq;
@@ -512,6 +513,8 @@ struct iwl_trans_pcie {
512513

513514
struct kmem_cache *dev_cmd_pool;
514515
char dev_cmd_pool_name[50];
516+
517+
bool pm_support;
515518
};
516519

517520
static inline struct iwl_trans_pcie *
@@ -1151,4 +1154,11 @@ int iwl_trans_pcie_copy_imr(struct iwl_trans *trans,
11511154
int iwl_trans_pcie_rxq_dma_data(struct iwl_trans *trans, int queue,
11521155
struct iwl_trans_rxq_dma_data *data);
11531156

1157+
static inline bool iwl_pcie_gen1_is_pm_supported(struct iwl_trans *trans)
1158+
{
1159+
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
1160+
1161+
return trans_pcie->pm_support;
1162+
}
1163+
11541164
#endif /* __iwl_trans_int_pcie_h__ */

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ void iwl_pcie_apm_config(struct iwl_trans *trans)
214214
iwl_set_bit(trans, CSR_GIO_REG, CSR_GIO_REG_VAL_L0S_DISABLED);
215215

216216
pcie_capability_read_word(trans_pcie->pci_dev, PCI_EXP_LNKCTL, &lctl);
217-
trans->pm_support = !(lctl & PCI_EXP_LNKCTL_ASPM_L0S);
217+
trans_pcie->pm_support = !(lctl & PCI_EXP_LNKCTL_ASPM_L0S);
218218

219219
pcie_capability_read_word(trans_pcie->pci_dev, PCI_EXP_DEVCTL2, &cap);
220220
trans->ltr_enabled = cap & PCI_EXP_DEVCTL2_LTR_EN;

0 commit comments

Comments
 (0)