From patchwork Mon Dec 16 17:03:53 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: 11294755 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 E3DA5930 for ; Mon, 16 Dec 2019 17:07:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AA731206D7 for ; Mon, 16 Dec 2019 17:07:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="BcbBJ1wT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727555AbfLPRHi (ORCPT ); Mon, 16 Dec 2019 12:07:38 -0500 Received: from mail-eopbgr690046.outbound.protection.outlook.com ([40.107.69.46]:24384 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727700AbfLPRHh (ORCPT ); Mon, 16 Dec 2019 12:07:37 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fy9x5Jpm/aekL+mwATz5dcIdto09J0Vlb/2bwTewX6g9MSf5pYBnWrjWhayFkUEzBfpg5wps0aYBeZQrPzQZVpFRoORXqJzjE5kLU27KPF/8ZSoz/VUhmZWqgOUlNRhG58c+vu1XI0S18YjIrTHRMP730bzy+JZj+J11k/K0nCyUZNc6Spg1wh/jKybN6bMb/dtIEHQqRVd/7mg7RU8JqOMbzzVsz6PfbYpNY456+7c+GNIat7JVMhWVlUPWDl2u5gQCHsx7HTwpIiMleqN7UID1O/PLITIMWEgC9HzB0ignLXRxKTLelpriqKUNOcGWMXTtpCPbsEEPD1lc7Mr1tg== 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=m9A9zpFh+K27vg4ccCl/RIyP5HQhaCCjH9mzbuVqpUM=; b=S33r2+06UmSiD7TRB3zpskjxn1FGNN8k0p6eRZmcdhYKMkl+nO/2nrOsnXPlYin/FGfJt2DWHsAyCrOfvKiUChk2ShP/93IOEgfc0ctwrHIC46fIleVdSR0vBBCq1U79djHXlBFklzOi88duvdFq2IZ8LBItnFVgo+0z/TRcOb3kC7lzannHhGIeJ/Exba1LEmMkFzf+BrYHXjjbsPDWuliBCP2AoTGvslfsOdIPFcK0HnvuSU+A4q7rc0rvNhtckaWzmG0rFJTscWsv6TM/dTH4HPBquK6sv2z+Mdr4iU7he+vfivlqUtPHLun3i3CcinLOT8mlJ/3EQLR7TmjwJA== 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=m9A9zpFh+K27vg4ccCl/RIyP5HQhaCCjH9mzbuVqpUM=; b=BcbBJ1wTObku8xs77lbgeCaHRCRT6oneWavPLp89UZGvR6Y5Mq9ZNvpb1GwCyh+CpH6sZX3vkj5ugGYV7s2DgUD+zzcRntu139D4vgXaZmRL+ChfBnJ21VPhsuzocPBl5iI+N9ZYjuLmGtSiWMxVUmVx32YHJDmqFaVyfsrfX1c= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4142.namprd11.prod.outlook.com (20.179.149.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.15; Mon, 16 Dec 2019 17:06:41 +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:41 +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 38/55] staging: wfx: prefer a bitmask instead of an array of boolean Thread-Topic: [PATCH 38/55] staging: wfx: prefer a bitmask instead of an array of boolean Thread-Index: AQHVtDLLrE8YN2iofkmCN8416toKYA== Date: Mon, 16 Dec 2019 17:03:53 +0000 Message-ID: <20191216170302.29543-39-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: a7348c68-6fcb-4ba6-2e52-08d7824a523b x-ms-traffictypediagnostic: MN2PR11MB4142: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1060; x-forefront-prvs: 02530BD3AA x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(396003)(346002)(136003)(376002)(39850400004)(199004)(189003)(6512007)(71200400001)(91956017)(6486002)(8676002)(2906002)(54906003)(81166006)(81156014)(186003)(76116006)(478600001)(36756003)(85182001)(85202003)(6666004)(66556008)(66476007)(66446008)(64756008)(1076003)(66574012)(316002)(2616005)(4326008)(6506007)(26005)(8936002)(110136005)(5660300002)(107886003)(66946007)(86362001);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB4142;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: Mx9QREP1nyt71f4b3nwz0Slv6+YdlNMH7f3vzkbKAqeLngi4m5gS+6v3cfRP+wwrsK99WlP1572OCj0Gl0eJvImuBZYWitYz+xS97DU3fJLQ9Z3zyfDHvBZGBN1oy4+wVnGYv8JHadTauTe3zIwtI8pa0IrBvmRBveoBl/swBb7+8w3TTYSW0lU7KXH7m5gPsQO0qB0ErR0EEuw27vIXMpx1Q5IC8K67pJSH7hnrtfxeXFPpRxG2cYlWNltSsGB7XOJgZj2OHAB3gMmfKZeR94Y4avIqB8V3s7BY3nwsFnD6roBTYUFWa3orOdo38K1Bd/+Pdp+5vHHMMfoQz9ExCME52nTfSTkFsd1yHBS8u2C4YE7XdDZ8SQZtfDjJIafvErGRhRNTNOq/O/dnczKV8WrB9aZC9GW4QCc8rhoCTC+jA6RejOWF2Tu9fpCw9WfX Content-ID: <25463E47C800924BBD304B8C1DFBD716@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: a7348c68-6fcb-4ba6-2e52-08d7824a523b X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Dec 2019 17:03:53.0089 (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: Klg72da8VaNNc8yl7Cnk1sy7ZO2jopGjP2XzbQu4xoRBHHS/j9z3Qa5xomwIbbuILwUHeMavAukEy+/tJrVHCg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4142 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller It is easier to manipulate a int than an array of booleans. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 17 +++++++---------- drivers/staging/wfx/sta.h | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 045d3916ada8..e59560f499ea 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -119,22 +119,22 @@ static int wfx_set_uapsd_param(struct wfx_vif *wvif, * VO [0,3], VI [1, 2], BE [2, 1], BK [3, 0] */ - if (arg->uapsd_enable[IEEE80211_AC_VO]) + if (arg->uapsd_mask & BIT(IEEE80211_AC_VO)) wvif->uapsd_info.trig_voice = 1; else wvif->uapsd_info.trig_voice = 0; - if (arg->uapsd_enable[IEEE80211_AC_VI]) + if (arg->uapsd_mask & BIT(IEEE80211_AC_VI)) wvif->uapsd_info.trig_video = 1; else wvif->uapsd_info.trig_video = 0; - if (arg->uapsd_enable[IEEE80211_AC_BE]) + if (arg->uapsd_mask & BIT(IEEE80211_AC_BE)) wvif->uapsd_info.trig_be = 1; else wvif->uapsd_info.trig_be = 0; - if (arg->uapsd_enable[IEEE80211_AC_BK]) + if (arg->uapsd_mask & BIT(IEEE80211_AC_BK)) wvif->uapsd_info.trig_bckgrnd = 1; else wvif->uapsd_info.trig_bckgrnd = 0; @@ -330,7 +330,6 @@ static int wfx_update_pm(struct wfx_vif *wvif) { 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; @@ -345,9 +344,7 @@ static int wfx_update_pm(struct wfx_vif *wvif) pm.pm_mode.fast_psm = 1; } - memcpy(&uapsd_flags, &wvif->uapsd_info, sizeof(uapsd_flags)); - - if (uapsd_flags != 0) + if (wvif->edca.uapsd_mask) pm.pm_mode.fast_psm = 0; // Kernel disable PowerSave when multiple vifs are in use. In contrary, @@ -375,7 +372,7 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, WARN_ON(queue >= hw->queues); mutex_lock(&wdev->conf_mutex); - wvif->edca.uapsd_enable[queue] = params->uapsd; + assign_bit(queue, &wvif->edca.uapsd_mask, params->uapsd); edca = &wvif->edca.params[queue]; edca->aifsn = params->aifs; edca->cw_min = params->cw_min; @@ -1552,9 +1549,9 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) for (i = 0; i < IEEE80211_NUM_ACS; i++) { memcpy(&wvif->edca.params[i], &default_edca_params[i], sizeof(default_edca_params[i])); - wvif->edca.uapsd_enable[i] = false; hif_set_edca_queue_params(wvif, &wvif->edca.params[i]); } + wvif->edca.uapsd_mask = 0; wfx_set_uapsd_param(wvif, &wvif->edca); wfx_tx_policy_init(wvif); diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h index 4719807bc25a..74755f6fa030 100644 --- a/drivers/staging/wfx/sta.h +++ b/drivers/staging/wfx/sta.h @@ -37,7 +37,7 @@ struct wfx_hif_event { struct wfx_edca_params { /* NOTE: index is a linux queue id. */ struct hif_req_edca_queue_params params[IEEE80211_NUM_ACS]; - bool uapsd_enable[IEEE80211_NUM_ACS]; + unsigned long uapsd_mask; }; struct wfx_grp_addr_table {