aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-power.c
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2008-09-02 23:26:50 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-09-08 14:23:19 -0400
commitc90a74bae10dc2a4677d1bd06b6400db229d3e1e (patch)
treeb1cadc8cc67b4768a60fb566ebda091364d2b044 /drivers/net/wireless/iwlwifi/iwl-power.c
parente7b635814b640c6fd9dca1c254dc22fac6fb9a1a (diff)
iwlwifi: allow association on radar channel in power save
This patch disables power save upon association and enables it back after association. This allows to associate to AP on a radar channel if power save is enabled. Radar and passive channels are not allowed for TX (required for association) unless RX is received but PS may close the radio and no RX will be received effectively failing association. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Mohamed Abbas <mohamed.abbas@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.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c
index eb6312d867d1..16f834d0c486 100644
--- a/drivers/net/wireless/iwlwifi/iwl-power.c
+++ b/drivers/net/wireless/iwlwifi/iwl-power.c
@@ -319,7 +319,7 @@ EXPORT_SYMBOL(iwl_power_update_mode);
319 * this will be usefull for rate scale to disable PM during heavy 319 * this will be usefull for rate scale to disable PM during heavy
320 * Tx/Rx activities 320 * Tx/Rx activities
321 */ 321 */
322int iwl_power_disable_management(struct iwl_priv *priv) 322int iwl_power_disable_management(struct iwl_priv *priv, u32 ms)
323{ 323{
324 u16 prev_mode; 324 u16 prev_mode;
325 int ret = 0; 325 int ret = 0;
@@ -332,6 +332,11 @@ int iwl_power_disable_management(struct iwl_priv *priv)
332 ret = iwl_power_update_mode(priv, 0); 332 ret = iwl_power_update_mode(priv, 0);
333 priv->power_data.power_disabled = 1; 333 priv->power_data.power_disabled = 1;
334 priv->power_data.user_power_setting = prev_mode; 334 priv->power_data.user_power_setting = prev_mode;
335 cancel_delayed_work(&priv->set_power_save);
336 if (ms)
337 queue_delayed_work(priv->workqueue, &priv->set_power_save,
338 msecs_to_jiffies(ms));
339
335 340
336 return ret; 341 return ret;
337} 342}
@@ -426,3 +431,35 @@ int iwl_power_temperature_change(struct iwl_priv *priv)
426 return ret; 431 return ret;
427} 432}
428EXPORT_SYMBOL(iwl_power_temperature_change); 433EXPORT_SYMBOL(iwl_power_temperature_change);
434
435static void iwl_bg_set_power_save(struct work_struct *work)
436{
437 struct iwl_priv *priv = container_of(work,
438 struct iwl_priv, set_power_save.work);
439 IWL_DEBUG(IWL_DL_STATE, "update power\n");
440
441 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
442 return;
443
444 mutex_lock(&priv->mutex);
445
446 /* on starting association we disable power managment
447 * until association, if association failed then this
448 * timer will expire and enable PM again.
449 */
450 if (!iwl_is_associated(priv))
451 iwl_power_enable_management(priv);
452
453 mutex_unlock(&priv->mutex);
454}
455void iwl_setup_power_deferred_work(struct iwl_priv *priv)
456{
457 INIT_DELAYED_WORK(&priv->set_power_save, iwl_bg_set_power_save);
458}
459EXPORT_SYMBOL(iwl_setup_power_deferred_work);
460
461void iwl_power_cancel_timeout(struct iwl_priv *priv)
462{
463 cancel_delayed_work(&priv->set_power_save);
464}
465EXPORT_SYMBOL(iwl_power_cancel_timeout);