From patchwork Tue Dec 17 16:15:09 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: 11298091 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 30D8714B7 for ; Tue, 17 Dec 2019 16:15:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 03B6921582 for ; Tue, 17 Dec 2019 16:15:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="ju80BinX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728951AbfLQQPo (ORCPT ); Tue, 17 Dec 2019 11:15:44 -0500 Received: from mail-bn7nam10on2081.outbound.protection.outlook.com ([40.107.92.81]:6496 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728057AbfLQQPn (ORCPT ); Tue, 17 Dec 2019 11:15:43 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q65AsRvBPtHhIbxYf0ITjjrkcw8jBQqK4uS6rYBRZbEw1wxVuHIM7H//Udv0g+V38u0vPKZCL8scVuQnW3kFPiM5CmDuLttf3bohoXK0CV1kawZoCnxyLmyhMCtVpi98DAyMe1K8RkrxtkmB2sdcSuYInXf8ixSdhyMEP4fG2C9rgnLTlZ3RMYSHtw4nLyNHAYQJbLwNSGILT5TyE7sN+7BVV0s+smiQmJI++fRNFJ7jJQP3o2eji2zf9doLgmA73wM6uj1IT3K8JAtUKHjcurn+DOzpSHel4fXYCX5Uw0Y0ONfWxvr7/o5EhBQwEZXIRsYNKqBxVQEBzg24FyTEWA== 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=xjTf9a7HgmIEmVRpuLTL6kfHHNpjEbqX1VGUrVeMHzA=; b=W+Q4x8OJ/ELoVS+6UNZM8u/CZ4vG+wXnB39wqLAI/Q1RmQVoBDBQ68J4xjL6TitAlPbpfQH3n6LNDLxnzTm8rZBYgTSX3gtyS+vA35MzuEEQeKcbLxbKvmH5sH9eYa5hsjNxBsa00fHb/nZaRkOzQEm1M8qGvbIk4wHPnvt4shDqyMh0Ut5sxG/dj7s/XWyBDyRUTSL5BEz8Bss3bOQ/8B4LSOhQtKMMt3QMiuenp4usMfkgxqQPAMOzv86ro+DheD1gr/H58lzOVpGgO3dY83Whl1aee/a9BREoRRWaojMNTH9MIPUfIfcZWNz2IE+4mcf8Qmg1x/WR9Z1q36Jv2w== 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=xjTf9a7HgmIEmVRpuLTL6kfHHNpjEbqX1VGUrVeMHzA=; b=ju80BinXqwpevRgES9UM48RzDqT2xI0dukxaIcrjtzytPMk7tO7gqrRJZef+QX6ycHvwXeAIYVeETp50Twu9KgAMCboJdGVGtuNkpl6DTczh2DV8RT369dtSjfijDDT9NWPqg/XyYPFlfjRQ2Bxqo0G2P40L3vP2xR2onSXmKD4= 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:15:40 +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:15:39 +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 30/55] staging: wfx: firmware already handle powersave mode during scan Thread-Topic: [PATCH v2 30/55] staging: wfx: firmware already handle powersave mode during scan Thread-Index: AQHVtPUnTzH8bJzKeEKSffREJQG94w== Date: Tue, 17 Dec 2019 16:15:09 +0000 Message-ID: <20191217161318.31402-31-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: e13c1a73-c823-4df5-96d2-08d7830c49bd x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; 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: uJzShR5v9zv4c5Nfr9JIvGyH4/4ex22v/+LLg3VoD/P2hdpV6iwAmvOZ7RzogPTwfzyCKyZ00p1EvN1oLXAlP3xkTcHPudp6n90ewmrZdFqKbb+zIxRjUZrOb5ZUyj4+a7rOCkBQevirL+b/xx5+BaY81B3KkEh/DpvML2j76pvqOsfjKddcrxLMh3HmxLUu4rded/+WpgVE+UTL111qQb/ZYMAoq81cd1wMGHGJsRxWl84bDky9DSCVruUSR75jg+b3VIKScR+3n0wq3jwaJti8w+BraadxDJPk30tTdXy3xwXa5VFIAVMR0vm6+jZde94rZDwbCv8DlMNZrKPp/iU7+XqXAtcXqM5sKMiRPNxt6n2mFdXiRRwFYkPJSht2pi6UbHIe1y0Z8vl65pw5bzPVikigOTc+yBrHzlY+5PePN5jG9zHheyDlwT0BkSIc Content-ID: <9CC1FFE48CE545439E19B6ED967463F9@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: e13c1a73-c823-4df5-96d2-08d7830c49bd X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:09.7801 (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: xJZSA2eF0LZ5ihSbyG/YYQWPBM4C5KWhF0E6D3D0x0MvHXZMYGe4PLFAxKUNF/PBUyZbbubgPHrGPkVKEgNnOw== 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 When user try to launch scan while connected, it is necessary to notify the AP that we cannot receive data (using power save mode). Firmware already handles this automatically so the code in the driver is redundant and can be dropped. By edge effect, hack of scan status in wfx_set_pm() is now useless. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/scan.c | 14 -------------- drivers/staging/wfx/sta.c | 7 +------ 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index cb7a1fdd0001..4b95e6a97df7 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -141,22 +141,11 @@ void wfx_scan_work(struct work_struct *work) .scan_req.scan_type.type = 0, /* Foreground */ }; struct ieee80211_channel *first; - bool first_run = (wvif->scan.begin == wvif->scan.curr && - wvif->scan.begin != wvif->scan.end); int i; down(&wvif->scan.lock); mutex_lock(&wvif->wdev->conf_mutex); - if (first_run) { - if (wvif->state == WFX_STATE_STA && - !(wvif->powersave_mode.pm_mode.enter_psm)) { - struct hif_req_set_pm_mode pm = wvif->powersave_mode; - - pm.pm_mode.enter_psm = 1; - wfx_set_pm(wvif, &pm); - } - } if (!wvif->scan.req || wvif->scan.curr == wvif->scan.end) { if (wvif->scan.output_power != wvif->wdev->output_power) @@ -177,9 +166,6 @@ void wfx_scan_work(struct work_struct *work) __ieee80211_scan_completed_compat(wvif->wdev->hw, wvif->scan.status ? 1 : 0); up(&wvif->scan.lock); - if (wvif->state == WFX_STATE_STA && - !(wvif->powersave_mode.pm_mode.enter_psm)) - wfx_set_pm(wvif, &wvif->powersave_mode); return; } first = *wvif->scan.curr; diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 62e65493a4fe..fb45aa66fc56 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -375,7 +375,6 @@ int wfx_set_pm(struct wfx_vif *wvif, const struct hif_req_set_pm_mode *arg) { struct hif_req_set_pm_mode pm = *arg; u16 uapsd_flags; - int ret; if (wvif->state != WFX_STATE_STA || !wvif->bss_params.aid) return 0; @@ -396,11 +395,7 @@ int wfx_set_pm(struct wfx_vif *wvif, const struct hif_req_set_pm_mode *arg) msecs_to_jiffies(300))) dev_warn(wvif->wdev->dev, "timeout while waiting of set_pm_mode_complete\n"); - ret = hif_set_pm(wvif, &pm); - // FIXME: why ? - if (-ETIMEDOUT == wvif->scan.status) - wvif->scan.status = 1; - return ret; + return hif_set_pm(wvif, &pm); } int wfx_set_rts_threshold(struct ieee80211_hw *hw, u32 value)