From patchwork Wed Aug 10 08:01:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wright Feng X-Patchwork-Id: 9274025 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 3C7D26022E for ; Wed, 10 Aug 2016 20:37:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A62926255 for ; Wed, 10 Aug 2016 20:37:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E0192840C; Wed, 10 Aug 2016 20:37:58 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 3A912283E6 for ; Wed, 10 Aug 2016 20:37:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934202AbcHJUhu (ORCPT ); Wed, 10 Aug 2016 16:37:50 -0400 Received: from mail-by2nam03on0099.outbound.protection.outlook.com ([104.47.42.99]:59738 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932836AbcHJUhr convert rfc822-to-8bit (ORCPT ); Wed, 10 Aug 2016 16:37:47 -0400 X-Greylist: delayed 7213 seconds by postgrey-1.27 at vger.kernel.org; Wed, 10 Aug 2016 16:37:46 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cycorp.onmicrosoft.com; s=selector1-cypress-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=dkbaF2mpaSpSG1/F5bNVkGHNOvUurp5jIh1K951smWg=; b=mn0MsQSwRF99kC6e+EVWoBZpK771J2+rPqQ7Xrt7n3MLivbRQ0KF1rglfNGvpAG4It5wopNyJ5ujVeJmWt+++jLa77INtACBMS00ObCjzMz2DIJNcw1vxUqn8U1zA+7XoEVCoLNY6iGAa7QXTkxwrsptDCsasBkhTqJj+a8zpio= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=wefe@cypress.com; Received: from cypress.com (192.19.210.250) by DM5PR06MB2827.namprd06.prod.outlook.com (10.175.108.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15; Wed, 10 Aug 2016 08:00:59 +0000 Date: Wed, 10 Aug 2016 16:01:00 +0800 From: Wright Feng To: , , , , , , , CC: Subject: [PATCH] brcmfmac: shut down AP and set IBSS mode only on primary interface Message-ID: <20160810080100.GA10783@cypress.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [192.19.210.250] X-ClientProxiedBy: BY1PR16CA0011.namprd16.prod.outlook.com (10.162.29.21) To DM5PR06MB2827.namprd06.prod.outlook.com (10.175.108.9) X-MS-Office365-Filtering-Correlation-Id: 04506984-18f8-499d-e3ba-08d3c0f47904 X-Microsoft-Exchange-Diagnostics: 1; DM5PR06MB2827; 2:/pJgjxdgOtNxu2n8ob4f5/+VpW5aLpuBUGcSXnJ11vItn0ysyvKKQHMiM9jpISXX+0A6eye21+OnZj11UAOVQ374fTmaxC78PFoTnAygmHOyR/rdh8L+p0ZjrJY8DeOqX9Q23cOBhNwGLW8xhll4GbD+wG+wjUQUutl3eC4dH4reU/KkLv3TxRzbcdVwpJVN; 3:V5FRgdvyejMucbyp/YW+jJ+gQgy4qfQFqLXOqxyf3SMS9p1kD9CrcJEJFTHUIQoDCgsOWW7O+f+eNdzDcxErhLWvtArH85m28UBr41G90MCMYvtZM5yn85sGISiqT0xd X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM5PR06MB2827; X-Microsoft-Exchange-Diagnostics: 1; DM5PR06MB2827; 25:0IFVv3+RNzcQ9Fd0J0DVNeFxIz8+caAGPM8ysyYF+hus54xIfluufVwMEV5PJgogBtd5RHIQjNARcfZifUDUpKR8gASwgUv/n0/7KeDOh9UnngAvdGadSvtMdVeFDtHecdOay+myn1zP9Aj75ToxabkGpkmxoP9gA1YxpcmTA21dtLmqCdT2iHm1h2E+HZ9YggPOkepiB9Ac1qkObxLEZaeSgChdKz1xrOQBJvFGElhbeozn3XeGU1srd4M7CpantNlojwUD7zzEUUZVBKWDR+zIYeLo19w51WzJ6ILQQUYiNYMgl2m6OsfMpvv+8Sd4yKKdN8Fit5FTJlkxUaPnQG9Uhd2RS2xCu17QSufXbeEwYKyM7vAJpQyRI/LaAEutwwxfs6435tq2PJG8wldUEgTcVvgsBBC+G/ytDN1Vv1WAJ9KjoaMBNKLECi1S10IIOnIzOVkcZHIrW2Zar+HptwTkQA3khATU30arYg+rsI+cv7DyD8pygWGq95+prgLfJ+XfNGDQ3ydaTa4RJW98tdqjdH2qzMrjV7bKhbfTu0bM80QbRAnVs4HDy/O1EqxsNgvZTGey2T0s9wbPxwrU0D2AjJI1numOid2Ta633Xr+UCiuh1oCBsa17Jsj/2W0b/ExRS59dnEzD4jtJEMb9fF9U1ABMu0hXLFGkHxtqocH1LGIRYwwMrU2kMyAn0WnCrmDhmIm0YTg5+8KaVu78khzNiSrczbtd2Kb3v33tStg= X-Microsoft-Exchange-Diagnostics: 1; DM5PR06MB2827; 31:o1QI8Gs/dDQhvVmTAL2o0HGLAz3m/SXXQggqe7cTAGhsgSCRozALOFd3papqzbADL0iVkkpEZ/zNX/H6cdmInmMO+1hae/ghpuWY4uYrnJFtgLQW9CveR5XwFZU3PEFUsbdJ4z9zGVR0HMa96oxJuiVVx3+gkmkoVVo7SrVwYUirjv9Rfxkjc/FgS0m8Uy3msi9OWeGmxUKP0+4Yz7Rzli/s0n6bDE/d1WOZV2issjc=; 20:Kxdx3eq1LIRcckuYSVYpeR2nJmV/Uf08H2+TPFefbxUuTAiJBEkD13t3aIqCjC4ApK4by+gE8wYubqSKEvcLkLPD47TG+Djoo28XVIXMqzCH1o7G+z2/m+boclpCeLVMGohlECBZdqBcH0DQ09Q/1lfagQpu/SF50zar7d8r5hzO7MtRmhilx9sR5vKuPdxrTLhjc4IO8mPjCT/wSTZNpF/+/1m5OCerNLiS3CZNkG8xz0x1pVA8udZGTSYTRwYnVtDFA9Tr3i++SlgQ3lFfkRu9Fcqbxehu35+G3bUsBf7lqZTNb7A6wwobb61Oyykl8X36slp4Jg2MdHslsPMZ/OAK10/U/OMqF+NytioU4nEn7t9pq0ucanbHxsA7YOfCjq78g0Ks5IB1JlLbFjeWSx0F6oxyG94N5NhiMSXznTubZOjkc9MpGb+AnxxKE5zaCVGLEKIgMqpn+If/qZ0AS6Mqg6eE2sC2zgidjUZXauM9ZUFdjVA+ocY3Uo73MwnZ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(258095267146985); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:DM5PR06MB2827; BCL:0; PCL:0; RULEID:; SRVR:DM5PR06MB2827; X-Microsoft-Exchange-Diagnostics: 1; DM5PR06MB2827; 4:OCD2EBQapPCV3WIrGI605omcBtHW7bZH/Kjj6BiP7NWkU9hYK4DewGyemgyNNzJJ0uDzx0549HYvKxUp0KWah/wsC1kTH7oFVOh9exLcV2L6wQSZHQUYcf4JbT6aBHZIKinlmMepRLx6M/k/X01w0DNeRHYPRGD8lVUQCybt1OeErjdSF/uOwDOZgC6gKIaMIlNmkT91TpTazaxGNuOo9aFm+8HddwpS5rNQ9GuAToJyJvWeSKQWxHT1FOtBsMrrZu+k0kgLpNpobzDE/+bC0st2pN4/qmeGoSaA21Z/tth/bNcYM8iJARnQ4a7IxyXhrXAxOfbOWCIEX4NrfnoFPxEABW3NMd8bJnfaF5leUzLdcEYRk55Ut9nXkjvdjHQpUiqKx/nEYToc6Okd8OY6u7E3OoZkOqIhYObI6Fj6Fo60+aXLmw8g0wRkxs+UR3UL X-Forefront-PRVS: 0030839EEE X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(189002)(106356001)(4326007)(77096005)(7846002)(2906002)(7736002)(305945005)(2201001)(50986999)(19580395003)(69596002)(6116002)(54356999)(23726003)(4001430100002)(229853001)(19580405001)(4001350100001)(97736004)(3846002)(5001770100001)(83506001)(1076002)(189998001)(107886002)(97756001)(5890100001)(47776003)(42186005)(36756003)(105586002)(50466002)(81166006)(46406003)(68736007)(8746002)(81156014)(8676002)(92566002)(21086003)(33656002)(66066001)(586003)(101416001)(18370500001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR06MB2827; H:cypress.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cypress.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR06MB2827; 23:y1qv4HNj4hVQOUZfmCyyzOcbjMwYCtr1FaejO2ZVk?= =?us-ascii?Q?QgGltU4O4WkP+pNGJ6IMp5smqs077CmcH2S8L0L1/iXl4OYFpQj8GJEtpyXD?= =?us-ascii?Q?yQZd4jed0/aKfoBJYAlxyDxGQ/R4lCj+V4HzO6qveDjT68bSheIX+QJ/dJQk?= =?us-ascii?Q?WbWrc6kcIflHW9bOORdjSZD2FPk2SvdCGJmhML3BIF2s+A4IhPvutoMyKWO4?= =?us-ascii?Q?R48IkCQ0TAjGp+ayR5P32bpSqVu7jU/VX/D6rl0scrN76VfCX+YuqW/g/1BU?= =?us-ascii?Q?gfsRXXfFCNvx6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=?us-ascii?Q?O7ErKham9xCyjbJhvxunV2o1Y+vr9DrLfL0rc4GRl5w4g9nimhilPdG4TPBZ?= =?us-ascii?Q?+2Tds4n1/7+qNJWTEMEZFDsOFZIOgAAIZXUKnGV?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR06MB2827; 6:NMolCddyI6TtVZ15aeJ27BdjUGlE0ilAxeNuw14Uwges9lm3Jsun1HnYCY4K3JFLEA0/e3SmUiC4thDI42IfkBWD1+MRHQM1IRXmFHxKRVVIkLmg2bT6sjkN5WwRAn9HeqaR87dCwv09Xe6k/hm34QD2EhV4WCb61M2Z+tt3F/vPCFIwM1KdiPHdwJILmiJ9/e0MgIYmuDwi+5SG1xUza0pH35N2s75IkkRAKCFlApVAE378RjdPaUkzyP4Hst7uPAt82NHHNYFzTTskPhqk/Uc7TSLP0eYq0mln+CTAIIHj2db26RLcaTDAA3GuJ/ynPlICztpJG/0ft+zpOdR9hA==; 5:3wWVxmE8b9D+Y1R5WXxGETq478BbBXjqoR547spPTTvNevDzcoIuJQQhAj4w62/tADS7mAKD7Ek8YWPkDHHh09ys3N3M+8/dze2ew8fqD81QkiXYsgVYB0kbKLFkS3JG7/SjTpNXmfnTti8e+xPdfw==; 24:BoBl+tiRg3vtpOS4pnVeAXdLbD5EiFFTa1JuwiTLVtt9Z1b/p13u808aS0CjyrnQqCtuDy8aADJdgIVsCPmkdmbQc0zUEHipLndjBTa/59k=; 7:XD1Pem5QkBsNARiwBuKwjmtQ6eZh12K0N1Iycmiyeb05pedVeBV77JHDCZc2Ke+zYF+XDF5OpCcn222mtPNEybcDtiMVWLjMveMooyZmehUcjjTlunDvahAVQ1LKfvublNTyc9iNsOnDgSidwX8h60svVruoVgYgITsnJTmVYDUJ/1wHlyUHyxDEaZJhe5oFBI13pnwvKFeW5mp+9S7KwOo0HHSX5556FAmyuQS4fXZbEqaDcCAzNVKoaJY6pXBi SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2016 08:00:59.2041 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR06MB2827 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 --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 1.9.1 This message and any attachments may contain Cypress (or its subsidiaries) confidential information. If it has been received in error, please advise the sender and immediately delete this message. -- 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 --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);