Return-path: Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:34785 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754021Ab3J3Lq3 (ORCPT ); Wed, 30 Oct 2013 07:46:29 -0400 Date: Wed, 30 Oct 2013 12:46:27 +0100 From: Pavel Machek To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Luciano Coelho , "John W. Linville" , Johannes Berg , "David S. Miller" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, freemangordon@abv.bg, aaro.koskinen@iki.fi, sre@ring0.de, joni.lapilainen@gmail.com, David Gnedt Subject: Re: [PATCH 09/16] wl1251: disable power saving in monitor mode Message-ID: <20131030114627.GC8763@amd.pavel.ucw.cz> (sfid-20131030_124715_866141_F676F494) References: <1382819655-30430-1-git-send-email-pali.rohar@gmail.com> <1382819655-30430-10-git-send-email-pali.rohar@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 In-Reply-To: <1382819655-30430-10-git-send-email-pali.rohar@gmail.com> Sender: linux-wireless-owner@vger.kernel.org List-ID: On Sat 2013-10-26 22:34:08, Pali Roh?r wrote: > From: David Gnedt > > Force power saving off while monitor interface is present. > > Signed-off-by: David Gnedt > --- > drivers/net/wireless/ti/wl1251/main.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/wireless/ti/wl1251/main.c b/drivers/net/wireless/ti/wl1251/main.c > index 727f2ee..62cb374 100644 > --- a/drivers/net/wireless/ti/wl1251/main.c > +++ b/drivers/net/wireless/ti/wl1251/main.c > @@ -617,7 +617,8 @@ static int wl1251_op_config(struct ieee80211_hw *hw, u32 changed) > goto out_sleep; > } > > - if (conf->flags & IEEE80211_CONF_PS && !wl->psm_requested) { > + if (conf->flags & IEEE80211_CONF_PS && !wl->psm_requested && > + !wl->monitor_present) { > wl1251_debug(DEBUG_PSM, "psm enabled"); > > wl->psm_requested = true; > @@ -633,8 +634,8 @@ 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 ((!(conf->flags & IEEE80211_CONF_PS) || wl->monitor_present) > + && wl->psm_requested) { > wl1251_debug(DEBUG_PSM, "psm disabled"); > These boolean expressions make my head spin. Introduce helper function can_do_pm()... return (conf->flags & IEEE80211_CONF_PS) && !wl->monitor_present ? Thanks, Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html