From patchwork Mon Dec 16 17:03:51 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: 11294789 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 D4A86930 for ; Mon, 16 Dec 2019 17:09:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A80B920409 for ; Mon, 16 Dec 2019 17:09:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="eSk5GKLZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727498AbfLPRJi (ORCPT ); Mon, 16 Dec 2019 12:09:38 -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 S1727705AbfLPRGp (ORCPT ); Mon, 16 Dec 2019 12:06:45 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OyToRqsvJ0mO1zLNEGJ9YDihHlF/dofJX9mtIXpYaKPPyjSG9/WoS9mRTYlndNE3glPTCL22KB7GaLUx3T2KmifV5mDQAhToOS9DkV18OEcuh+3psnbl3KuxNb34+ep18G/hR17I4R4O1vwbFjuNDKJFliInrdMaDj3cgomfX88DKL62+1poIY6x5tNz1RYLSG23Bm5m4q0hy9mI9aD9w/GrtRzby8IWxCI6TasRe9Hm5kTGhiYSS5O6wtIKqsVGnV9hKk/CKp4beihWGvcRWI71o+zBA6KYg0TeXv1JRY4JPBEBoELra2tE0MAmyNa2XiPqWN3CsFhg7OymOkDPbQ== 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=mOrtuj4VlXMf1xp2QzAouYxSpvBozQBdisreXuMUcD8=; b=Hw35Ppm/jm7781j94inryacjcOSO3ltPB1fSYOS5jRzWDR/ihQ7M4Evc3QRmu4XiTE8qWQjsh0u8QmNi7mvUsu771EIqYbItpwsweg3C8BuVsJDT9poEw1HXShrx2HLw68nZv93xK7dn7zt6TXCOv2pbV/G5ffAUQGmsgSyTiY5jI++E0feM88pq90qU2QeJrs4I3HXirRk2r4chyOI+fm/+EFKL/w7mfBtpj60DN+TB8Ffihb6n5Q7ngECXrf4TV7hAi69AxHAGFzbbxJl4uHkrQys0rnXOtHRF8ODuy1wl0HKbdpplEG0ClI/E9ivzKFxjEtE0H6VZbjtcjiCDqg== 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=mOrtuj4VlXMf1xp2QzAouYxSpvBozQBdisreXuMUcD8=; b=eSk5GKLZKcjhd+bsaWkeQYpzNBBIbRTDI/xRkIp9y85cyE2BMRe5qsMtE3jFZQ/6KTCqOjJ10mAtedI/3iYQAgE5puaZGkXfFXYkCxNVSJz/MpSjzil0hSZ3jV8m8IMZq+Vq5nyyh+FictM1JfuXnjPBzWrNbu/0FIxhS3B+n9o= 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:39 +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: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 34/55] staging: wfx: drop unnecessary wvif->powersave_mode Thread-Topic: [PATCH 34/55] staging: wfx: drop unnecessary wvif->powersave_mode Thread-Index: AQHVtDLKkqdqwCIbrEugcQVHs4thZg== Date: Mon, 16 Dec 2019 17:03:51 +0000 Message-ID: <20191216170302.29543-35-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: a1155479-e9f5-4d2e-a411-08d7824a50c4 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: orpwBmdBcx56h0OlnKXzvtfyWmuC2PsszjWOC2QgqD4Jw2RvSLWIdNyUX0y51bctiYPsU6Lde/MUtv6NMykKaDEmGsELYY20MwxFcTUajtQy293TVC4xfZg94ttdQEeA8vN6VL5ErEIG2Uk1KYh7Yx4gREfIr6CJkjIVEInYlNVMrLxO4RuIQyaRtuNzo425EeriueEsYqr4/kmiaVhGFy2jJeyGzCHMkXUjpLi6+iBnuro8K6LSTeZetyyu0AtsF4Hf/hNWIP/6sBLnqAzoaWCj7iJsiLNT1IfyUcM/WHpTZDg8E67sDtoM1+psAhCZlLOVGwwr0wt6ZXtlNE8/X+m6khDnskVasq6gLTcSz6N6lY1eFtIrZAVcU7Qb4aBl9zEzoVxqO9SE4fm152omBO5zeNoRmAw3e5L2FveORCwwQszEJiQyAzFvpBrFfJkk Content-ID: <6D1ABF81FE8E2D44AD5E81D6D53A0300@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: a1155479-e9f5-4d2e-a411-08d7824a50c4 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Dec 2019 17:03:51.2609 (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: HV61oqu1AF1SvTJ0FqVSoj1x11s6Gxn4/7OfkUqrDcAhpNNlkK4VAPrML8XuTmEBKKvgeIDdlFBxpEdfVzPB0Q== 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 Power save status is already available in bss_conf. So there is no reason to keep information duplicated in wvif->powersave_mode. In add, type of wvif->powersave_mode is low level struct made to communicate with device. We would like to limit usage of this kind of struct in upper layers of the driver. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 31 +++++++++++++------------------ drivers/staging/wfx/wfx.h | 1 - 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 91fa4d8aa37d..c57135f77572 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -328,12 +328,23 @@ void wfx_configure_filter(struct ieee80211_hw *hw, static int wfx_update_pm(struct wfx_vif *wvif) { - struct hif_req_set_pm_mode pm = wvif->powersave_mode; + struct ieee80211_conf *conf = &wvif->wdev->hw->conf; + struct hif_req_set_pm_mode pm; u16 uapsd_flags; if (wvif->state != WFX_STATE_STA || !wvif->bss_params.aid) return 0; + memset(&pm, 0, sizeof(pm)); + if (conf->flags & IEEE80211_CONF_PS) { + pm.pm_mode.enter_psm = 1; + // Firmware does not support more than 128ms + pm.fast_psm_idle_period = + min(conf->dynamic_ps_timeout * 2, 255); + if (pm.fast_psm_idle_period) + pm.pm_mode.fast_psm = 1; + } + memcpy(&uapsd_flags, &wvif->uapsd_info, sizeof(uapsd_flags)); if (uapsd_flags != 0) @@ -1432,24 +1443,8 @@ int wfx_config(struct ieee80211_hw *hw, u32 changed) if (changed & IEEE80211_CONF_CHANGE_PS) { wvif = NULL; - while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { - memset(&wvif->powersave_mode, 0, - sizeof(wvif->powersave_mode)); - if (conf->flags & IEEE80211_CONF_PS) { - wvif->powersave_mode.pm_mode.enter_psm = 1; - if (conf->dynamic_ps_timeout > 0) { - wvif->powersave_mode.pm_mode.fast_psm = 1; - /* - * Firmware does not support more than - * 128ms - */ - wvif->powersave_mode.fast_psm_idle_period = - min(conf->dynamic_ps_timeout * - 2, 255); - } - } + while ((wvif = wvif_iterate(wdev, wvif)) != NULL) wfx_update_pm(wvif); - } wvif = wdev_to_wvif(wdev, 0); } diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 781a8c8ba982..c82d29764d66 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -125,7 +125,6 @@ struct wfx_vif { struct wfx_scan scan; - struct hif_req_set_pm_mode powersave_mode; struct completion set_pm_mode_complete; struct list_head event_queue;