File tree Expand file tree Collapse file tree 5 files changed +23
-4
lines changed
drivers/net/wireless/intel/iwlwifi Expand file tree Collapse file tree 5 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -368,7 +368,7 @@ int iwl_power_update_mode(struct iwl_priv *priv, bool force)
368368/* initialize to default */
369369void 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
Original file line number Diff line number Diff 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 );
Original file line number Diff line number Diff 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__ */
Original file line number Diff line number Diff 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 */
407408struct 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
517520static inline struct iwl_trans_pcie *
@@ -1151,4 +1154,11 @@ int iwl_trans_pcie_copy_imr(struct iwl_trans *trans,
11511154int 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__ */
Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments