From patchwork Mon Dec 16 17:03:55 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: 11294775 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 85516930 for ; Mon, 16 Dec 2019 17:08:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 590C0206D7 for ; Mon, 16 Dec 2019 17:08: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="C077mM50" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727869AbfLPRIl (ORCPT ); Mon, 16 Dec 2019 12:08:41 -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 S1727826AbfLPRG5 (ORCPT ); Mon, 16 Dec 2019 12:06:57 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UgvRqzaFASGekgzVXx7DzEro/KYxv6uBTUp62k3WWV+HaIdf5yTrRPTv+kXoKMlo+xckn/ANTPjY0KAM9LOYgra/RWDwTtW3gTuLVJ7PHHIgsB/7YPdB3XHEWgh1BrU3oQb3wCJvRTkRYWbUGsYajOI8WQDknpPZ2JZUZpP5AsCVidrrt4TbX9m71soPVSfGkwCPIO8ySiZ2irXByC6FKCvRlOTrvOu8ufDywV4ynV2GnI2EJI6qiFld+zhkyAI7wYR0YMNijYbf9YAJYoeU2yRpThct+5iq9PxIARwfHe0f7U+zHbs4cDucZmbQ9bH9j047tGGUBMNs2lHkweKU3A== 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=e0aQ6MJkeUQsgBZxdMQAUiaKgOPGbRtQxZj8GK9qEH4=; b=g3FMc35fkG4mCRbc7xmud0KMkCsfAiKWgB/3ctwC2SZTRRSRptcLTicIeiOGFBSD4nyJIN/yQPLh2IoKDeVTQjIfuYiyA4AgFykeHm9BR489d5nCmx78Nu+Ox4ONZkerlwzup6Q4tNi4UJVxJKVSTDdZqOjv+sz9r+89iOVXiC8E33QLgrD9uAR+PWLs6vovq+nwElq5y9QTTG4tYPaxtueTvUazZlTP/S93jTh848UOFIKQr7aOy3gEM546Aw1fiaxode9cAEQbZySA9xUpwvJ9fQDQXFk8jRBYBQTthPqEeRpefzqf/mqbAXWUKd1SpFc9Cy941rRNijAL8DT3ww== 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=e0aQ6MJkeUQsgBZxdMQAUiaKgOPGbRtQxZj8GK9qEH4=; b=C077mM50J/OmRvCJr6R+01HpaQ5Q8uMp7UcySFYH6kanheZytFNYraY4uIqwESznbnfGxpQEeCy2senMc3Hub7TmbCj56KQakXNj0mlzVcfwmETz45+qd480Bh8wKVR1Ti4OQpWx6lgOGyf4ZeKewZf/kKZ536LpjQ7fASPIFXI= 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:43 +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:43 +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 42/55] staging: wfx: remove unnecessary EDCA initialisation Thread-Topic: [PATCH 42/55] staging: wfx: remove unnecessary EDCA initialisation Thread-Index: AQHVtDLM2AMC7rqmkU+zq7P13kpdcQ== Date: Mon, 16 Dec 2019 17:03:55 +0000 Message-ID: <20191216170302.29543-43-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: 68b42b89-529d-4730-00ab-08d7824a5389 x-ms-traffictypediagnostic: MN2PR11MB4142: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3826; 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: Q0nwZjD1pHnDQ1O2wN8uChfTjq8cJE/e1gD+sj4c+12k/yTBPzb3hrCYFq2N594dDeRKK2ddVfRI9BFGgIgeRIJzML+LBfA/WN0j2Tv3DXlZY2ynOM/nZpqbQvkHHH8QFvG1vG4oD1JYmV41Gnswk0ULcLzTV8FX6eNlJ5xN3ejqTpkk15oxBDj0RCgbt4/+roFepFUtm8NYCjzTLWFt3vLCzQeZxNaz5ItuC7NOFWlBFGohXkWgeP8vlf3Hk6r6ugttdGGi6x74U/kucS4jmw7p7Nfw+hXw2rXPaJnRkP8ZkHoD20JoYumtRujSozS+hrTiiYDSiGQHK7twMBJdSBt6fQybvWYiUWlHzfPzJlxMQUtI67UmS1WLrchDuWgNt5O6rSwW/DLHcNXXB9T9W88VM6TV2zMVEnRG/Tx9UC7gmH769xUnx9+4BDfSo8d4 Content-ID: <10D85AE184CBFE44B9EEE3BA7D93B6F4@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 68b42b89-529d-4730-00ab-08d7824a5389 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Dec 2019 17:03:55.2167 (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: myY/3qeepcom23OJ8EKxqXyX9Ub4U564yE4KCcDJ41vg1vc4F/d7SpVwAYjYVL9AABb1d+XXH3XanxsZTZrbLQ== 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 mac80211 already call wfx_conf_tx() on every VIF instanciation. So, the driver does not need to do it. Note that current code did dirty things with wvif->edca_params. This struct was initialized, but only 'queue_id' was really used. The other members are only used to store temporary values. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 51 +++++---------------------------------- 1 file changed, 6 insertions(+), 45 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index d52f618062a6..3504b6b3515e 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -334,6 +334,12 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, edca->cw_max = params->cw_max; edca->tx_op_limit = params->txop * TXOP_UNIT; edca->allowed_medium_time = 0; + edca->queue_id = 3 - queue; + // API 2.0 has changed queue IDs values + if (wfx_api_older_than(wdev, 2, 0) && queue == IEEE80211_AC_BE) + edca->queue_id = HIF_QUEUE_ID_BACKGROUND; + if (wfx_api_older_than(wdev, 2, 0) && queue == IEEE80211_AC_BK) + edca->queue_id = HIF_QUEUE_ID_BESTEFFORT; hif_set_edca_queue_params(wvif, edca); if (wvif->vif->type == NL80211_IFTYPE_STATION) { @@ -1393,44 +1399,6 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) int i; struct wfx_dev *wdev = hw->priv; struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv; - // FIXME: parameters are set by kernel juste after interface_add. - // Keep struct hif_req_edca_queue_params blank? - struct hif_req_edca_queue_params default_edca_params[] = { - [IEEE80211_AC_VO] = { - .queue_id = HIF_QUEUE_ID_VOICE, - .aifsn = 2, - .cw_min = 3, - .cw_max = 7, - .tx_op_limit = TXOP_UNIT * 47, - }, - [IEEE80211_AC_VI] = { - .queue_id = HIF_QUEUE_ID_VIDEO, - .aifsn = 2, - .cw_min = 7, - .cw_max = 15, - .tx_op_limit = TXOP_UNIT * 94, - }, - [IEEE80211_AC_BE] = { - .queue_id = HIF_QUEUE_ID_BESTEFFORT, - .aifsn = 3, - .cw_min = 15, - .cw_max = 1023, - .tx_op_limit = TXOP_UNIT * 0, - }, - [IEEE80211_AC_BK] = { - .queue_id = HIF_QUEUE_ID_BACKGROUND, - .aifsn = 7, - .cw_min = 15, - .cw_max = 1023, - .tx_op_limit = TXOP_UNIT * 0, - }, - }; - - BUILD_BUG_ON(ARRAY_SIZE(default_edca_params) != ARRAY_SIZE(wvif->edca_params)); - if (wfx_api_older_than(wdev, 2, 0)) { - default_edca_params[IEEE80211_AC_BE].queue_id = HIF_QUEUE_ID_BACKGROUND; - default_edca_params[IEEE80211_AC_BK].queue_id = HIF_QUEUE_ID_BESTEFFORT; - } vif->driver_flags |= IEEE80211_VIF_BEACON_FILTER | IEEE80211_VIF_SUPPORTS_UAPSD | @@ -1501,13 +1469,6 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) mutex_unlock(&wdev->conf_mutex); hif_set_macaddr(wvif, vif->addr); - for (i = 0; i < IEEE80211_NUM_ACS; i++) { - memcpy(&wvif->edca_params[i], &default_edca_params[i], - sizeof(default_edca_params[i])); - hif_set_edca_queue_params(wvif, &wvif->edca_params[i]); - } - wvif->uapsd_mask = 0; - hif_set_uapsd_info(wvif, wvif->uapsd_mask); wfx_tx_policy_init(wvif); wvif = NULL;