From patchwork Mon Apr 20 19:54:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emmanuel Grumbach X-Patchwork-Id: 6244101 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 662829F32B for ; Mon, 20 Apr 2015 19:54:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A0B0F20429 for ; Mon, 20 Apr 2015 19:54:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B16D920220 for ; Mon, 20 Apr 2015 19:54:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753880AbbDTTyU (ORCPT ); Mon, 20 Apr 2015 15:54:20 -0400 Received: from mga01.intel.com ([192.55.52.88]:57066 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753825AbbDTTyU (ORCPT ); Mon, 20 Apr 2015 15:54:20 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 20 Apr 2015 12:54:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,610,1422950400"; d="scan'208";a="558986336" Received: from ehemo-mobl3.ger.corp.intel.com (HELO egrumbacBox.ger.corp.intel.com) ([10.255.204.144]) by orsmga003.jf.intel.com with ESMTP; 20 Apr 2015 12:54:17 -0700 From: Emmanuel Grumbach To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Matti Gottlieb , Emmanuel Grumbach Subject: [PATCH] mac80211: While associated, force off channel transmission for action frames Date: Mon, 20 Apr 2015 22:54:14 +0300 Message-Id: <1429559654-23126-1-git-send-email-emmanuel.grumbach@intel.com> X-Mailer: git-send-email 2.1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Matti Gottlieb 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 Signed-off-by: Emmanuel Grumbach --- net/mac80211/cfg.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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;