X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=drivers%2Fnet%2Fwireless%2Fwl1251%2Fmain.c;h=7bcedad7f8e0ec6a38d3d91f7101255c1b0c95dd;hp=3a3f19cb888ac3a8e9f1c54764ea49cb565fa893;hb=ddce323b6e323ae45f58369069e072ce4316a97e;hpb=78cd2c3777847cac223e421a0acacea134f571a9 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;