linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kalle.valo@nokia.com>
To: linux-wireless@vger.kernel.org
Subject: [RFC PATCH v4 4/5] mac80211: move dynamic_ps_timeout to hw.conf
Date: Tue, 02 Dec 2008 22:04:19 +0200	[thread overview]
Message-ID: <20081202200419.5507.44562.stgit@tikku> (raw)
In-Reply-To: <20081202200219.5507.83250.stgit@tikku>

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
---

 include/net/mac80211.h     |    5 +++++
 net/mac80211/ieee80211_i.h |    1 -
 net/mac80211/mlme.c        |    4 ++--
 net/mac80211/tx.c          |    4 ++--
 net/mac80211/wext.c        |    8 ++++----
 5 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 89affd8..047b20d 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -546,6 +546,10 @@ enum ieee80211_conf_changed {
  * @power_level: requested transmit power (in dBm)
  * @channel: the channel to tune to
  * @ht: the HT configuration for the device
+ * @dynamic_ps_timeout: Length of the tranmission idle period after the
+ *    power save mode should be enabled. The timeout should be enabled only
+ *    when %IEEE80211_CONF_PS is enabled. If zero, there should be no timeout.
+ *    Unit is millisecond.
  * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame
  *    (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11,
  *    but actually means the number of transmissions not the number of retries
@@ -560,6 +564,7 @@ struct ieee80211_conf {
 
 	u16 listen_interval;
 	bool radio_enabled;
+	int dynamic_ps_timeout;
 
 	u8 long_frame_max_tx_count, short_frame_max_tx_count;
 
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 83b4b08..f03261b 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -690,7 +690,6 @@ struct ieee80211_local {
 	unsigned int wmm_acm; /* bit field of ACM bits (BIT(802.1D tag)) */
 
 	bool powersave;
-	int dynamic_ps_timeout;
 	struct work_struct dynamic_ps_enable_work;
 	struct work_struct dynamic_ps_disable_work;
 	struct timer_list dynamic_ps_timer;
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index ee71b12..add3553 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -747,9 +747,9 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
 	ieee80211_bss_info_change_notify(sdata, bss_info_changed);
 
 	if (local->powersave) {
-		if (local->dynamic_ps_timeout > 0)
+		if (local->hw.conf.dynamic_ps_timeout > 0)
 			mod_timer(&local->dynamic_ps_timer, jiffies +
-				  msecs_to_jiffies(local->dynamic_ps_timeout));
+				  msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout));
 		else {
 			conf->flags |= IEEE80211_CONF_PS;
 			ieee80211_hw_config(local,
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 9444a06..de3283b 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1477,7 +1477,7 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
 	}
 
 	if ((local->hw.flags & IEEE80211_HW_NO_DYNAMIC_PS) &&
-	    local->dynamic_ps_timeout > 0) {
+	    local->hw.conf.dynamic_ps_timeout > 0) {
 		if (local->hw.conf.flags & IEEE80211_CONF_PS) {
 			netif_tx_stop_all_queues(local->mdev);
 			queue_work(local->hw.workqueue,
@@ -1485,7 +1485,7 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
 		}
 
 		mod_timer(&local->dynamic_ps_timer, jiffies +
-			  msecs_to_jiffies(local->dynamic_ps_timeout));
+			  msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout));
 	}
 
 	nh_pos = skb_network_header(skb) - skb->data;
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c
index a666ced..c4319cc 100644
--- a/net/mac80211/wext.c
+++ b/net/mac80211/wext.c
@@ -979,20 +979,20 @@ static int ieee80211_ioctl_siwpower(struct net_device *dev,
 		timeout = wrq->value / 1000;
 
 set:
-	if (ps == local->powersave && timeout == local->dynamic_ps_timeout)
+	if (ps == local->powersave && timeout == conf->dynamic_ps_timeout)
 		return ret;
 
 	local->powersave = ps;
-	local->dynamic_ps_timeout = timeout;
+	conf->dynamic_ps_timeout = timeout;
 
 	if (sdata->vif.type != NL80211_IFTYPE_STATION)
 		return ret;
 
 	if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) {
 		if ((local->hw.flags & IEEE80211_HW_NO_DYNAMIC_PS) &&
-		    local->dynamic_ps_timeout > 0)
+		    conf->dynamic_ps_timeout > 0)
 			mod_timer(&local->dynamic_ps_timer, jiffies +
-				  msecs_to_jiffies(local->dynamic_ps_timeout));
+				  msecs_to_jiffies(conf->dynamic_ps_timeout));
 		else {
 			if (local->powersave)
 				conf->flags |= IEEE80211_CONF_PS;


  parent reply	other threads:[~2008-12-02 20:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-02 20:03 [RFC PATCH v4 0/5] mac80211 dynamic power save Kalle Valo
2008-12-02 20:03 ` [RFC PATCH v4 1/5] mac80211: enable IEEE80211_CONF_PS only when associated Kalle Valo
2008-12-04 17:27   ` Johannes Berg
2008-12-05  5:47     ` Kalle Valo
2008-12-05  9:40       ` Johannes Berg
2008-12-02 20:04 ` [RFC PATCH v4 2/5] mac80211: implement dynamic power save Kalle Valo
2008-12-02 20:04 ` [RFC PATCH v4 3/5] mac80211: add IEEE80211_HW_NO_DYNAMIC_PS flag Kalle Valo
2008-12-02 20:04 ` Kalle Valo [this message]
2008-12-02 20:04 ` [RFC PATCH v4 5/5] mac80211: track master queue status Kalle Valo
2008-12-04 17:34   ` Johannes Berg
2008-12-05  5:51     ` Kalle Valo
2008-12-05  9:41       ` Johannes Berg
2008-12-05  9:57         ` 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=20081202200419.5507.44562.stgit@tikku \
    --to=kalle.valo@nokia.com \
    --cc=linux-wireless@vger.kernel.org \
    /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).