diff mbox

mac80211: While associated, force off channel transmission for action frames

Message ID 1429559654-23126-1-git-send-email-emmanuel.grumbach@intel.com (mailing list archive)
State Accepted
Delegated to: Johannes Berg
Headers show

Commit Message

Emmanuel Grumbach April 20, 2015, 7:54 p.m. UTC
From: Matti Gottlieb <matti.gottlieb@intel.com>

Currently while associated to an AP and sending an action frame to a
different AP on the same channel, the action frame will be sent
like a regular tx frame without going off channel.

When power save is enabled this can cause problems, since the device can
go into power save and miss the response to the action frame that is sent
by the other AP.

By forcing the frame to be transmitted off channel we avoid this issue.

Force the transmitting of the action frame to use off channel in
case of association
- If HW off channel is enabled
- The user did not forbid transmitting frames off channel
- The frame is not designated to the AP that we are associated with

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 net/mac80211/cfg.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Johannes Berg April 24, 2015, 10:28 a.m. UTC | #1
On Mon, 2015-04-20 at 22:54 +0300, Emmanuel Grumbach wrote:
> From: Matti Gottlieb <matti.gottlieb@intel.com>
> 
> Currently while associated to an AP and sending an action frame to a
> different AP on the same channel, the action frame will be sent
> like a regular tx frame without going off channel.
> 
> When power save is enabled this can cause problems, since the device can
> go into power save and miss the response to the action frame that is sent
> by the other AP.
> 
> By forcing the frame to be transmitted off channel we avoid this issue.
> 
> Force the transmitting of the action frame to use off channel in
> case of association
> - If HW off channel is enabled
> - The user did not forbid transmitting frames off channel
> - The frame is not designated to the AP that we are associated with

Makes sense, but I reworded the commit message a bit.

If this problem crops up on non-hw-offchannel devices we should prevent
powersave there for the transition period.

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 265e427..e38da9f 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3336,8 +3336,14 @@  static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
 		break;
 	case NL80211_IFTYPE_STATION:
 	case NL80211_IFTYPE_P2P_CLIENT:
-		if (!sdata->u.mgd.associated)
+		sdata_lock(sdata);
+		if (!sdata->u.mgd.associated ||
+		    (params->offchan && params->wait &&
+		     local->ops->remain_on_channel &&
+		     memcmp(sdata->u.mgd.associated->bssid,
+			    mgmt->bssid, ETH_ALEN)))
 			need_offchan = true;
+		sdata_unlock(sdata);
 		break;
 	case NL80211_IFTYPE_P2P_DEVICE:
 		need_offchan = true;