All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ronald Wahl <ronald.wahl@raritan.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
	RT2x00 Users <users@rt2x00.serialmonkey.com>
Subject: [PATCH] mac80211: when receiving DTIM disable power-save mode only if it was enabled
Date: Mon, 19 Mar 2012 14:37:20 +0100	[thread overview]
Message-ID: <4F673690.40302@raritan.com> (raw)

When receiving DTIM we currently disable power save mode in the
hardware unconditionally, i.e. also when the hardware was not sleeping.
This causes trouble with at least one wireless chipset (Ralink RT3572).
When the hardware is not sleeping and we send a wakeup command (e.g.
this happens after a scan) then a significant decrease of the link
quality or a disconnect may occur.
Disabling power save mode only when it was enabled prevents this issue.

Signed-off-by: Ronald Wahl <ronald.wahl@raritan.com>
---
Index: linux/net/mac80211/mlme.c
===================================================================
--- linux/net/mac80211/mlme.c	(revision 213137)
+++ linux/net/mac80211/mlme.c	(working copy)
@@ -1922,9 +1922,11 @@
 	if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) {
 		if (directed_tim) {
 			if (local->hw.conf.dynamic_ps_timeout > 0) {
-				local->hw.conf.flags &= ~IEEE80211_CONF_PS;
-				ieee80211_hw_config(local,
-						    IEEE80211_CONF_CHANGE_PS);
+				if (local->hw.conf.flags & IEEE80211_CONF_PS) {
+					local->hw.conf.flags &= ~IEEE80211_CONF_PS;
+					ieee80211_hw_config(local,
+							    IEEE80211_CONF_CHANGE_PS);
+				}
 				ieee80211_send_nullfunc(local, sdata, 0);
 			} else {
 				local->pspolling = true;

             reply	other threads:[~2012-03-19 13:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-19 13:37 Ronald Wahl [this message]
2012-03-19 20:20 ` [PATCH] mac80211: when receiving DTIM disable power-save mode only if it was enabled Gertjan van Wingerde

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=4F673690.40302@raritan.com \
    --to=ronald.wahl@raritan.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=users@rt2x00.serialmonkey.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.