From patchwork Tue Dec 17 16:15:25 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: 11298123 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 A23FC6C1 for ; Tue, 17 Dec 2019 16:17:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 765C924679 for ; Tue, 17 Dec 2019 16:17:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="OESGwvMH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729075AbfLQQR3 (ORCPT ); Tue, 17 Dec 2019 11:17:29 -0500 Received: from mail-bn7nam10on2081.outbound.protection.outlook.com ([40.107.92.81]:6496 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728425AbfLQQQC (ORCPT ); Tue, 17 Dec 2019 11:16:02 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bE5boxovvErH0ODBlXrQaWRdw8CyfMR+fzVTx6WoGyvSlEh3jrJwnr4rWE26VzKfwFhZk2egVR5oItTa7kiSD66UpiTbOWvPk8AE8JPtcWJGUBtNDX2yLkowHZQHkaJB8tPWY+pfD8TUcqaBOgyIsUK9E7+pVkDY68XTr8r5TeHX4A6Znb7wl+6cshJjYstwoYzYyu8zmSpuVQIDq7/fkJeq2dQep/6L3P1Sg3ZfLRkuv7u6mGchbfouqTOWsULMb8FL5DVBGlahYwaosoyTQMayqkxMunYqbEDAcoMMRbu2O/ecZclL9uAp4kOXTiZGV6V0LvrORbkk8uEl58cAoQ== 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=yVrtL/C7YQ08Pb+7fFb5TFrEB10EjfSCEs5gRYHh874=; b=G0WmCX3wE8+pa2/9f9syNjBYwbMpR3GDmkC41LD0jDNPDQb27SGw5WhsQuxTGWY0wsS9W/K26jV18bIad9kzaWep25925XK6619vraqS3dxbyooF2JaE98WIMGwpn/yWNLkFLOvSVIi3SgGKr27q+wpIh51V81p3iI84pdmL12lmw5uJo4gDHBOSpbQqChBlJlfB8m4W7BZcU3Q4GELqiJr+fWzwiuqY/hpEe3HECnQHXquHTcuT8cI/Y1zeYYqOj2G7fSKMPnZj9BX9GQGzBieqWrg/d6VS/rZfkg4ulxLtIDuZJl2bP2yZ1ApjqPxFu8XJy1s5hdsGuerHByoyvg== 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=yVrtL/C7YQ08Pb+7fFb5TFrEB10EjfSCEs5gRYHh874=; b=OESGwvMH4PKRlqLA/+SMtSbrNohc6nawg0+6UYnIiqAZ07rTztX2xnkVhMXQ1SKQKW/ilWxhxUBbuklifUvGbE/Pr4AE8FF2eNAXxlaaXR2yVBKFeytTY+hS7U2m/LNYycTxdRPAGABKywuBwW+jGG9LhZSRFnpdXqV31Mf7t60= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4208.namprd11.prod.outlook.com (52.135.36.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 16:15:46 +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:46 +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 42/55] staging: wfx: remove unnecessary EDCA initialisation Thread-Topic: [PATCH v2 42/55] staging: wfx: remove unnecessary EDCA initialisation Thread-Index: AQHVtPUwofWyj1n0J0CKAfv5Wa1qQg== Date: Tue, 17 Dec 2019 16:15:25 +0000 Message-ID: <20191217161318.31402-43-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: 894078dc-2f2f-4b01-41df-08d7830c533d x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3826; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39850400004)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(5660300002)(316002)(6506007)(85182001)(478600001)(71200400001)(2906002)(36756003)(186003)(26005)(81166006)(54906003)(1076003)(110136005)(66574012)(4326008)(8676002)(86362001)(6486002)(6666004)(52116002)(6512007)(64756008)(85202003)(66946007)(66476007)(66446008)(66556008)(8936002)(107886003)(2616005)(81156014);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB4208;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: 0fCiDJgmx5zzbEnBnq2Kvyj8ExDn9Oa1DRk38KLe1uBENizebxcnsm8OhMlV1TFIcb+FqOac/9KffFrsQArNc0drz6tS5Mgpl5FTRH7e22uhA9I1McI+N9nUcX/ToMbm64K269m7X9zsJheO5BHAOrtclrcHA+Zc1Erj5haHHzmMmrlQuDTo1Dx1kK5jYGmSIt2BJW105TR7J+/euri9U2hHm4A3q6oaSeRZ93xzyZoLenm9gfvUsa07yDpQP8knnAwTh4yvNUvPZwpPvBQjcWxOl3yx4jqE8JtxaF89ZUAEmSHGKarOeCQjub7CO8Sv4Xyw4NU5Az3n9bwaGABL5uS6aVa99EE2v3sL8HI527PilNxO+vzazvBxIXrzl1eYxpwPhJqDUcZjwFNJY0Wha/CFFAou3fxpWR6Ui+NHdNsOhkra5C2StzIWj9eUsKhf Content-ID: <3543C5DE4DCAD14E889C8E83B82B40CE@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 894078dc-2f2f-4b01-41df-08d7830c533d X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:25.7892 (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: p5Ul3sNca4OBBGhl8L/QWzPIcIkisU+Vr5NaSPVHDtiLfiF5yxDErA07MKOcWgJTpxCCfIGuDkeIxhemWrACJA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4208 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;