From patchwork Mon Mar 30 13:08:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emmanuel Grumbach X-Patchwork-Id: 6120711 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 015D7BF4A6 for ; Mon, 30 Mar 2015 13:08:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1E80B202FE for ; Mon, 30 Mar 2015 13:08:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0F1E42026D for ; Mon, 30 Mar 2015 13:08:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753081AbbC3NIj (ORCPT ); Mon, 30 Mar 2015 09:08:39 -0400 Received: from mga14.intel.com ([192.55.52.115]:36331 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752701AbbC3NIi (ORCPT ); Mon, 30 Mar 2015 09:08:38 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 30 Mar 2015 06:08:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,493,1422950400"; d="scan'208";a="687641606" Received: from egrumbacbox.jer.intel.com ([10.12.118.125]) by fmsmga001.fm.intel.com with ESMTP; 30 Mar 2015 06:08:30 -0700 From: Emmanuel Grumbach To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Avraham Stern , Arik Nemtsov , Ilan Peer , Emmanuel Grumbach Subject: [PATCH] cfg80211: Allow GO concurrent relaxation after BSS disconnetion Date: Mon, 30 Mar 2015 16:08:25 +0300 Message-Id: <1427720905-30872-1-git-send-email-emmanuel.grumbach@intel.com> X-Mailer: git-send-email 1.9.1 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: Avraham Stern If P2P GO was allowed on a channel because of the GO concurrent relaxation and additional station interface associated to an AP on the same channel or the same UNII band, and the station interface disconnected from the AP, allow the P2P GO to stay on that channel unless the channel is marked as indoor only and the device is not operating in an indoor environment. Signed-off-by: Avraham Stern Signed-off-by: Arik Nemtsov Signed-off-by: Ilan Peer Signed-off-by: Emmanuel Grumbach --- net/wireless/chan.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/net/wireless/chan.c b/net/wireless/chan.c index 7aaf741..fc3ec42 100644 --- a/net/wireless/chan.c +++ b/net/wireless/chan.c @@ -709,7 +709,7 @@ EXPORT_SYMBOL(cfg80211_chandef_usable); static bool cfg80211_go_permissive_chan(struct cfg80211_registered_device *rdev, struct ieee80211_channel *chan) { - struct wireless_dev *wdev_iter; + struct wireless_dev *wdev; struct wiphy *wiphy = wiphy_idx_to_wiphy(rdev->wiphy_idx); ASSERT_RTNL(); @@ -732,18 +732,27 @@ static bool cfg80211_go_permissive_chan(struct cfg80211_registered_device *rdev, * and thus fail the GO instantiation, consider only the interfaces of * the current registered device. */ - list_for_each_entry(wdev_iter, &rdev->wdev_list, list) { + list_for_each_entry(wdev, &rdev->wdev_list, list) { struct ieee80211_channel *other_chan = NULL; int r1, r2; - if (wdev_iter->iftype != NL80211_IFTYPE_STATION || - !netif_running(wdev_iter->netdev)) - continue; - - wdev_lock(wdev_iter); - if (wdev_iter->current_bss) - other_chan = wdev_iter->current_bss->pub.channel; - wdev_unlock(wdev_iter); + wdev_lock(wdev); + if (wdev->iftype == NL80211_IFTYPE_STATION && + netif_running(wdev->netdev) && wdev->current_bss) + other_chan = wdev->current_bss->pub.channel; + + /* + * If a GO already operates on the same GO_CONCURRENT channel, + * this one (maybe the same one) can beacon as well. We allow + * the operation even if the station we relied on with + * GO_CONCURRENT is disconnected now. But then we must make sure + * we're not outdoor on an indoor-only channel. + */ + if (wdev->iftype == NL80211_IFTYPE_P2P_GO && wdev->netdev && + netif_running(wdev->netdev) && wdev->beacon_interval && + !(chan->flags & IEEE80211_CHAN_INDOOR_ONLY)) + other_chan = wdev->chandef.chan; + wdev_unlock(wdev); if (!other_chan) continue;