From patchwork Tue Dec 17 16:15:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 11298113 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 31A5F14B7 for ; Tue, 17 Dec 2019 16:16:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0575A21835 for ; Tue, 17 Dec 2019 16:16:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="e2ZQLv3d" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729164AbfLQQQI (ORCPT ); Tue, 17 Dec 2019 11:16:08 -0500 Received: from mail-bn7nam10on2078.outbound.protection.outlook.com ([40.107.92.78]:31534 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729151AbfLQQQH (ORCPT ); Tue, 17 Dec 2019 11:16:07 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oD5f2GYKWBs4eB01On7O+YEzhiXF3e88GKvLkuenBy87+M/xTJqgVzgBBDoj+tjfUesJBia+IpVVr71ithPw71OxnK3McD3ibaJPZJkW1Ys+YyFa6Jcg4JJo8cYvv+rjEc3ao1LIZuFDh12j/CjMKNYY+2iGBFSfBwLKsz7jePSyWu6VGMroceMva5ECWFP6HCY5KgQvuH3hQtmwnMkLKwLpGSApAcXFOOolOgrCOIoEumP+aTQxtzUkGnoI2fi42w3vvMRGFOaXc2yFDB/UWadEvWWcfbhx10D31HYPgovDOzVd5DstxsB8G9Xbye6svIwlwgCW/cS10OMqhFyy9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y33ignvCp+2GinP/MWfVexEnxeePITEC0OtPfj23pfw=; b=ikDeA878PmNNWxj7PD/YiovbQ5n7f670H1k/MrWTo1FEd9//WejDuP6elRfnk7jdEg8nPIMNCJjwlZYj6+tJq9C6hUk24+n50qR8yqe7cBoRYI29cDP/KWJyx3iQEAkp8w1WVbIVAWGfwFuFVEoBRKQHm+Q5LaAMW59Qusk9sRqDH1fwnwGzSEpXjOaZ2YujlmbxSTdFarw/r9L5Jdbgt4Z9ZcxMgi3Pt9FfWa/wPBxVN0r66V2Y0t0vgp1BEL7CZaH4o+Wck9CrVpLzrJ+fswGI3fxhQpy0dS3aYwqOkjfLYgWbQhhHohAB2cqxJyTIj8PJScTAbxx+qPPzDe9RsA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y33ignvCp+2GinP/MWfVexEnxeePITEC0OtPfj23pfw=; b=e2ZQLv3dUPXKMz4/PGLNas+UUVp+jyzvH8NwrOZAgF0FAO0H+R9FG0cPjuBi/nRRlTPOl4k5nNkANZRJ3/Di+TMewmVaV/Aj7PtE4Ab5zXD3eaEgL59KFypd90JMUUBNQ5ZK/CIQNSoI5Pp/12KpB9E+Xi3BQS83MSGGaZ9GOko= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4208.namprd11.prod.outlook.com (52.135.36.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 16:16:04 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2538.019; Tue, 17 Dec 2019 16:16:04 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH v2 54/55] staging: wfx: implement cancel_hw_scan() Thread-Topic: [PATCH v2 54/55] staging: wfx: implement cancel_hw_scan() Thread-Index: AQHVtPU6aYi057RR/UqffDEzXC3u2w== Date: Tue, 17 Dec 2019 16:15:41 +0000 Message-ID: <20191217161318.31402-55-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 46645ccd-6e4b-4a56-d2bd-08d7830c5c70 x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:372; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39850400004)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(5660300002)(316002)(6506007)(85182001)(478600001)(71200400001)(2906002)(36756003)(186003)(26005)(81166006)(54906003)(1076003)(110136005)(66574012)(4326008)(8676002)(86362001)(6486002)(6666004)(52116002)(6512007)(64756008)(85202003)(66946007)(66476007)(66446008)(66556008)(8936002)(107886003)(2616005)(81156014);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB4208;H:MN2PR11MB4063.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GFpyxRl1haePDjD2mVDpiaW4SFulRfyqSreqStJDf1fvM1vmWv245Jumg9W1RPbaZl1Tj39yHplBSaTKreTV1y7Z+pH293suz+DcPcN0aB23kPXiXNtCj4FZKRb9iceimPKHAQIk74yOtdJB3FX2OdxzKFPpJdxoosQdMGAFeGaG02VMUx6MBFKhHLarSnsrkk7M3uHWpu9ZOpiHqUOz7SBJP2n8A51+R8Ad7bN2U5kKFO2sEOXxVGm4ySR3rzM/ubIMJiR1bLBBYLBWFzllw/Uc99ULp4KCkeA9wzCpfnTHKF32yv5s2ICzJ911TPj6gGn19bKV26rEQQvX2A52RJ0ir0Ka7FNxzalY59fgO0yTxQ7Mx3NFzMF0SSb/dudxTOoi2J5vZbQWI7XLEYJfVlR2kd+L5o18qRtenZEkB+hA6bb1tFb3MIdYrjo+A9rf Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 46645ccd-6e4b-4a56-d2bd-08d7830c5c70 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:41.1977 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 4qjIVPmUO53j+G9bYjYswiOTW5W6xtqUPu5fyEWQQpD91gygNiTR0JQK5A9OCUlpxyqvlFGdQqGOjXbzX0uIfQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4208 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The device provides an API to abort a scan request. Expose this feature to mac80211. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/main.c | 1 + drivers/staging/wfx/scan.c | 13 +++++++++++++ drivers/staging/wfx/scan.h | 1 + drivers/staging/wfx/wfx.h | 1 + 4 files changed, 16 insertions(+) diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c index cf4bcb14a12d..45c9939b7e62 100644 --- a/drivers/staging/wfx/main.c +++ b/drivers/staging/wfx/main.c @@ -135,6 +135,7 @@ static const struct ieee80211_ops wfx_ops = { .tx = wfx_tx, .conf_tx = wfx_conf_tx, .hw_scan = wfx_hw_scan, + .cancel_hw_scan = wfx_cancel_hw_scan, .sta_add = wfx_sta_add, .sta_remove = wfx_sta_remove, .sta_notify = wfx_sta_notify, diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index dde2f8868147..24061d09c404 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -54,6 +54,7 @@ static int send_scan_req(struct wfx_vif *wvif, break; } wfx_tx_lock_flush(wvif->wdev); + wvif->scan_abort = false; reinit_completion(&wvif->scan_complete); ret = hif_scan(wvif, req, start_idx, i - start_idx); if (ret < 0) @@ -68,6 +69,10 @@ static int send_scan_req(struct wfx_vif *wvif, hif_stop_scan(wvif); return -ETIMEDOUT; } + if (wvif->scan_abort) { + dev_notice(wvif->wdev->dev, "scan abort\n"); + return -ECONNABORTED; + } return i - start_idx; } @@ -115,6 +120,14 @@ int wfx_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, return 0; } +void wfx_cancel_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif) +{ + struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv; + + wvif->scan_abort = true; + hif_stop_scan(wvif); +} + void wfx_scan_complete(struct wfx_vif *wvif, const struct hif_ind_scan_cmpl *arg) { diff --git a/drivers/staging/wfx/scan.h b/drivers/staging/wfx/scan.h index b547f1927d72..bba9f15a9ff5 100644 --- a/drivers/staging/wfx/scan.h +++ b/drivers/staging/wfx/scan.h @@ -18,6 +18,7 @@ struct wfx_vif; void wfx_hw_scan_work(struct work_struct *work); int wfx_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_scan_request *req); +void wfx_cancel_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif); void wfx_scan_complete(struct wfx_vif *wvif, const struct hif_ind_scan_cmpl *ind); diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index db433bee87af..0a3df382af03 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -127,6 +127,7 @@ struct wfx_vif { struct mutex scan_lock; struct work_struct scan_work; struct completion scan_complete; + bool scan_abort; struct ieee80211_scan_request *scan_req; struct completion set_pm_mode_complete;