From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from xc.sipsolutions.net ([83.246.72.84]:48539 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752039AbZDPKjk (ORCPT ); Thu, 16 Apr 2009 06:39:40 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1LuP0M-0006EX-8l for linux-wireless@vger.kernel.org; Thu, 16 Apr 2009 12:39:38 +0200 Subject: [RFC 3/3 v2] mac80211: enable PS by default From: Johannes Berg To: linux-wireless@vger.kernel.org In-Reply-To: <20090415171633.723852466@sipsolutions.net> (sfid-20090415_191937_921308_A4403082) References: <20090415171046.336006351@sipsolutions.net> <20090415171633.723852466@sipsolutions.net> (sfid-20090415_191937_921308_A4403082) Content-Type: text/plain Date: Thu, 16 Apr 2009 12:39:06 +0200 Message-Id: <1239878346.9737.17.camel@johannes.local> (sfid-20090416_123943_605782_E8EA05EA) Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: Enable PS by default (depending on Kconfig) -- rely on drivers to control the level using pm_qos. Due to the previous patch we turn off PS when necessary due to latency requirements. This has a Kconfig symbol so people can, if they really want, configure the default in their kernels. We may want to keep it at "default y" only in wireless-testing for a while. Signed-off-by: Johannes Berg --- net/mac80211/Kconfig | 16 ++++++++++++++++ net/mac80211/mlme.c | 3 +++ 2 files changed, 19 insertions(+) --- wireless-testing.orig/net/mac80211/mlme.c 2009-04-16 12:22:35.000000000 +0200 +++ wireless-testing/net/mac80211/mlme.c 2009-04-16 12:34:21.000000000 +0200 @@ -2200,6 +2200,9 @@ void ieee80211_sta_setup_sdata(struct ie IEEE80211_STA_AUTO_CHANNEL_SEL; if (sdata->local->hw.queues >= 4) ifmgd->flags |= IEEE80211_STA_WMM_ENABLED; + + if (sdata->local->hw.flags & IEEE80211_HW_SUPPORTS_PS) + ifmgd->powersave = CONFIG_MAC80211_DEFAULT_PS_VALUE; } /* configuration hooks */ --- wireless-testing.orig/net/mac80211/Kconfig 2009-04-16 12:34:28.000000000 +0200 +++ wireless-testing/net/mac80211/Kconfig 2009-04-16 12:36:52.000000000 +0200 @@ -11,6 +11,22 @@ config MAC80211 This option enables the hardware independent IEEE 802.11 networking stack. +config MAC80211_DEFAULT_PS + bool "enable powersave by default" + depends on MAC80211 + default y + help + This option enables powersave mode by default. + + If this causes your applications to misbehave you should fix your + applications instead -- they need to register their network + latency requirement, see Documentation/power/pm_qos_interface.txt. + +config MAC80211_DEFAULT_PS_VALUE + int + default 1 if MAC80211_DEFAULT_PS + default 0 + menu "Rate control algorithm selection" depends on MAC80211 != n