diff options
author | Grumbach, Emmanuel <emmanuel.grumbach@intel.com> | 2008-09-02 23:26:53 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-11 15:53:31 -0400 |
commit | 04816448d8b77551834c9ea01e407ef5f0042f0f (patch) | |
tree | e3c1e019045e0d275f67f79b32ca3fae5e74c2ae /drivers/net/wireless/iwlwifi/iwl-power.c | |
parent | 12837be1c127e6fba2e3f916a18fc202a9889af2 (diff) |
iwlwifi: use the results from disconnected antenna algorithm
This patch makes usage of the results from disconnected antenna alg to
know how many antennas are connected.
It also synchronizes between the chain noise alg and the W/A that
disables power management during association. All the antennas must be
enables during the chain noise algorithm. Hence, power management is
restored only after the completion of the algorithm.
In the future, we will need to update the AP that we don't support MIMO
if there is only one antenna connected. We also need to update the rate
scaling algorithm.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-power.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-power.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c index 16f834d0c486..bd6f600027d1 100644 --- a/drivers/net/wireless/iwlwifi/iwl-power.c +++ b/drivers/net/wireless/iwlwifi/iwl-power.c | |||
@@ -252,12 +252,21 @@ static int iwl_update_power_command(struct iwl_priv *priv, | |||
252 | /* | 252 | /* |
253 | * calucaute the final power mode index | 253 | * calucaute the final power mode index |
254 | */ | 254 | */ |
255 | int iwl_power_update_mode(struct iwl_priv *priv, u8 refresh) | 255 | int iwl_power_update_mode(struct iwl_priv *priv, bool force) |
256 | { | 256 | { |
257 | struct iwl_power_mgr *setting = &(priv->power_data); | 257 | struct iwl_power_mgr *setting = &(priv->power_data); |
258 | int ret = 0; | 258 | int ret = 0; |
259 | u16 uninitialized_var(final_mode); | 259 | u16 uninitialized_var(final_mode); |
260 | 260 | ||
261 | /* Don't update the RX chain when chain noise calibration is running */ | ||
262 | if (priv->chain_noise_data.state != IWL_CHAIN_NOISE_DONE && | ||
263 | priv->chain_noise_data.state != IWL_CHAIN_NOISE_ALIVE) { | ||
264 | IWL_DEBUG_POWER("Cannot update the power, chain noise " | ||
265 | "calibration running: %d\n", | ||
266 | priv->chain_noise_data.state); | ||
267 | return -EAGAIN; | ||
268 | } | ||
269 | |||
261 | /* If on battery, set to 3, | 270 | /* If on battery, set to 3, |
262 | * if plugged into AC power, set to CAM ("continuously aware mode"), | 271 | * if plugged into AC power, set to CAM ("continuously aware mode"), |
263 | * else user level */ | 272 | * else user level */ |
@@ -285,7 +294,7 @@ int iwl_power_update_mode(struct iwl_priv *priv, u8 refresh) | |||
285 | final_mode = IWL_POWER_MODE_CAM; | 294 | final_mode = IWL_POWER_MODE_CAM; |
286 | 295 | ||
287 | if (!iwl_is_rfkill(priv) && !setting->power_disabled && | 296 | if (!iwl_is_rfkill(priv) && !setting->power_disabled && |
288 | ((setting->power_mode != final_mode) || refresh)) { | 297 | ((setting->power_mode != final_mode) || force)) { |
289 | struct iwl_powertable_cmd cmd; | 298 | struct iwl_powertable_cmd cmd; |
290 | 299 | ||
291 | if (final_mode != IWL_POWER_MODE_CAM) | 300 | if (final_mode != IWL_POWER_MODE_CAM) |
@@ -359,35 +368,26 @@ EXPORT_SYMBOL(iwl_power_enable_management); | |||
359 | /* set user_power_setting */ | 368 | /* set user_power_setting */ |
360 | int iwl_power_set_user_mode(struct iwl_priv *priv, u16 mode) | 369 | int iwl_power_set_user_mode(struct iwl_priv *priv, u16 mode) |
361 | { | 370 | { |
362 | int ret = 0; | ||
363 | |||
364 | if (mode > IWL_POWER_LIMIT) | 371 | if (mode > IWL_POWER_LIMIT) |
365 | return -EINVAL; | 372 | return -EINVAL; |
366 | 373 | ||
367 | priv->power_data.user_power_setting = mode; | 374 | priv->power_data.user_power_setting = mode; |
368 | 375 | ||
369 | ret = iwl_power_update_mode(priv, 0); | 376 | return iwl_power_update_mode(priv, 0); |
370 | |||
371 | return ret; | ||
372 | } | 377 | } |
373 | EXPORT_SYMBOL(iwl_power_set_user_mode); | 378 | EXPORT_SYMBOL(iwl_power_set_user_mode); |
374 | 379 | ||
375 | |||
376 | /* set system_power_setting. This should be set by over all | 380 | /* set system_power_setting. This should be set by over all |
377 | * PM application. | 381 | * PM application. |
378 | */ | 382 | */ |
379 | int iwl_power_set_system_mode(struct iwl_priv *priv, u16 mode) | 383 | int iwl_power_set_system_mode(struct iwl_priv *priv, u16 mode) |
380 | { | 384 | { |
381 | int ret = 0; | ||
382 | |||
383 | if (mode > IWL_POWER_LIMIT) | 385 | if (mode > IWL_POWER_LIMIT) |
384 | return -EINVAL; | 386 | return -EINVAL; |
385 | 387 | ||
386 | priv->power_data.system_power_setting = mode; | 388 | priv->power_data.system_power_setting = mode; |
387 | 389 | ||
388 | ret = iwl_power_update_mode(priv, 0); | 390 | return iwl_power_update_mode(priv, 0); |
389 | |||
390 | return ret; | ||
391 | } | 391 | } |
392 | EXPORT_SYMBOL(iwl_power_set_system_mode); | 392 | EXPORT_SYMBOL(iwl_power_set_system_mode); |
393 | 393 | ||