From patchwork Mon Sep 18 08:04:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 9955657 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 55BF760385 for ; Mon, 18 Sep 2017 08:05:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 461CE28BB3 for ; Mon, 18 Sep 2017 08:05:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3AD9E28BC0; Mon, 18 Sep 2017 08:05:15 +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 8E1F828BB3 for ; Mon, 18 Sep 2017 08:05:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752276AbdIRIFK (ORCPT ); Mon, 18 Sep 2017 04:05:10 -0400 Received: from mail-dm3nam03on0059.outbound.protection.outlook.com ([104.47.41.59]:56446 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752085AbdIRIFG (ORCPT ); Mon, 18 Sep 2017 04:05:06 -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=PJRobtrpzmfRFCkq6tZjwqguPiIrlkdTsHxjMxxX/aw=; b=foZC4AKoNKKK1wP4Q82q9n1QqQnt2x+ukz4U2qutbrGaFFFa/vGFum+tYUhNvxbcBYody+s/3Y9m9WCRPmhURPmj4FFS/KxnDZXSxmN2fmpGr+hRhaoO57HcCHeOp78LvT0/R1WSrpeu+svTn3p4tQgKj6wYz8YPOskVZPSpuRY= Received: from bars.quantenna.com (195.182.157.78) by CY1PR05MB1930.namprd05.prod.outlook.com (10.162.216.12) 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 08:05:03 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org Cc: Igor Mitsyanko , Avinash Patil , Sergey Matyukevich Subject: [PATCH 2/2] qtnfmac: abort scans on wireless interface changes Date: Mon, 18 Sep 2017 11:04:46 +0300 Message-Id: <20170918080446.21763-3-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170918080446.21763-1-sergey.matyukevich.os@quantenna.com> References: <20170918080446.21763-1-sergey.matyukevich.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [195.182.157.78] X-ClientProxiedBy: HE1PR0401CA0067.eurprd04.prod.outlook.com (10.168.27.35) To CY1PR05MB1930.namprd05.prod.outlook.com (10.162.216.12) X-MS-Office365-Filtering-Correlation-Id: 1e3b9dda-3e53-4639-a5fe-08d4fe6bf836 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:CY1PR05MB1930; X-Microsoft-Exchange-Diagnostics: 1; CY1PR05MB1930; 3:QL3BdrR0z0xlzdZjKBECI5Do/FsWqyTLj0ivDxvaqSwM09wMJ/6zLmX1UyHqpem6vfYDtUYFLG1kS886BWjDvczjneXvy0PLnAtepXSQ6wfC8b9xBhFT1Eq/9173be2nVtiBeyybuEiW0v2qoG5XV83vbHJSwE5c53M9LZjfmxdoWerOEn09TLNa6OfE5xVjGLQc3Af2jSu2R/4wWm0I8yRYZEjPHe7T6A+3WhiTnja09Huca0B3RTe48yJM1OQY; 25:buEISQogJ1LKOZCH5muVgnlslUGcOxRk/c9NbkcEpbP9exrStoXEFIV1LXpk9+VwxRr9/E4xbevxpEA8EbojauGH5B77ImUnHHpZ8hAymadH6O6R8HwBsrMLq5UbhDRor846vcIivnCQqQmMx/N6emagDaPzmbp2mHytA5Ve1m2B7y/lebYg04Y2trJdtMJEBBhwSFw9ayLLcVt83h3CYdAdkMaa1bO/3aBZrP5ohohcnFOomCQxntAsjzcN68KgQGyhDNd3gvugdzVPgmSaPYBpIZB4fcqXtchAb/HCfykVHZIUcxYKAonvHMKYUOr7SUwImP8UZhlJrZP4rERadg==; 31:vuA6ZdGh2KaVIQxM/gpZIyLhivpFbJrl4f93LQ2DlvTsPEipg6mq5p88KUkmKw3/ir9mt4czIR9EOTZ76s9BIp/OaWHIgFnydqDJ5XbTm7IY/+v3QcVluh9ngJRv9P51VigoPy/xEw4QMZ8aYR/uJ6QWhy0a0k9OqOzeEpT4dLY4lSPYKWJ6vgP0/+dNT2vlVaUyqP5/r/w1b1rJs0x/+uzqVDBKk3aEmOAghJ187v0= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY1PR05MB1930: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; X-Microsoft-Exchange-Diagnostics: 1; CY1PR05MB1930; 20:2FJx6lBzqpxteT34nRdgCnQBBXe5qIXfuP7HN2JJ5LmvE42LqbKvfw+ibterGPTDznxY82CzlgCkLznUx2OqxDRkOx6KNVz67toWQJsQlPm+VW+XQpRL1CtE7KUDoVjAaJt76dYdUWlwKeunQum1dW6i8/HbLJCNP00ldSjRHYOk7iJSy5vec0jp89OBce91S2EZpLn6j9jHc1vUXAb8kErq4mH5BXXJaOiWGXr4P5FAfrM3uhyNvY4qEjcXWRsEG86oe7GBfftLNubJjb4Mmg0WixKcHI1VzEMF2vqECUxKA6EokoN8p2ntn7+GUwXYSWdxpwrPxBq8AD8tRLqMz24c231O22yurN/MEF4+UFA7PM0cKY55YRyW7V23wHsUSgu7HseqGpuGadb+0XforPtlfqit2pbZW2vUOuycfrjvTB5VQyztUtTywP/DK+PgD9T+UqblHuew3Nuf2aIoiunxyI/rhoTmtIUfUBctdEIt70M8/dyiWInFVSXjJM7P; 4:pVQGSwxSyKz/tTFWjKlBg+twvTKSOpeNoftRmjhL+ou/+w0whwqk4LGwg6JkTAGl1K6SpwZFAmTibTyE98uZ8jUlmpmYY+M6QivGIRO4R6UM2oYkJB+OaQZKMqypI6k9R/vfuppfn+kdKxh4hvUEswtjmsdVhyqN72HhCFGY18nh/SV+jKs27GiiOSlzY0lklKU1PQXep31nP5sHuVkprA2PvaPzHQ+CBazq4lCCkW1j2rBEFpMmvUD1/oha64Yy 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)(8121501046)(5005006)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(6041248)(20161123564025)(20161123555025)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR05MB1930; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR05MB1930; X-Forefront-PRVS: 04347F8039 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(39830400002)(199003)(189002)(8676002)(2906002)(81156014)(81166006)(36756003)(16586007)(6666003)(106356001)(6116002)(5003940100001)(103116003)(189998001)(25786009)(16526017)(50226002)(3846002)(8936002)(105586002)(2361001)(4326008)(478600001)(69596002)(316002)(48376002)(97736004)(50466002)(7736002)(68736007)(6486002)(110136004)(305945005)(33646002)(50986999)(107886003)(86362001)(101416001)(54906002)(66066001)(575784001)(47776003)(6916009)(1076002)(5660300001)(2950100002)(53416004)(53936002)(2351001)(76176999); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR05MB1930; 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; CY1PR05MB1930; 23:qhG+rgGd1C3Qrdg0+leNTyEZsElUaBnPPvNiHU+NX?= =?us-ascii?Q?Kxb0+baDJuY+MW1PKBmM8i2PK7KTnEKn+XKLgZbWNix3S/GX0SdMwhjj3KeJ?= =?us-ascii?Q?VEl1Fdo6Wj8+6XBpuUo5R3ChtTGa8oDLyf+7Ybv0g0Ugsn8hVnHqKQZDXm+z?= =?us-ascii?Q?9V7wp3IhWmsUMfhsPO8vQdPQxV33SSAvKc52awd7DXd0n0oMwA8sV7/KwrbY?= =?us-ascii?Q?dGp9hQBw4kj4/7BOLg1Q45tWzIJohbs8azg4B8CbJ/856BpWUF9gz8PKtiIx?= =?us-ascii?Q?d8T0AWwxFqhvtuInZPW6m4kuDw/sKNgFKyhUC9vpji941RMIbWhQTPBvA+M3?= =?us-ascii?Q?T8+69SsSL6hyi+1thuh0OMKv9lUM4Ad/7ZhUl6LGdGgyX8Tt/RWlc60PXiTV?= =?us-ascii?Q?WGEoWzRI/xDRiw6ykfwfB7PQWO5+MY8QgpBNiZjJAy4evcIiiyLGLaQvbv7e?= =?us-ascii?Q?nPcWX55fpwMWHdP8ZY90CPnXdxPWOe++Q6bSGpR9vV9BqW8rm6K+qzrxCy+X?= =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2+gpAvjFWcRurOwpseDzdzIM8phJw6tDP/Ihc27OJBHLOmjH+eeFaXbV6Ja0oDfQcyLpRwCFEQoKfGy3MHVLuejeii3sPctPiLYJe7A10+TbDx2U54auqTHedmRln3oVL4SK8c/pLt2CT9bXuZFRT2+/nUjChgAPsuA86HNKpV1GsW2548mn4XrMYtJVsml0Pubm4hc4ObLMXPak0Sm5IFv3AAOHxQQOL1EgFPpxFpBgEaz11vmv9F9g==; 5:t75Lyhp+BnmIse92s3Kurs6UPtbUXjiwMmlb15t84Zg9/0s5Lul5rAzMhVBD/22FrG7r10BwAd5iFnaYq/0lpa+biDHw20rN0bZ19f/Pzt8t/2z0JgHKBzFVhZj1kK0EHOhLHKZ6wXzBg0PlcXvK9w==; 24:JeDlC6f2FK12VnWzuR1IlwoPO+2lC1gGxyyv3gWXr21T7Brskre/pO0xpiF5unqUzWaNMe34l5vJF3fVfN62fLoU60VwU6IAKJ5Z0HhldBg=; 7:0URozRfEvusiHKlr3RdXRgztfI/Us1L02/cGywRfHNwEhM41bJ3wdOl6jCztDaWQbhIwt6yWXXIGAOEzmX5aR6BDdr07VsLdqqt5UcFzOxAuhP7GQYSMLtujCrikKXpdhiXtbkm8iZODj+xhrD2Lv7fF2YLN14zdpnQmWzzt0MwSB/B1wC7L2z0CVzqoK6BHlxM4K3LZDvx8vLi4826BPvJwaFQOrso20oS0+T0KeXU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2017 08:05:03.3493 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR05MB1930 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 Abort active scans 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/core.c | 2 +- drivers/net/wireless/quantenna/qtnfmac/event.c | 2 -- 4 files changed, 10 insertions(+), 6 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/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c index 5e60180482d1..7f83bedc0b88 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.c +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c @@ -68,9 +68,9 @@ static int qtnf_netdev_open(struct net_device *ndev) */ static int qtnf_netdev_close(struct net_device *ndev) { - netif_carrier_off(ndev); qtnf_virtual_intf_cleanup(ndev); qtnf_netdev_updown(ndev, 0); + netif_carrier_off(ndev); return 0; } 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;