From patchwork Mon Sep 18 12:29:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 9956609 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 4B96F601E9 for ; Mon, 18 Sep 2017 12:30:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F10D28B18 for ; Mon, 18 Sep 2017 12:30:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23AB728C8D; Mon, 18 Sep 2017 12:30:57 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 1489B28C99 for ; Mon, 18 Sep 2017 12:30:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932138AbdIRMaJ (ORCPT ); Mon, 18 Sep 2017 08:30:09 -0400 Received: from mail-cys01nam02on0084.outbound.protection.outlook.com ([104.47.37.84]:11360 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753196AbdIRMaF (ORCPT ); Mon, 18 Sep 2017 08:30:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=FoOMElQNSCnyYxlTM0SGYbJlQ4Nb2zgIPztLD+7aTds=; b=vG+2Z7T+pI8nXJWf0kiFVA9vuCeuwLgEIeKOe0DFxmjRzjkYUucb896ciIgpDB9kdGp2K42+YNyhwKnR5UrP8dYoXvVsl5F49dvpKXyhI6bQonrDAcypRPUPbXcxue1pJdSyzmGvyb9wYfujGyJl2Ajcct0i5VYv0FzMVHJ5cMA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; Received: from bars.quantenna.com (195.182.157.78) by CY1PR05MB1931.namprd05.prod.outlook.com (10.162.216.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.5; Mon, 18 Sep 2017 12:30:03 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org Cc: Igor Mitsyanko , Avinash Patil , Sergey Matyukevich Subject: [PATCH v2 2/2] qtnfmac: cancel scans on wireless interface changes Date: Mon, 18 Sep 2017 15:29:50 +0300 Message-Id: <20170918122950.32612-3-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170918122950.32612-1-sergey.matyukevich.os@quantenna.com> References: <20170918122950.32612-1-sergey.matyukevich.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [195.182.157.78] X-ClientProxiedBy: AM5PR0502CA0013.eurprd05.prod.outlook.com (10.175.37.151) To CY1PR05MB1931.namprd05.prod.outlook.com (10.162.216.13) X-MS-Office365-Filtering-Correlation-Id: 3f23a649-0594-4b5f-5cd5-08d4fe90fd48 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY1PR05MB1931; X-Microsoft-Exchange-Diagnostics: 1; CY1PR05MB1931;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INPFV76LcY8PXpuax3//P6mQrwVLFhUQd88hTPbtOd0OIGo4gLUMMtvXzRhCrWDoNtkscBvSoNTh7Kw5NvHxhQzCw2lJ+o0eSy5uNj5OT9cHps0ipjPCmMRWQRUxMZbE79cJMCoM4edOWJxL0OLrxtW9rJqXYB/52XmR2AhuXvwhLYjiVLGZJyD8CBEkR4o8VCS1zmzBfE7kyPzwVHeGNJzY5TXnt3a1SMhvM2PJ96g5JDiZQael5We4KPUIGAtmImbl9sXJh1pO9pSW0tLVIV9Mo4vth3kqOyRiCtF8ztYjd729iIYmEFFha+j+X9KqEcRsbGqmoNqB0kZmeXo2J3zF5ELVpDpxB3O2aAA1Q0zq95rVisIF1wBZp; 4:UUNTYY9DkyiyOB9NurEewuUvg4GQ1ZiLL0LYPC+PBeY327E6CclahnO4XBSQt0nGE2EOvWLIaKpCTLEMSlni0cTJ2gX8DVPbPpDvSd3lmbxuBjcoxn1JKuthz3kHJDkFp1HiLx52nDEBUlO7cc6cTflffpyUxlVKw9yHYOamrCvKcErtU22JVy8yw4jlPbdcq9Djd+enBnOkrf2yHLgcFm+Jh7EXLb741QqyB8QQ1uKk8DNuiX616CS1XgOPMcOC X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6041248)(20161123560025)(20161123564025)(20161123555025)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR05MB1931; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR05MB1931; X-Forefront-PRVS: 04347F8039 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(39830400002)(346002)(199003)(189002)(47776003)(66066001)(36756003)(50226002)(478600001)(69596002)(6116002)(6916009)(54906002)(97736004)(16586007)(3846002)(2950100002)(2906002)(50466002)(305945005)(4326008)(103116003)(48376002)(6666003)(7736002)(1076002)(5660300001)(53936002)(5003940100001)(6486002)(81166006)(81156014)(8936002)(86362001)(107886003)(110136004)(25786009)(76176999)(50986999)(106356001)(2351001)(8676002)(33646002)(101416001)(16526017)(53416004)(316002)(68736007)(105586002)(189998001)(2361001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR05MB1931; H:bars.quantenna.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR05MB1931; 23:dkC/k+qu+Kl6XiXgn5pPv03SijQuY6z796n4zCUoh?= =?us-ascii?Q?WsoEx1TlGzvyOWj1CUIcOKUPUX+9WVvb2lUFeChYHPys/p7MRkjPdBnl8T0I?= =?us-ascii?Q?XrYO8jsNtbDDZsz583ViliI8nCvcZo2W+9p863zk1LKX4UIkSHd2rGeyKpCj?= =?us-ascii?Q?ZLMMdx6RFKtIA4G3aCePSTxzu4iXYHXNNdo9j2kvhIk12ZLKVNxJT7/iNf6q?= =?us-ascii?Q?t0EyMY8u4+cbZT/XQm3/H0GYyu0x4J3jkRSBAYCA39jIZdwErvyAPFwXB5Qm?= =?us-ascii?Q?16fwX6M81YkJoUk6G6fybpqo0xBuJvp1sY72zjQGhty5Vi68AA9EBo/SEEbJ?= =?us-ascii?Q?9H3A3HGMzHNzGOkuFeXBEUx0SaCkjkqMKMD8SBq3QssPwylCU0szPcFqM+Yc?= =?us-ascii?Q?kUJgOAKf97IX98gsoJSutHzqO0/Jq3apX62e4M2wXH/2vXcKj4RYbsOfuMmP?= =?us-ascii?Q?ran4nWu3ajZYCYwTuGzUPzZitCKdoa023ifbxSCrj6gceFm/SbZ6pi3b9JSK?= =?us-ascii?Q?4wSbNRCnV1WcnYPHu+lhTPgUq8MQg4nscnq/ItWQ9dKNqp555MPQxigJIGmm?= =?us-ascii?Q?FbrLCJR5uK+5IUrxNsO+boKT4NFnh1jEAdcRSBSYwMuH1pUDNvfjcn5x9Div?= =?us-ascii?Q?8J9QALWfQ8FNapNV66lxcqeAHMh9HHKj50MiEJYXmMlDl3OTmLRmrFndXI/n?= =?us-ascii?Q?oAFaaTZ8bfcX1xpCLWIDexQZx7aK/uu22TuK0rtwZNU915m9B3kjwyyHaGvA?= =?us-ascii?Q?DONMwRhbYR+I45Ro1y1x9fSbPyn7lG0vFLWu43I7AO5oChY9tJEep8KgacDS?= =?us-ascii?Q?toljVz8KQyHKh0qg/KW2leTQnW2Ai3dWAk8xPydMpAMi1RbmLuDzG/M7GQo0?= =?us-ascii?Q?2KyZzOATc3EFpZv1fTYkIhXfF8qroKH7G2G3+RRG9lnagY/T5//hTBzDASuB?= =?us-ascii?Q?w+Fx9EQuM7AgAHe7z+/EjYhxfgGg7GZjBr2DOb/uaVSOrPtZT0H3a9y8qI2R?= =?us-ascii?Q?Y7djx6LQnTiDAaASc3elTsOefkE3sKZKu7ib7+5lEAitfQKUnjCu0RLCyR62?= =?us-ascii?Q?GfCzpRntdkg6OKeQwtDIF2JBU2Ntm3vJHKiP20ODumjkoJvfTKHfiVQClh6H?= =?us-ascii?Q?NA20OENG8MZBgFdHsQdomWbmVrLcfETD3T7NoGuQo9twEKl5h5t8Kve4JyDW?= =?us-ascii?Q?89Ossw+gXnH2GDq23he+4xGbWBoBTN3JGrurINNAOyUjvdESC23sKtrZg=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR05MB1931; 6:79XQduTSuEmEZJsR5tztdqHmzwaEZ09sE9oEBH/0zNcAYpZFs/NGdtdJmvv8f83x1gMrAxmcZA1kxcPYe46FKz9ffA98aMg8E+tZT6MKhRcxdfKeayHXjeqZ7Vj1an7+Ggd6gkTdV0mP0FaGzTchfoe/89sJ9eQTeEXGJyAHV1bIeV1OgvL+29TxoK79xuPFuYt5G0+0Q/HLxwqzM8plL70OIi4uXtBFUEKhNC49m0SqZoZ0qokByykdmcYjD+WzHIeJJxabxr8pb1WBX/VRU8FZwibW0v3peR3iYqFo1bxPWJmKVdYsvQfZqIAHpY1PmoGJsKYIG8oC/3YEfocESw==; 5:XO41ET8S0AdUvcGr9R/EGNg13xBxg3zZ3liDXzEMaXfNOPk2CRGQO8XbWEquSw+9EN3YL/KTtP6V5oUaHf6KMQ47uxN1xaWJuQMShh83WwUcvC2Mg/qbid1GEIAp2GBN6IRuY4pOlnMmMpKcRDeArQ==; 24:nW9ejLSkZLMbHlw1KuJq2lTI/wZrxPZzO4WYp9/im+kp0/QrsObUfU4DxsIBO2ZNk/P3ev47jcuqGJ/MoXgjl/27J96B5qzSLgTA4oy8rAA=; 7:YcZ0qEZQ2+VN0gmT6K59tze6O+b7wNObjti1wy6ko2OnlUiMevCv9ssdxTLsl2BDoZP3pY9kSFXFfaTx2E/UTvCes0vx498WSyUJURnhSWp0QD3DuyaHcUDulithMRlNn1TYGQvUdcme/JhmDR9Gg29sMDqea//YCgCAzlUjUkLGRE/jH4uECpqIGnzA5F/OLGrw8JZRA+JANZ6YHDRXi43Uun6efI70vFeI+ExIfek= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2017 12:30:03.4206 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR05MB1931 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 Cancel active scans and deactivate firmware scan watchdog timer when wireless interface configuration is changed. The usecases include wireless interface mode change, interface down, AP stop, virtual interface removal. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 9 ++++++--- drivers/net/wireless/quantenna/qtnfmac/cfg80211.h | 3 +++ drivers/net/wireless/quantenna/qtnfmac/event.c | 2 -- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index 856fa6e8327e..a450bc6bc774 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -115,6 +115,8 @@ int qtnf_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev) vif = qtnf_netdev_get_priv(wdev->netdev); + qtnf_scan_done(vif->mac, true); + if (qtnf_cmd_send_del_intf(vif)) pr_err("VIF%u.%u: failed to delete VIF\n", vif->mac->macid, vif->vifid); @@ -335,6 +337,8 @@ static int qtnf_stop_ap(struct wiphy *wiphy, struct net_device *dev) struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); int ret; + qtnf_scan_done(vif->mac, true); + ret = qtnf_cmd_send_stop_ap(vif); if (ret) { pr_err("VIF%u.%u: failed to stop AP operation in FW\n", @@ -570,8 +574,6 @@ qtnf_del_station(struct wiphy *wiphy, struct net_device *dev, !qtnf_sta_list_lookup(&vif->sta_list, params->mac)) return 0; - qtnf_scan_done(vif->mac, true); - ret = qtnf_cmd_send_del_sta(vif, params); if (ret) pr_err("VIF%u.%u: failed to delete STA %pM\n", @@ -1134,8 +1136,9 @@ void qtnf_virtual_intf_cleanup(struct net_device *ndev) } vif->sta_state = QTNF_STA_DISCONNECTED; - qtnf_scan_done(mac, true); } + + qtnf_scan_done(mac, true); } void qtnf_cfg80211_vif_reset(struct qtnf_vif *vif) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.h b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.h index 6a4af52522b8..66db26613b1f 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.h +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.h @@ -34,6 +34,9 @@ static inline void qtnf_scan_done(struct qtnf_wmac *mac, bool aborted) .aborted = aborted, }; + if (timer_pending(&mac->scan_timeout)) + del_timer_sync(&mac->scan_timeout); + mutex_lock(&mac->mac_lock); if (mac->scan_req) { diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.c b/drivers/net/wireless/quantenna/qtnfmac/event.c index 0fc2814eafad..43d2e7fd6e02 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/event.c +++ b/drivers/net/wireless/quantenna/qtnfmac/event.c @@ -345,8 +345,6 @@ qtnf_event_handle_scan_complete(struct qtnf_wmac *mac, return -EINVAL; } - if (timer_pending(&mac->scan_timeout)) - del_timer_sync(&mac->scan_timeout); qtnf_scan_done(mac, le32_to_cpu(status->flags) & QLINK_SCAN_ABORTED); return 0;