aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti/wl1251/main.c
diff options
context:
space:
mode:
authorDavid Gnedt <david.gnedt@davizone.at>2014-01-07 13:09:06 +0100
committerJohn W. Linville <linville@tuxdriver.com>2014-01-09 10:56:07 -0500
commitdd4a560f0a093e04d4f9a0cec31fe5e0cf42fa9a (patch)
tree949b52dbb21eb57253eb16ce6b273769339c0b06 /drivers/net/wireless/ti/wl1251/main.c
parentwl1251: implement multicast address filtering (fwd) (diff)
downloadlinux-dev-dd4a560f0a093e04d4f9a0cec31fe5e0cf42fa9a.tar.xz
linux-dev-dd4a560f0a093e04d4f9a0cec31fe5e0cf42fa9a.zip
wl1251: disable power saving in monitor mode
Force power saving off while monitor interface is present. Signed-off-by: David Gnedt <david.gnedt@davizone.at> Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to '')
-rw-r--r--drivers/net/wireless/ti/wl1251/main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/wireless/ti/wl1251/main.c b/drivers/net/wireless/ti/wl1251/main.c
index cda38813596e..c77c45604127 100644
--- a/drivers/net/wireless/ti/wl1251/main.c
+++ b/drivers/net/wireless/ti/wl1251/main.c
@@ -569,6 +569,11 @@ static int wl1251_build_qos_null_data(struct wl1251 *wl)
sizeof(template));
}
+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;
@@ -616,7 +621,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;
@@ -632,8 +637,7 @@ static int wl1251_op_config(struct ieee80211_hw *hw, u32 changed)
ret = wl1251_ps_set_mode(wl, STATION_POWER_SAVE_MODE);
if (ret < 0)
goto out_sleep;
- } 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;