From patchwork Mon Dec 16 17:04:00 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: 11294757 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 408EA1580 for ; Mon, 16 Dec 2019 17:07:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1422B20717 for ; Mon, 16 Dec 2019 17:07:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="gWmfX8O9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727166AbfLPRHh (ORCPT ); Mon, 16 Dec 2019 12:07:37 -0500 Received: from mail-dm6nam11on2044.outbound.protection.outlook.com ([40.107.223.44]:54496 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727959AbfLPRHE (ORCPT ); Mon, 16 Dec 2019 12:07:04 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QfmYL7KkexCY/AHcJZ5B4lxu8cxKIr+vD34Lx8z4/LlEqDlf3UHS0pnBne0qLhaLbFMvf1vdhgqKzVn82vDn1x2Q4TLUr/Zr/i644+8dmJh0jH13EpaTf0wr+OVMMhRvoXPvlGJRjih6pT/vdvdYNJRT0hKrH2UsegQKXaZrhHIT/UVD1qBs9beOYxTBkM4+DU3bwKiF929PBxBomnYIVEWy669QAzL7c7qoQJGfU+l496GVqfUzjAaMnvw/2oqGjznnky+egMPdSkIx52nkZUO40+6dy9HLSmQj2nX7f8yV5WHqvmZMvxFHhIvlR+IDoPgrOGD056/3W1hJlZWv6Q== 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=6oNwcJ6JFnVAYIDsKxMxxqqBxKgUqaAbaPTJtjiXRf0=; b=J4Kphgdd5totQifgtwPIHYkjzHVhBFz/8GK4Bt1nzjuIC8bKkhsM1woYEGmH8+12ZeZ/zbEnVGe7LCEurj60YPl9WBeHRBG8E+6xBKMeotYEDVcidQhW21uFiYsghVoeUFt8xMRB2t2kvSkl8yxnc/i7+ZOpFh9zrz/J52i8pQvQfp/UXSsDu8orX8k/4ZvmbRQBe3qE0pVroceiSSg9mbThXlq9o8xxqINsrnfPytgi8qWZhhWw9Im8MNzn1BYwcHVgBmZF8Lrh36DbJoLMP77ut3aOMdsJ1BA74FZgbbUTnRpTHr9Xm30ZN9al673R65lgZjCak5GkIacuxmd1YA== 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=6oNwcJ6JFnVAYIDsKxMxxqqBxKgUqaAbaPTJtjiXRf0=; b=gWmfX8O9HKHjHUSUpuHkkYXH8vG6XShP+AxzRVhPfDIgULBXPdy8dIiP7VzmoWT5Ww65gsYx3aTRDdabkFLbAN36/lS2k2V5lpOLcp+3YnY0CHItPV/pxvLMYfC+OzkYerOKH5YROkbApM4WOMGgpeaE4Hn++7bSQwWFIFow+Lk= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4445.namprd11.prod.outlook.com (52.135.37.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.18; Mon, 16 Dec 2019 17:06:51 +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; Mon, 16 Dec 2019 17:06:51 +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 54/55] staging: wfx: implement cancel_hw_scan() Thread-Topic: [PATCH 54/55] staging: wfx: implement cancel_hw_scan() Thread-Index: AQHVtDLPXPNhCC/3cESry3OJ0NQnAA== Date: Mon, 16 Dec 2019 17:04:00 +0000 Message-ID: <20191216170302.29543-55-Jerome.Pouiller@silabs.com> References: <20191216170302.29543-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191216170302.29543-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 709a1898-24fc-46bb-b084-08d7824a57ed x-ms-traffictypediagnostic: MN2PR11MB4445: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:372; x-forefront-prvs: 02530BD3AA x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(366004)(39850400004)(396003)(136003)(189003)(199004)(110136005)(6486002)(107886003)(36756003)(186003)(316002)(66946007)(54906003)(5660300002)(66574012)(66446008)(66556008)(85182001)(66476007)(76116006)(91956017)(64756008)(2616005)(6506007)(85202003)(2906002)(26005)(71200400001)(6512007)(4326008)(8936002)(81166006)(1076003)(478600001)(86362001)(81156014)(6666004)(8676002);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB4445;H:MN2PR11MB4063.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A: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: FEjuY9ilqLEyBH7voW+J3zvGlaztWDGFX4RXeTBlA4bFIJAjsfMDbn3Ltr9JlL4ijQoW827BRtat/FkTGaanbvrbOVtaRE/rAkdeiq81kRBJKsFuLvS1QhBC28aXEEtttm9GySSMHywODE0byDlbS7tqvXX8ooB7+2Oai7k+UoXZ9TCHDPxdj4ezUAu6ASdvaux70YlfFKhy34wYyScEWQpCCTD+G/eTTkyd37+0HUahVIiLuWdzp8dw6Evuv8tEsgXtkc5oJUp+qW9Zm/ZWqxIQqg7473yO4/sE0QaRYS7aeyjks9EBIBbl36PGcdpLUa8nWB6MrGriBC5kvNKHm0q+i3l304CI2oPoo/dpTn3shXinFoAEZ38BdepzAGaBgCEX/bmMj/gdKG3J8DdW9hD8UKegYptKvPEipn3HqZXkyBhcWxsRM50TMR1Oo1qz Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 709a1898-24fc-46bb-b084-08d7824a57ed X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Dec 2019 17:04:00.6466 (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: RSDaDw8EpTPbJYV4r+XYFF0zcU3Cvixm9VieUvk7qRvny98MB1SDcun3JeeYChuQ5dkHNuFj8Kk2ZobRJsweIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4445 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;