aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorBen Cahill <ben.m.cahill@intel.com>2009-10-09 16:20:20 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-27 16:47:57 -0400
commit4d2ccdb94847248a4075414169108d8f929c153c (patch)
tree9a22fe5ce60ff193d46e641edaa22a21c6592b22 /drivers/net/wireless/iwlwifi
parentf33269b8968d1c64772a9221e2c9c42d07a9b5ae (diff)
iwlwifi: turn off device when not used.
In some cases (e.g. when mac80211 calls iwl_mac_stop() for suspend or user no longer wants device active), device has not been going into low power state via __iwl_down(). apm_ops.reset() does not put device into low power state; instead it resets the device, then puts it into a powered-up state ready to be re-loaded with uCode and re-started. This has needlessly warmed up user's laptops and drained batteries. With current architecture in which mac80211 controls device up/down (including resetting device after firmware errors), there is no need for apm_ops.reset() any more; apm_ops.reset() is basically a combination of apm_ops.stop() and apm_ops.init(). Instead, __iwl_down() now unconditionally places the device into a low-power state via apm_ops.stop(). Device may be re-started via __iwl_up() calling apm_ops.init() as soon as it may be needed (e.g. quickly for firmware errors), but in the meantime, device will stop wasting energy. Note that, even in this low power state, if driver re-enables interrupts, the device retains the ability to sense the hardware RF-KILL switch, and (except for 3945) interrupt the host when it changes. Signed-off-by: Ben Cahill <ben.m.cahill@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c6
2 files changed, 5 insertions, 9 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 8d7bc38fe005..0878b34ee586 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1899,11 +1899,9 @@ static void __iwl_down(struct iwl_priv *priv)
1899 1899
1900 udelay(5); 1900 udelay(5);
1901 1901
1902 /* FIXME: apm_ops.suspend(priv) */ 1902 /* Stop the device, and put it in low power state */
1903 if (exit_pending) 1903 priv->cfg->ops->lib->apm_ops.stop(priv);
1904 priv->cfg->ops->lib->apm_ops.stop(priv); 1904
1905 else
1906 priv->cfg->ops->lib->apm_ops.reset(priv);
1907 exit: 1905 exit:
1908 memset(&priv->card_alive, 0, sizeof(struct iwl_alive_resp)); 1906 memset(&priv->card_alive, 0, sizeof(struct iwl_alive_resp));
1909 1907
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index c347d6631d85..adf4ebe6bb78 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -2576,10 +2576,8 @@ static void __iwl3945_down(struct iwl_priv *priv)
2576 2576
2577 udelay(5); 2577 udelay(5);
2578 2578
2579 if (exit_pending) 2579 /* Stop the device, and put it in low power state */
2580 priv->cfg->ops->lib->apm_ops.stop(priv); 2580 priv->cfg->ops->lib->apm_ops.stop(priv);
2581 else
2582 priv->cfg->ops->lib->apm_ops.reset(priv);
2583 2581
2584 exit: 2582 exit:
2585 memset(&priv->card_alive, 0, sizeof(struct iwl_alive_resp)); 2583 memset(&priv->card_alive, 0, sizeof(struct iwl_alive_resp));