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: 11294799 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 74A9A1580 for ; Mon, 16 Dec 2019 17:10:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4868F206EC for ; Mon, 16 Dec 2019 17:10:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="BY8747YN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727686AbfLPRGo (ORCPT ); Mon, 16 Dec 2019 12:06:44 -0500 Received: from mail-dm6nam11on2042.outbound.protection.outlook.com ([40.107.223.42]:6255 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726633AbfLPRGn (ORCPT ); Mon, 16 Dec 2019 12:06:43 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HchIrFv6vBsxQEgatq4SGm9o6uyqWOxIVf4LTIBkyiPPrm0LQbcaqkW81h3+ybgeiOMSeR1pZlXROq8Vpqjs2rdfmbLPpq4thAUZ0cbLbajzQ6Lf0diVB4P6ansylg+FJVyDZe8S2WD6Ewa8OfyAgkB/sYZ6LnRBCffgFwtlNq0aXeA8QvP3nGBr3GrrAusDqvcIklSWCzElFXKVhnqUz3BbJG9Vv3kHdApoqY9u3nHd3DQs59eA2FTkSpChXl7a932t05zwVlrqTmzOc6Wl7BXlSAR//j5vXGlXBF+ge5OtA8k4wyulA3UBAeHfBVQs9LasKjjZzN74nTeACGmf7w== 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=sAM3mAFJJtCHD7pIdZPWNHEWDJbOAllU24BIuV8QVeM=; b=fyLptE9Txjg6Osir7pjJ2qObvSxnTMDTxPxu7leaLw7nvRuWDQ5ONoTAKYWDeixx8U/EplifXJYwgMmjFtE6amXYcKoY231CmOk6rHmWJBvwxZ14F7spkqrttAF/jkDG0u0PirOj+3cd9c45wa3BH4VgUBa5wcN3Us2vphrDFjuxIkxY7uGeDK2yxRgMUer3sxwWER/x5BVH5cqXgnPoffkKVShNEvTGJbuiq8bNvMpfB54tB9QTpu+CTjBS1JcvxA6ZFliCW9SxrAQJTKXLFIx5PKE1zRIQmNyP8Q65NgCsb5uzmKhRlvIccrKEvTM03hAIPTLWzQ3yaYlW41S4hA== 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=sAM3mAFJJtCHD7pIdZPWNHEWDJbOAllU24BIuV8QVeM=; b=BY8747YNnoakCAE/jCVif/cGp1X8UTCjNH0a/9kUFt70JkcClB3xrl4tnqsKHrH4U4FJrln9XXbpzLy35xC/DCPbI8yXdwn+Q6NysrPW8ILsfc6tWV0WX/fSJDrpKew3bpE5qrRyHKAVmmhtuNKyyQ3swheQLeWvgoNgaPHJ5NY= 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:37 +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:37 +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 31/55] staging: wfx: declare wfx_set_pm() static Thread-Topic: [PATCH 31/55] staging: wfx: declare wfx_set_pm() static Thread-Index: AQHVtDLJasMxqvHr6kuD9Db82xY32A== Date: Mon, 16 Dec 2019 17:03:49 +0000 Message-ID: <20191216170302.29543-32-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: b7508d64-0773-476c-cbdd-08d7824a4fc7 x-ms-traffictypediagnostic: MN2PR11MB4445: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; 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: CE/ZNODBvQFrNwDGNfqKeyFA9BmkP7LMi3oPGxHg21SdDxdHmqSM4wMAvqNxx3aQNRCrUKrc3VByamtqPwh5U0G7QKVNYMS1Yk0S/g6RtUDO9ze/fcmby1eJKHf83n0SdPY8gmaJTppgRdnLX0FB9SvdzJyIlhUszUkCH9qIavtChywEGJ6EbUGD/6ZvthrjY03fiPX48fnn4V4YGAbt9/ZyJEmn8p1o5lV+eam8Lw+brWe9koJHeMWeXVLj/r5vKPFH75u9Re+uM8ZAFEmzWYv6s681IajyrWBH6yWCH8+ybEY1o/116E2BmBP1+iuMkgg366uAjjh5VEQYbCnjr+8ACyg1ZV0Ni3rLRidNB95uKpxCt6bZ6ZH3248sbfju22Ir8CxhkDSmU45t//7jQNRLYHQVxnCIjp237FQORHs/bBHMZOSLUwj1Rcydt1WW Content-ID: <50CBB27566C73740B1A88418F3858BF0@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: b7508d64-0773-476c-cbdd-08d7824a4fc7 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Dec 2019 17:03:49.9457 (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: sxJo2UwdrRNWg5W8hUjA6bmM95C8Pq1wLHFPyLq7pDy5XHG6C/5yZUX0LOsYx5z/10huQ13+VsJevu/CLcL7ng== 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 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 */