From: David Gnedt Date: Tue, 7 Jan 2014 12:09:06 +0000 (+0100) Subject: wl1251: disable power saving in monitor mode X-Git-Tag: sz_161~14 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=ddce323b6e323ae45f58369069e072ce4316a97e;hp=78cd2c3777847cac223e421a0acacea134f571a9 wl1251: disable power saving in monitor mode Force power saving off while monitor interface is present. Signed-off-by: David Gnedt Signed-off-by: Pali Rohár Signed-off-by: Pavel Machek Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/wl1251/main.c b/drivers/net/wireless/wl1251/main.c index 3a3f19cb888a..7bcedad7f8e0 100644 --- a/drivers/net/wireless/wl1251/main.c +++ b/drivers/net/wireless/wl1251/main.c @@ -675,6 +675,11 @@ out: mutex_unlock(&wl->mutex); } +static bool wl1251_can_do_pm(struct ieee80211_conf *conf, struct wl1251 *wl) +{ + return (conf->flags & IEEE80211_CONF_PS) && !wl->monitor_present; +} + static int wl1251_op_config(struct ieee80211_hw *hw, u32 changed) { struct wl1251 *wl = hw->priv; @@ -721,7 +726,7 @@ static int wl1251_op_config(struct ieee80211_hw *hw, u32 changed) goto out_sleep; } - if (conf->flags & IEEE80211_CONF_PS && !wl->psm_requested) { + if (wl1251_can_do_pm(conf, wl) && !wl->psm_requested) { wl1251_debug(DEBUG_PSM, "psm enabled"); wl->psm_requested = true; @@ -729,8 +734,7 @@ static int wl1251_op_config(struct ieee80211_hw *hw, u32 changed) wl->dtim_period = conf->ps_dtim_period; ieee80211_queue_delayed_work(wl->hw, &wl->ps_work, 0); - } else if (!(conf->flags & IEEE80211_CONF_PS) && - wl->psm_requested) { + } else if (!wl1251_can_do_pm(conf, wl) && wl->psm_requested) { wl1251_debug(DEBUG_PSM, "psm disabled"); wl->psm_requested = false;