From patchwork Thu Aug 11 05:44:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wright Feng X-Patchwork-Id: 9274509 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 26D9160780 for ; Thu, 11 Aug 2016 06:09:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D8A9284A8 for ; Thu, 11 Aug 2016 06:09:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 019CE284EE; Thu, 11 Aug 2016 06:09:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 530A1284A8 for ; Thu, 11 Aug 2016 06:09:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751980AbcHKGI7 (ORCPT ); Thu, 11 Aug 2016 02:08:59 -0400 Received: from [157.95.53.9] ([157.95.53.9]:56086 "HELO twsta8-Latitude-E6420" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with SMTP id S1750708AbcHKGI6 (ORCPT ); Thu, 11 Aug 2016 02:08:58 -0400 X-Greylist: delayed 1405 seconds by postgrey-1.27 at vger.kernel.org; Thu, 11 Aug 2016 02:08:47 EDT Received: by twsta8-Latitude-E6420 (Postfix, from userid 1000) id BA01140E4EB; Thu, 11 Aug 2016 13:45:06 +0800 (CST) From: Wright Feng To: brcm80211-dev-list.pdl@broadcom.com, arend.vanspriel@broadcom.com, kvalo@codeaurora.org, franky.lin@broadcom.com, hante.meuleman@broadcom.com, pieterpg@broadcom.com, linux-wireless@vger.kernel.org, chln@cypress.com Cc: Wright Feng Subject: [PATCH v2] brcmfmac: shut down AP and set IBSS mode only on primary interface Date: Thu, 11 Aug 2016 13:44:20 +0800 Message-Id: <1470894260-18128-1-git-send-email-wright.feng@cypress.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-Virus-Scanned: ClamAV using ClamSMTP When stopping hostap on virtual interface, driver will set INFRA and AP mode that may affect the functionality on primary interface. For example, if we create and stop hostapd on virtual interface then association cannot work on primary interface because INFRA mode has been set to IBSS. Hence we shut down AP and set IBSS mode only on primary interface. Signed-off-by: Wright Feng --- V2:Remove the footnote from the mail. --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 2628d5e..0687ab9 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -4716,6 +4716,8 @@ exit: static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev) { + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); + struct net_device *primary_ndev = cfg_to_ndev(cfg); struct brcmf_if *ifp = netdev_priv(ndev); s32 err; struct brcmf_fil_bss_enable_le bss_enable; @@ -4723,7 +4725,8 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev) brcmf_dbg(TRACE, "Enter\n"); - if (ifp->vif->wdev.iftype == NL80211_IFTYPE_AP) { + if ((ifp->vif->wdev.iftype == NL80211_IFTYPE_AP) && + (ndev == primary_ndev)) { /* Due to most likely deauths outstanding we sleep */ /* first to make sure they get processed by fw. */ msleep(400);