diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2012-01-08 14:19:45 -0500 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2012-02-02 17:37:12 -0500 |
commit | f6d0e9be6580ba607f730d7e056518c95a864601 (patch) | |
tree | 3f34b23e26c34350ed042b6ea9b83270bca44876 /drivers | |
parent | af634bee8c4a15629da5e114c491acb8ee50e1e9 (diff) |
iwlwifi: kill bus_is_pm_supported
Get this information from the transport layer which is now in charge
of the APM too.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-bus.h | 7 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-pci.c | 20 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-power.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans.h | 2 |
5 files changed, 4 insertions, 28 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-bus.h b/drivers/net/wireless/iwlwifi/iwl-bus.h index d385f692ef11..2b0b48edf283 100644 --- a/drivers/net/wireless/iwlwifi/iwl-bus.h +++ b/drivers/net/wireless/iwlwifi/iwl-bus.h | |||
@@ -120,12 +120,10 @@ struct iwl_bus; | |||
120 | 120 | ||
121 | /** | 121 | /** |
122 | * struct iwl_bus_ops - bus specific operations | 122 | * struct iwl_bus_ops - bus specific operations |
123 | * @get_pm_support: must returns true if the bus can go to sleep | ||
124 | * @get_hw_id_string: prints the hw_id in the provided buffer | 123 | * @get_hw_id_string: prints the hw_id in the provided buffer |
125 | * @get_hw_id: get hw_id in u32 | 124 | * @get_hw_id: get hw_id in u32 |
126 | */ | 125 | */ |
127 | struct iwl_bus_ops { | 126 | struct iwl_bus_ops { |
128 | bool (*get_pm_support)(struct iwl_bus *bus); | ||
129 | void (*get_hw_id_string)(struct iwl_bus *bus, char buf[], int buf_len); | 127 | void (*get_hw_id_string)(struct iwl_bus *bus, char buf[], int buf_len); |
130 | u32 (*get_hw_id)(struct iwl_bus *bus); | 128 | u32 (*get_hw_id)(struct iwl_bus *bus); |
131 | }; | 129 | }; |
@@ -149,11 +147,6 @@ struct iwl_bus { | |||
149 | char bus_specific[0] __attribute__((__aligned__(sizeof(void *)))); | 147 | char bus_specific[0] __attribute__((__aligned__(sizeof(void *)))); |
150 | }; | 148 | }; |
151 | 149 | ||
152 | static inline bool bus_get_pm_support(struct iwl_bus *bus) | ||
153 | { | ||
154 | return bus->ops->get_pm_support(bus); | ||
155 | } | ||
156 | |||
157 | static inline void bus_get_hw_id_string(struct iwl_bus *bus, char buf[], | 150 | static inline void bus_get_hw_id_string(struct iwl_bus *bus, char buf[], |
158 | int buf_len) | 151 | int buf_len) |
159 | { | 152 | { |
diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c b/drivers/net/wireless/iwlwifi/iwl-pci.c index 353022d406ea..0c16efebf93d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-pci.c +++ b/drivers/net/wireless/iwlwifi/iwl-pci.c | |||
@@ -87,25 +87,6 @@ struct iwl_pci_bus { | |||
87 | #define IWL_BUS_GET_PCI_DEV(_iwl_bus) \ | 87 | #define IWL_BUS_GET_PCI_DEV(_iwl_bus) \ |
88 | ((IWL_BUS_GET_PCI_BUS(_iwl_bus))->pci_dev) | 88 | ((IWL_BUS_GET_PCI_BUS(_iwl_bus))->pci_dev) |
89 | 89 | ||
90 | static u16 iwl_pciexp_link_ctrl(struct iwl_bus *bus) | ||
91 | { | ||
92 | int pos; | ||
93 | u16 pci_lnk_ctl; | ||
94 | |||
95 | struct pci_dev *pci_dev = IWL_BUS_GET_PCI_DEV(bus); | ||
96 | |||
97 | pos = pci_pcie_cap(pci_dev); | ||
98 | pci_read_config_word(pci_dev, pos + PCI_EXP_LNKCTL, &pci_lnk_ctl); | ||
99 | return pci_lnk_ctl; | ||
100 | } | ||
101 | |||
102 | static bool iwl_pci_is_pm_supported(struct iwl_bus *bus) | ||
103 | { | ||
104 | u16 lctl = iwl_pciexp_link_ctrl(bus); | ||
105 | |||
106 | return !(lctl & PCI_CFG_LINK_CTRL_VAL_L0S_EN); | ||
107 | } | ||
108 | |||
109 | static void iwl_pci_get_hw_id_string(struct iwl_bus *bus, char buf[], | 90 | static void iwl_pci_get_hw_id_string(struct iwl_bus *bus, char buf[], |
110 | int buf_len) | 91 | int buf_len) |
111 | { | 92 | { |
@@ -123,7 +104,6 @@ static u32 iwl_pci_get_hw_id(struct iwl_bus *bus) | |||
123 | } | 104 | } |
124 | 105 | ||
125 | static const struct iwl_bus_ops bus_ops_pci = { | 106 | static const struct iwl_bus_ops bus_ops_pci = { |
126 | .get_pm_support = iwl_pci_is_pm_supported, | ||
127 | .get_hw_id_string = iwl_pci_get_hw_id_string, | 107 | .get_hw_id_string = iwl_pci_get_hw_id_string, |
128 | .get_hw_id = iwl_pci_get_hw_id, | 108 | .get_hw_id = iwl_pci_get_hw_id, |
129 | }; | 109 | }; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c index c7394ef2e490..fd008c4e41fd 100644 --- a/drivers/net/wireless/iwlwifi/iwl-power.c +++ b/drivers/net/wireless/iwlwifi/iwl-power.c | |||
@@ -436,7 +436,7 @@ int iwl_power_update_mode(struct iwl_priv *priv, bool force) | |||
436 | /* initialize to default */ | 436 | /* initialize to default */ |
437 | void iwl_power_initialize(struct iwl_priv *priv) | 437 | void iwl_power_initialize(struct iwl_priv *priv) |
438 | { | 438 | { |
439 | priv->power_data.bus_pm = bus_get_pm_support(bus(priv)); | 439 | priv->power_data.bus_pm = trans(priv)->pm_support; |
440 | 440 | ||
441 | priv->power_data.debug_sleep_level_override = -1; | 441 | priv->power_data.debug_sleep_level_override = -1; |
442 | 442 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c index c9fe8889ad82..8ebb5a54441c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | |||
@@ -676,6 +676,7 @@ static void iwl_apm_config(struct iwl_trans *trans) | |||
676 | dev_printk(KERN_INFO, trans->dev, | 676 | dev_printk(KERN_INFO, trans->dev, |
677 | "L1 Disabled; Enabling L0S\n"); | 677 | "L1 Disabled; Enabling L0S\n"); |
678 | } | 678 | } |
679 | trans->pm_support = !(lctl & PCI_CFG_LINK_CTRL_VAL_L0S_EN); | ||
679 | } | 680 | } |
680 | 681 | ||
681 | /* | 682 | /* |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index 4d1ae65b68ed..7f6963ffa7ca 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h | |||
@@ -239,6 +239,7 @@ struct iwl_calib_result { | |||
239 | * @ucode_init: init ucode image | 239 | * @ucode_init: init ucode image |
240 | * @ucode_wowlan: wake on wireless ucode image (optional) | 240 | * @ucode_wowlan: wake on wireless ucode image (optional) |
241 | * @nvm_device_type: indicates OTP or eeprom | 241 | * @nvm_device_type: indicates OTP or eeprom |
242 | * @pm_support: set to true in start_hw if link pm is supported | ||
242 | * @calib_results: list head for init calibration results | 243 | * @calib_results: list head for init calibration results |
243 | */ | 244 | */ |
244 | struct iwl_trans { | 245 | struct iwl_trans { |
@@ -257,6 +258,7 @@ struct iwl_trans { | |||
257 | 258 | ||
258 | /* eeprom related variables */ | 259 | /* eeprom related variables */ |
259 | int nvm_device_type; | 260 | int nvm_device_type; |
261 | bool pm_support; | ||
260 | 262 | ||
261 | /* init calibration results */ | 263 | /* init calibration results */ |
262 | struct list_head calib_results; | 264 | struct list_head calib_results; |