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: 1210662 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="QFR0TRKV"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47c76T07RKz9sRM for ; Tue, 17 Dec 2019 04:09:21 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727465AbfLPRJT (ORCPT ); Mon, 16 Dec 2019 12:09:19 -0500 Received: from mail-eopbgr690078.outbound.protection.outlook.com ([40.107.69.78]:42057 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727728AbfLPRGt (ORCPT ); Mon, 16 Dec 2019 12:06:49 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fN/6dq9TwPWQxeueS8eTdaia6z89P7b5Ycqd7+KE/pFcV+DPATVJ8ohheoZY9X7ov8PL6TPeC2stT9aAZ66i8otDnoyrGf0VpW13uvIy9a6Qi64Cmd8JIm1C8JARibqoKqJ4uLXOfww+Izc2k6cRnHHy70jVMet2vZvT7cMJLlfj4/g+gZntPU86cmupQ+n5gdgxyAxsy7tDNpCIWy2bMBgxDQPKqHI80HAcr+1gGu7R+wtHB6uMHBuLyOlLP8Ce3fIPjkBpVII3yMgqMz8jFDMcjzkkT3eJz6wPYA+Sht8rxtEOdPqh00oJRY9GBhJzne/n4uXKjCr9Buvku4plwg== 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=sM61b92OPxGmjcWr1AxMMl0z1ItLjdelNcVFZWLu2fE=; b=fEkdBcbuS588TZGyw/IGI3wZ3oOO19g/LdNkUnD+BjYWeUQ1I3L49TizWZScG+BZ+mJ/m7tqorbSudmjjRZpx3SX83HXk0NflthFtfdLmN20z76FZJEnAPLTXEctzLd8N5N4u+nK04VbjVOSLJN1B7FjBrBO9PnnwIs+6+AoZfcnnCgfFK2fTyv+TpJkFrC2Lbpx+VUaYWkulrUzls3wQW9UFk5+2YjV1uhqRUE7oMn9mcpqgYiO8yJrj/cWGm6ES0GeQO9rkjfmJxriNXFn5qkp5RrMDB77PmHT+u+kxoU+i47rZtj8S6g84cL2FiBV+AexlACUJPn0K5+hO1xO+w== 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=sM61b92OPxGmjcWr1AxMMl0z1ItLjdelNcVFZWLu2fE=; b=QFR0TRKV3G8texZJ0kgl6LkA2dJ11XzdPUaxHHwWafS2Mu/ZY4PHtCjE19uBzpCFTOddXOrawwngD2Lsr17CAR6HXbA3G5JNwHn/l4hL0mISy7+YnrZgUG4sLuSVddP7PWJsySig9CeQ8VgwHu91M8hjB0vWk1sbZkvk+mNGMWU= 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: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; Mon, 16 Dec 2019 17:06: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?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH 39/55] staging: wfx: simplify hif_set_uapsd_info() usage Thread-Topic: [PATCH 39/55] staging: wfx: simplify hif_set_uapsd_info() usage Thread-Index: AQHVtDLL7zAYEpOGhEKGtVfikRLAXw== Date: Mon, 16 Dec 2019 17:03:53 +0000 Message-ID: <20191216170302.29543-40-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: a8e30fee-336a-4eda-6909-08d7824a5292 x-ms-traffictypediagnostic: MN2PR11MB4142: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:632; 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: lK0YuHgwDNFBZqZlPSkg3ZUW9Ey0T59A/03utE37stNASEysJqvNZPsGJGx+73WFnhNuRt+uL77hzsAFrGoCuHi0F5FV46/nk31k6SdeyuPdjMDeOOSHKT1iQz09bBO72IO3dqYR2r2QKhxCNH2Zn8Mk+Y5CJJOo+NLuVqdobeKBZl1SdFj36CJ69peT2chuvGXgB95o8zRUtJXrChmj3GJKJ0yJyYYbj2a5e9JqqlAYUoTH0OPL8XJxy53r0r1QnotQeD0mCbsdQGKfWtg84IFZQgfgiRhPWvt9XbmQpA2OA5LG6nrx3tfXwsManQ0ZzgRRilsNuurQJEWSKIdfwVYPiooJ/yE1GBWNy2wtOAzZaf3Qb1kmNQSkyFih1pAD016DMz2hIcqp3dkCj+F7FsqwOFl3sMfUkThPg45hI3ld67WE9bE4W0kW3Hq5akOc Content-ID: <0CE0342D34D9A74F9CF1533D3BBA36B3@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: a8e30fee-336a-4eda-6909-08d7824a5292 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Dec 2019 17:03:53.4817 (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: h9UbzK5GZsGIMw3e+UfVjg8mpKCitlsbv/mwww6rQXvE7ma0RhSUvoFqDw/a98gk2LS2oz9CIhQ+D4w0Qd9uBg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4142 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller It is useless to keep uapsd_info in struct wfx_vif. This structure can be rebuilt just before to be sent. In add, the struct hif_mib_set_uapsd_information comes from hardware API. It is not intended to be manipulated in upper layers of the driver. So, this patch relocates the handling of this struct to hif_set_uapsd_info() (the low level function). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx_mib.h | 15 +++++++++--- drivers/staging/wfx/sta.c | 42 ++------------------------------ drivers/staging/wfx/wfx.h | 1 - 3 files changed, 14 insertions(+), 44 deletions(-) diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h index 9be74881c56c..d77765f75f10 100644 --- a/drivers/staging/wfx/hif_tx_mib.h +++ b/drivers/staging/wfx/hif_tx_mib.h @@ -238,12 +238,21 @@ static inline int hif_use_multi_tx_conf(struct wfx_dev *wdev, &arg, sizeof(arg)); } -static inline int hif_set_uapsd_info(struct wfx_vif *wvif, - struct hif_mib_set_uapsd_information *arg) +static inline int hif_set_uapsd_info(struct wfx_vif *wvif, unsigned long val) { + struct hif_mib_set_uapsd_information arg = { }; + + if (val & BIT(IEEE80211_AC_VO)) + arg.trig_voice = 1; + if (val & BIT(IEEE80211_AC_VI)) + arg.trig_video = 1; + if (val & BIT(IEEE80211_AC_BE)) + arg.trig_be = 1; + if (val & BIT(IEEE80211_AC_BK)) + arg.trig_bckgrnd = 1; return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_SET_UAPSD_INFORMATION, - arg, sizeof(*arg)); + &arg, sizeof(arg)); } static inline int hif_erp_use_protection(struct wfx_vif *wvif, bool enable) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index e59560f499ea..9eca35d91ad3 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -112,44 +112,6 @@ void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad) mutex_unlock(&wvif->bss_loss_lock); } -static int wfx_set_uapsd_param(struct wfx_vif *wvif, - const struct wfx_edca_params *arg) -{ - /* Here's the mapping AC [queue, bit] - * VO [0,3], VI [1, 2], BE [2, 1], BK [3, 0] - */ - - if (arg->uapsd_mask & BIT(IEEE80211_AC_VO)) - wvif->uapsd_info.trig_voice = 1; - else - wvif->uapsd_info.trig_voice = 0; - - if (arg->uapsd_mask & BIT(IEEE80211_AC_VI)) - wvif->uapsd_info.trig_video = 1; - else - wvif->uapsd_info.trig_video = 0; - - if (arg->uapsd_mask & BIT(IEEE80211_AC_BE)) - wvif->uapsd_info.trig_be = 1; - else - wvif->uapsd_info.trig_be = 0; - - if (arg->uapsd_mask & BIT(IEEE80211_AC_BK)) - wvif->uapsd_info.trig_bckgrnd = 1; - else - wvif->uapsd_info.trig_bckgrnd = 0; - - /* Currently pseudo U-APSD operation is not supported, so setting - * MinAutoTriggerInterval, MaxAutoTriggerInterval and - * AutoTriggerStep to 0 - */ - wvif->uapsd_info.min_auto_trigger_interval = 0; - wvif->uapsd_info.max_auto_trigger_interval = 0; - wvif->uapsd_info.auto_trigger_step = 0; - - return hif_set_uapsd_info(wvif, &wvif->uapsd_info); -} - int wfx_fwd_probe_req(struct wfx_vif *wvif, bool enable) { wvif->fwd_probe_req = enable; @@ -382,7 +344,7 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, hif_set_edca_queue_params(wvif, edca); if (wvif->vif->type == NL80211_IFTYPE_STATION) { - wfx_set_uapsd_param(wvif, &wvif->edca); + hif_set_uapsd_info(wvif, wvif->edca.uapsd_mask); if (wvif->setbssparams_done && wvif->state == WFX_STATE_STA) wfx_update_pm(wvif); } @@ -1552,7 +1514,7 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) hif_set_edca_queue_params(wvif, &wvif->edca.params[i]); } wvif->edca.uapsd_mask = 0; - wfx_set_uapsd_param(wvif, &wvif->edca); + hif_set_uapsd_info(wvif, wvif->edca.uapsd_mask); wfx_tx_policy_init(wvif); wvif = NULL; diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index c82d29764d66..ff29163436b6 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -114,7 +114,6 @@ struct wfx_vif { bool setbssparams_done; struct wfx_ht_info ht_info; struct wfx_edca_params edca; - struct hif_mib_set_uapsd_information uapsd_info; struct hif_req_set_bss_params bss_params; struct work_struct bss_params_work; struct work_struct set_cts_work;