From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 4/4] mac80211: enable PS by default
Date: Thu, 16 Apr 2009 13:17:27 +0200 [thread overview]
Message-ID: <20090416111928.072724791@sipsolutions.net> (raw)
In-Reply-To: 20090416111723.904720021@sipsolutions.net
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 <johannes@sipsolutions.net>
---
net/mac80211/Kconfig | 16 ++++++++++++++++
net/mac80211/mlme.c | 8 ++++++++
2 files changed, 24 insertions(+)
--- wireless-testing.orig/net/mac80211/mlme.c 2009-04-16 13:07:02.000000000 +0200
+++ wireless-testing/net/mac80211/mlme.c 2009-04-16 13:15:16.000000000 +0200
@@ -2181,6 +2181,7 @@ static void ieee80211_restart_sta_timer(
void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata)
{
struct ieee80211_if_managed *ifmgd;
+ u32 hw_flags;
ifmgd = &sdata->u.mgd;
INIT_WORK(&ifmgd->work, ieee80211_sta_work);
@@ -2200,6 +2201,13 @@ void ieee80211_sta_setup_sdata(struct ie
IEEE80211_STA_AUTO_CHANNEL_SEL;
if (sdata->local->hw.queues >= 4)
ifmgd->flags |= IEEE80211_STA_WMM_ENABLED;
+
+ hw_flags = sdata->local->hw.flags;
+
+ if (hw_flags & IEEE80211_HW_SUPPORTS_PS) {
+ ifmgd->powersave = CONFIG_MAC80211_DEFAULT_PS_VALUE;
+ local->hw.conf.dynamic_ps_timeout = 500;
+ }
}
/* configuration hooks */
--- wireless-testing.orig/net/mac80211/Kconfig 2009-04-16 13:06:59.000000000 +0200
+++ wireless-testing/net/mac80211/Kconfig 2009-04-16 13:07:02.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
--
next prev parent reply other threads:[~2009-04-16 11:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-16 11:17 [PATCH 0/4] mac80211 powersave work Johannes Berg
2009-04-16 11:17 ` [PATCH 1/4] mac80211: improve powersave implementation Johannes Berg
2009-04-16 11:17 ` [PATCH 2/4] mac80211: disable powersave if pm_qos asks for low latency Johannes Berg
2009-04-16 11:17 ` [PATCH 3/4] mac80211: implement beacon filtering in software Johannes Berg
2009-04-16 11:17 ` Johannes Berg [this message]
2009-04-16 11:27 ` [PATCH 4/4 v2] mac80211: enable PS by default Johannes Berg
2009-04-20 19:44 ` [PATCH 0/4] mac80211 powersave work John W. Linville
2009-04-20 19:53 ` Johannes Berg
2009-04-20 20:26 ` Davide Pesavento
2009-04-20 20:30 ` Johannes Berg
2009-04-20 21:19 ` Davide Pesavento
2009-04-20 21:28 ` Johannes Berg
2009-04-20 21:55 ` Fabio Rossi
2009-04-20 21:03 ` John W. Linville
2009-04-21 5:24 ` Kalle Valo
2009-04-21 12:51 ` John W. Linville
2009-04-21 13:09 ` Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090416111928.072724791@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).