From patchwork Mon Dec 16 17:03:49 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: 11294793 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 238BA1580 for ; Mon, 16 Dec 2019 17:09:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EC308206D7 for ; Mon, 16 Dec 2019 17:09:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="Ck2j5iUI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727701AbfLPRGo (ORCPT ); Mon, 16 Dec 2019 12:06:44 -0500 Received: from mail-dm6nam11on2045.outbound.protection.outlook.com ([40.107.223.45]:6092 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727680AbfLPRGj (ORCPT ); Mon, 16 Dec 2019 12:06:39 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WfdZlfME1+tp8qBVK+ULDzvk+/ZAGgZACP3lk0ku1RxMZkfgEz39etIiq2dzCmSI2JUspTl7DVsluEUYlI6RwR0w65MzTfu3DsRTBPzosb3t5h0NxBqaIxeZohUvOOuMOHAWOSb58XNWg/g2hRq7GlHRqz9wxgyhDnEgtkLKqvmK66kTTHhhOcNFUfovhh1s/r9m/Ll6D2spRcVsQVFVPo1969cIlTDx56yH1fE9N4Bh1ffmhcNZ+6rZzW0uOMW3a/wE+byYwJupfWP5fFMuLFsvcPZge5I0mf3eXbz2Hk9XBJ0SqfN4iSh/e1bfGyJVwkS/A69tY41KiLF+G0+TOA== 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=JG+rcLalwIMErQWue0ONO4yw13jA+ZjZ1Q/OcOoxsQw=; b=Mu3NB4lydyDIGEoumtI/3wbTvLsmvrAZCEY4XPBjCSZkGvAAlqNFQ1TlI2DoQAYfmAFLjino2K9RebMwPw2r71EhTZxuZbEjl73a1l0ZqrdeXwDH+j6m/ScBtXdLxE+zumZcEMxDbCtymoZr3+6vffxZYB4k0+hRkQo/06lUrrKLK7Pevdm38IQ0GO4E0Ou/jtvdaT6YbQMZyr9ne/FK2uj/AXQF0iLnUIgJcx8xihD1c8sPwXZf5IgvxPTpsfKXHyxYzDMUFPRv/QD1EkWg67qHvIaiuP6qYZipMlJi6NP5Wk9B6Qg11ZQoxauSbARfa+F+S0C61z61O6rGo6+EZw== 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=JG+rcLalwIMErQWue0ONO4yw13jA+ZjZ1Q/OcOoxsQw=; b=Ck2j5iUIx2kZBU+MwHyPbFp2f95axWHJIh4mRh4xGuOaXtGqy1P9aoGJkidaQY5zv8SoER1ixO2Q29GQLofpZDd77uXnkCFnJJ1EqrdGqib2Lapl8nVPI6EsTu0HPKzLNNdaRT9T5IHfHJeUH4Igp/6gtDA6GQOYGh0UxN5ob2A= 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:36 +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:36 +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 30/55] staging: wfx: firmware already handle powersave mode during scan Thread-Topic: [PATCH 30/55] staging: wfx: firmware already handle powersave mode during scan Thread-Index: AQHVtDLJbvQgzn6bd06+Ts6mLZQVUw== Date: Mon, 16 Dec 2019 17:03:49 +0000 Message-ID: <20191216170302.29543-31-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: 7e6f3cbc-8089-4d26-9d30-08d7824a4f7c x-ms-traffictypediagnostic: MN2PR11MB4445: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; 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: a2tExh+kWnVqYEudy755XI6ZZiPeF9yLUejaDzWrhSBvY13TFn7/ee0ELSRANG+uYEUzaEfJIEp9V+hraktJjhTThGqyPiZgjBFQGi25S7BkPcPV5H+X4ZJH7xTdXQNQs4ODb3DTuCC3hSMU0cP0NvB9lOSwxRlEbp3ErrTsRxYK+bzndrC1f+GfAl1bTOhFqSS6ZlXCvdwmHhCsuFtgGHXfctLHWKlA3mBZetzv1EgchkWo4QUQOdurqTlrp74bhQqY5TqutUf2fSar7Non4aTiD2umPBW4ySUe9L2Jl9pPwwojZbovLe4RnSmwAfCv51nD5humr6h7DZa8W+ymQQNH9Nc5+GjbsOD+bo5lB6dHoI0qpRCS2MRMKw4Q/ClV6rYLwbgD3uMyxQW9jUAoIVHJinKhVYuLifElcrYdyE0ZXBW9yeEAExbQ3xscNcgH Content-ID: <4CD238A560745B448A84B576215B7673@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7e6f3cbc-8089-4d26-9d30-08d7824a4f7c X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Dec 2019 17:03:49.3700 (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: v06ura1SAqKem4NyM8IJJNhXZRgmJYOMIQ/Hbk1AsdYlK/HZzwmKGUkRV1KPKc8pFttlqRYjt01DKNB39chmRw== 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 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)