From patchwork Tue Dec 17 16:15:11 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: 11298159 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 1F07A17F0 for ; Tue, 17 Dec 2019 16:19:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DC09821835 for ; Tue, 17 Dec 2019 16:19:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="BLYlqaLs" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729412AbfLQQTG (ORCPT ); Tue, 17 Dec 2019 11:19:06 -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 S1728707AbfLQQPo (ORCPT ); Tue, 17 Dec 2019 11:15:44 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DvDDmHzaApdi2VW2QlCJEOqkn8v/oTe6TppNiUAQcSkrBwYLywDij1FsuKYaasp31Lx26Iia0ZfQwdPdENkaT1tddHV15CdURanW6Ewssori/eK5Y9iBZN2/ou5+gJVDbfG1QGAPIItjVwv0N8SQNdVaKaW1y2IL2mJjJbdNnPpHzUEDqFtWvbsU11OZpsrFqDWX2YVJwLkitBOt4wQr0MytupXffOf7hgBAUJ+y85r8AINKg7hl/uSNCKwuekdT8mlhUSZoOW5wcIyVysUiDReOXUOhZWxMk5L2FF+bu0I+nOPmTG/t8aPYvB+mLHK8a+9MXhcPlEgM/PQx7t5CvA== 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=6nWAnv+qpHBHZEfgEkRrgWIwRNoZUxsON81aiF6xIKo=; b=Oi5DAX5AC5lOkqImfFLXZZHvqnmeKwwpawrpuf64gEtU/HkRUU8itWu0/AJ5Qvs0OSfzxzJt8DxL4QGCceyIANGbUjegbn7xsf0Cdhup5ps6Avf0+u62EFRz/9IutgLBLNI6/fSbeNuGoYzNpfjQW13bbkqn/v5Nnu6V4sYwjRU3F+DPwXgrUA7SsjGW24zfpopAoyoyAHrTa21xHTZTZinqKQBvhq3otNinPCF7V8logn6QUEZKB0SokwkOsfN/Fnama7Qz5HW4v72pYOzEKwAi30WtRrewv8MBi3+lj2j7rI4B8YT01eXyAgm5aHCxw1WMqT5VgVPexnc7grC4ng== 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=6nWAnv+qpHBHZEfgEkRrgWIwRNoZUxsON81aiF6xIKo=; b=BLYlqaLsFdoovrp0Aq4t3zkEWOm2GTLARuEAYwuqi3Z9ZLNkajgFSudnkxBTaXo6ztq9FSyqieQumkQUuRsDh1032KQwZlC7SUjrjJv5yfTf4z7wA09vfOOaYaYloUhcnUEVT+06Swj7zOfhChGEWB8PX1RheRFOrnzXZcjv1Vw= 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:40 +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 31/55] staging: wfx: declare wfx_set_pm() static Thread-Topic: [PATCH v2 31/55] staging: wfx: declare wfx_set_pm() static Thread-Index: AQHVtPUomNvdF9c8U06XszlJrpgzug== Date: Tue, 17 Dec 2019 16:15:11 +0000 Message-ID: <20191217161318.31402-32-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: 135d5509-bd38-48f6-5616-08d7830c4a80 x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; 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: lav8zDhbJ9zi7PJuf3gJZ1rF5cJFuQu2rUkvpm3VZPfHdFjhBIOQjtc1OKQdtNaJcsgqPdyRdshlEe4nCSixFi1mb/CY7M1SqpKFMjQlO2OrQykYTJpWrkf9o11G8ltXAPUprIAqYnl4uMCwh3QbE/51dVbizWTfEG4qp8ZV2RcCdqGS3GL1cwOMgklvLJ2kXGjZwVzzVuW/ok7OKJRZnmPZ+LDXXNPwvKtXMFZfQGzKZfnNqZuN7Ae6QHh5az2Umg6dUh6l4CfyRmHWpUbaG3oTy7f9ON1T3dth+Y05BE8QSWghuxkTLSPOJ0ibuqBf9h1ESjqYDv1H4K7ag+/iiOC5Kk1GpBp2wahHUSLd3lzrnCVrYJFjCBGPUQvMiD8IiAH+beCqnyoT4D2xp1nsYpidrigHnRMcl557Z/Saq4nZ3BlrT3sdW6wOitdhAea4 Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 135d5509-bd38-48f6-5616-08d7830c4a80 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:11.1254 (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: 9aLdogLEVfxVkdGidZrZasyKNRTj3Dygsh4T3rMpqTxVDgXF0ek4Ievwijk4qCtwjpI3yOyn2u+7m8KTnq51vA== 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 wfx_set_pm() is now only used by sta.c. It can be declared static. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 57 ++++++++++++++++++++------------------- drivers/staging/wfx/sta.h | 1 - 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index fb45aa66fc56..eb087b9c8097 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -326,6 +326,36 @@ void wfx_configure_filter(struct ieee80211_hw *hw, } } +static 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; + + memcpy(&uapsd_flags, &wvif->uapsd_info, sizeof(uapsd_flags)); + + if (uapsd_flags != 0) + pm.pm_mode.fast_psm = 0; + + // Kernel disable PowerSave when multiple vifs are in use. In contrary, + // it is absolutly necessary to enable PowerSave for WF200 + // FIXME: only if channel vif0 != channel vif1 + if (wvif_count(wvif->wdev) > 1) { + pm.pm_mode.enter_psm = 1; + pm.pm_mode.fast_psm = 0; + } + + if (!wait_for_completion_timeout(&wvif->set_pm_mode_complete, + msecs_to_jiffies(300))) + dev_warn(wvif->wdev->dev, + "timeout while waiting of set_pm_mode_complete\n"); + return hif_set_pm(wvif, &pm); +} + int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 queue, const struct ieee80211_tx_queue_params *params) { @@ -371,33 +401,6 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, return ret; } -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; - - if (wvif->state != WFX_STATE_STA || !wvif->bss_params.aid) - return 0; - - memcpy(&uapsd_flags, &wvif->uapsd_info, sizeof(uapsd_flags)); - - if (uapsd_flags != 0) - pm.pm_mode.fast_psm = 0; - - // Kernel disable PowerSave when multiple vifs are in use. In contrary, - // it is absolutly necessary to enable PowerSave for WF200 - if (wvif_count(wvif->wdev) > 1) { - pm.pm_mode.enter_psm = 1; - pm.pm_mode.fast_psm = 0; - } - - if (!wait_for_completion_timeout(&wvif->set_pm_mode_complete, - msecs_to_jiffies(300))) - dev_warn(wvif->wdev->dev, - "timeout while waiting of set_pm_mode_complete\n"); - return hif_set_pm(wvif, &pm); -} - int wfx_set_rts_threshold(struct ieee80211_hw *hw, u32 value) { struct wfx_dev *wdev = hw->priv; diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h index 721b7cee9c10..4719807bc25a 100644 --- a/drivers/staging/wfx/sta.h +++ b/drivers/staging/wfx/sta.h @@ -97,7 +97,6 @@ void wfx_suspend_resume(struct wfx_vif *wvif, // Other Helpers void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad); void wfx_update_filtering(struct wfx_vif *wvif); -int wfx_set_pm(struct wfx_vif *wvif, const struct hif_req_set_pm_mode *arg); int wfx_fwd_probe_req(struct wfx_vif *wvif, bool enable); #endif /* WFX_STA_H */