From patchwork Tue Dec 17 16:15:15 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: 11298155 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 ADDB66C1 for ; Tue, 17 Dec 2019 16:18:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 80DE921835 for ; Tue, 17 Dec 2019 16:18:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="ebzYkDlc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728973AbfLQQPq (ORCPT ); Tue, 17 Dec 2019 11:15:46 -0500 Received: from mail-dm6nam12on2071.outbound.protection.outlook.com ([40.107.243.71]:6540 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728959AbfLQQPq (ORCPT ); Tue, 17 Dec 2019 11:15:46 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WTpJKJ5kzI+DEwLrlOHtXew5NG1tCkkGgHbsBeRHU0PDSuC1bXiOh1y2B79+GZD5hYOTXJ2m80gFxJxkGOXXJOHvkTHmHYqQjtlt+Dtmh7TCb7WkHBDopxgSrqBl4405pc2Hyf0UrAhfPTFok6EYKw+zQDJFh05FwvKGNyyD1n7XF40zoWCe0psXFrHQnpsHgeFomqSp/OVQ4nyPRksA2+1EHyYTrhLNlRRYfEXKs5ydkONj0F2SMzWXvQtL+9KRa/SYceiaQNd1IXZ40QB9nwl60VBhPyfKZ3xZyVuDu/xiafLyiT0yZIe74ZsgMvrnbelD3znhUf0AmMPfCqTZFw== 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=Eufy3zFzbX1vAfWm/2yW+tV5AIgispF9pG/MHD3WeCY=; b=obpte9sksxVL8PyWi+96Ds2VTJtZ3WE9lPnNTmO2pYpuoqkDSLDWJVM8GTrnsRUnSDH8Oo3lLUBd7ol+dJaKFidVnaQ6LqY433Gqw3Vq0xaI6vC77kqgZnnOD/+i7P4xZNmURbMG1OOgYahko8OW7tAmrrOYIWyWYZtJPEXKVc2ECOtyppJETjXPdsch4XZv73tC7vSUdoAYTse5ipfzC0gZP9i4L5mrfXV8g6hwxa1x86mxBmJSHW3KT6mRzg8zoeX6iIHXuJjmLXdFuJNsHQ6IvY9kFoAlvqjjG6bas8gIrlmsfPae9uumYa2QzbJc2/zeMp8D9XYQzPv1iplmqQ== 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=Eufy3zFzbX1vAfWm/2yW+tV5AIgispF9pG/MHD3WeCY=; b=ebzYkDlcnf49ZLbKLUEWVe2NfqUXRmsyQoBYRlT4D1QNJNH7fGWSP6EwGhGfK90KlG/gmZ++ASrIscvXFNqCNtlG4RWwIJXldkPnUb1Go0Ire5Ee2+xFAru5yTigOaUDvXUsm8qRA+okuMfvMvsGESFeAELFlzXmevTVKp1+h1M= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4477.namprd11.prod.outlook.com (52.135.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.17; Tue, 17 Dec 2019 16:15:42 +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:42 +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 34/55] staging: wfx: drop unnecessary wvif->powersave_mode Thread-Topic: [PATCH v2 34/55] staging: wfx: drop unnecessary wvif->powersave_mode Thread-Index: AQHVtPUqxAmwZ667vkKtQS/hW9fDrg== Date: Tue, 17 Dec 2019 16:15:15 +0000 Message-ID: <20191217161318.31402-35-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: 9917fdf6-7661-43e3-604c-08d7830c4d02 x-ms-traffictypediagnostic: MN2PR11MB4477: 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)(376002)(346002)(396003)(136003)(366004)(39860400002)(199004)(189003)(1076003)(66574012)(186003)(107886003)(8676002)(6506007)(86362001)(478600001)(85182001)(5660300002)(81156014)(26005)(4326008)(6486002)(8936002)(316002)(110136005)(54906003)(64756008)(66446008)(66946007)(2616005)(66556008)(66476007)(85202003)(36756003)(6512007)(2906002)(52116002)(6666004)(71200400001)(81166006);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB4477;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: cTRlm+8G7iPKwnVrZkuevw4O/HrlLX4B2PiujFe+5kfy0XkwXGGReLJLSLzDhWiQAIXhMQbSlw7NmKWwbAafhB1JsmSJktOqY1CIgEyFv8hNRNTyVJNmVVGvE/IF33Y+LlKsuIVSbANXleqVRuI83n5K3sbVfE9WUEaJmYnb96t5VMo6pZ8Ou9qzITwvcWl+uksKNZmPNcD/FqAIS76zxpGmBbVDCNPNAdgFA4uV97lex1hTc5L405ML0U61/G5eMRHlAbE4e9pgowGNn6jYDOK98dtBkJl9aplhVwmees/nLrFJ8QVodrshQV3Ipejisu01Mzu83lg0omsXjGxgHpmKXgQpOmLUFo/pnr908QsmD+7ddyY7kXlm+Bc6XpPSH5JPmHlprMLup/aiQNtyHouK4r71Xdezl2dqtaoxDpK1rlTydkD4i4YBJggZW2fs Content-ID: <65266D1356439E4590E55DD1E0AE537C@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9917fdf6-7661-43e3-604c-08d7830c4d02 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:15.2551 (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: PpdKwURKeYetdX13dMc7Rh0i90wMKuBTYgOAeuynI2RGAj9x6Tbx0vtVhc+a4cdnxymwCHW5XIzpBtDSymytNg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4477 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;