From patchwork Mon Sep 13 13:01:46 2021 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: 511481 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7AB6FC433EF for ; Mon, 13 Sep 2021 13:06:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 63A086101B for ; Mon, 13 Sep 2021 13:06:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239312AbhIMNIF (ORCPT ); Mon, 13 Sep 2021 09:08:05 -0400 Received: from mail-mw2nam12on2056.outbound.protection.outlook.com ([40.107.244.56]:27422 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239584AbhIMNFV (ORCPT ); Mon, 13 Sep 2021 09:05:21 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VwYuzr1zmhvN7IdWRD4ShyJ0dk+EjwT55EnLrmsrM9uoGcC173JtA9T0NFvtloWe3/B//YCzYfW1AAdZ9c+ozRo9KS1eHp98Az7aSbeXGUx3IX7daPGh8PwSAjEqN27slx8/KucNRe+/PtHS0RHngcGO9QEpiwTzJlUy36naCEHlHtchEGaa6NQK3N2gx8gNaW3poS4AH4/PKqGOr47eqZoZ+WeDNvdUsQ8PByHnC5YMR0CI1jVtPFZJ1VJXl/9EZU8Jn8EzBYmSemP9cFM/IRp09LFlbEnLCpa70z0sdwaUgBmifBE/GY5NWBqsEKnI7acD/aiDItRkcQfw3ywRwQ== 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; bh=RWqshuUJt4MwYDZxaRfz3PfeusUa7v9Ig5zzMvV5bCw=; b=OCKhJFCiMFYPBjASNMbn0N0Jp8eT+mDuf4LqZCK2J2bSv3cvLMcSn0uZmDm5kyDnmJY60wpuP4L2KuhSK21qVd8erK2sC/JHbQRIuUfy5jdLnD8vSfQ2PLTP4hPGOlh3/BycnTtz42307LaqF07n+/Ua8+1Ttt5SrDvL3iSuWWCqKS1jm8OFp9OxXvLBhvEbXvaefAHk+Bqw5/yc/06A/fNfbKQElnFvTSplpquLjm78ZS/rnQU/+1IsH4RP91DPP9DlfAVIn3BaYGZodelyiMtiftjMgarmTrFVTnxw/lngtfV5EkqPNjkatD8bGbKQS4Wv26/Lxc89Soi5JGh8TQ== 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=RWqshuUJt4MwYDZxaRfz3PfeusUa7v9Ig5zzMvV5bCw=; b=K8m1NKXEZAyqqXDOGn6VGIMljRDIYqJoM+yp1KJ+PPLHc5X+zZ4LJYT8UUArs1MRKwrsJrFt/rn7+mcq31KB2Bqta9OAfvw56DdExYuUzU3tQ3s8M7DXsZbJLmLwnEDJJSQ0R0DMvPoUStOdjyF1cu5tB8xkOToC8/nA/0Xu0Eg= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none; driverdev.osuosl.org; dmarc=none action=none header.from=silabs.com; Received: from SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) by SA2PR11MB4860.namprd11.prod.outlook.com (2603:10b6:806:11b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Mon, 13 Sep 2021 13:02:45 +0000 Received: from SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::7050:a0a:415:2ccd]) by SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::7050:a0a:415:2ccd%7]) with mapi id 15.20.4500.017; Mon, 13 Sep 2021 13:02:45 +0000 From: Jerome Pouiller 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 v3 15/32] staging: wfx: fix misleading 'rate_id' usage Date: Mon, 13 Sep 2021 15:01:46 +0200 Message-Id: <20210913130203.1903622-16-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913130203.1903622-1-Jerome.Pouiller@silabs.com> References: <20210913130203.1903622-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR2P264CA0021.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::33) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 Received: from pc-42.silabs.com (37.71.187.125) by PR2P264CA0021.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Mon, 13 Sep 2021 13:02:43 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 97a2113f-a959-4011-a7ca-08d976b6c742 X-MS-TrafficTypeDiagnostic: SA2PR11MB4860: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3044; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gdMPTenJ7ROZ6DxZtfrlZqwMK6JMU6rBRUQvegAmMzgMV+1yT8JCT0O7NXAUk3linGL3VRL/yeiA+uTjeT7Dhg9RE+cEEg+OZlUElfhAZxdXL8Ogy2QhPcyIHNd3tGRke8sHu1eifzOxdIXBY6T1vSyUEWsH5JoDmCtRfrx33k9VSYuWa4n0vQhdTg3O+CiOO4AWz1MfQpiuxcyfhpwWWCKY0dBtfRDTtwzelQnVwytvQjPwkH+6q7aEq/uDIFDw2LAMYMaRgpQwQTuK6hIQFJnBga7vCkstnWNKV9eTTdrUZydhy4r8BwGM462mMf0ISqE7Pc58LsUWHG/tCHOQHdjp05u8+MdBgYiWy7FqdKxIjvaVc3ozImbgMs1rQMJVGmkVUB7C7KDlEwKVc+arCr21CW2Kgy8RTNQKx4I+MyALmX5mDCEltCHlgXouu4twThs2KVpteYb5Asg3zwqRPqX3JYWPW9xhFnOchxQMb5FGbpEud7Yydfuh0LMTULssI18hmDdf2fRSunuXYQ9iDfI0jyH5yoRFgTNeXFaWk68RQ5oTgI4ULp+H6Eh3GnYQ5RFatXTx02eViV3UaFBWuPoOKagVRBxGeP3RjYXZjViQIXko0FJrv7OzN27EfX7xFDEPM2e2R9RhLKV6sBvqkpex2xrE7TAiQDVRuRtF8+t0Z0kXiwSMrv/gr5ezzxXFL4tSEEeea+s3uikUe2MsQg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB2718.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(956004)(66574015)(66946007)(2616005)(26005)(36756003)(38100700002)(38350700002)(316002)(4326008)(107886003)(7696005)(54906003)(5660300002)(52116002)(66556008)(1076003)(66476007)(6486002)(508600001)(8936002)(83380400001)(86362001)(2906002)(8676002)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?4Hbre91rzbirOQuNy7OJ5pekE?= =?utf-8?q?8my+InH941hZdWlYLPDAyy+5tGOPvw1VvC3ViO8AlzXqbh6gHLM9pXSy?= =?utf-8?q?f6G0s+9tA2DGz81EexRybeGXGgg//9UdTfsoJMIRGSqGOUbOiZl0YEm2?= =?utf-8?q?PV70i99RIbm640Jci94+LxoI/DPiTUGlusqQUfosxbL8rb4nvOdEfT9Y?= =?utf-8?q?LZkR/VEMQxb7xDLtEu2IfLF205dq5ka2FFH1DYk0h2FOwCNIpWpi9OTA?= =?utf-8?q?Kqce8gFklpcB3cAPdPTno1mKiEX/ncHzvx4moaK0JbsY5D5fDufChmU2?= =?utf-8?q?fo2VwcXz4fx3RtqwOznnSHjGYtCe9d+Dh5Zj/7c4Fu4BwZqNf6DuAlgf?= =?utf-8?q?C4b2AhhBD+OGHTP7mO7knkeTDu9aL9ZfHq6kmLjPiB+RhigDA9pkGHKx?= =?utf-8?q?CHL7pK8wh7tCdGgniOKrpqKwGVcy2/Mb6b5ajVT5zRttEyHRkFtmSu0N?= =?utf-8?q?QdqkAV79+KAY1vPqn2SLBec/g6+sVY1CsJzzPsoQUIDyv8ly1HONa3y1?= =?utf-8?q?Ie/0scH0l7VwYIqp7efWgTdAU+GBLFpCE4HDEccUOjTW2SiDjbZCQmSk?= =?utf-8?q?Jwfh/Qv5UttNx1TDP3RFLQv5Cs85KEqr71rg9klCotdkRVlB6QowGpPq?= =?utf-8?q?+xUu/P2e4wwTKc5lpsVR4EoelVMJtvU/e0XGbxsdXruLAwbrHIAsJ7a+?= =?utf-8?q?wgPt/bMXoPOi9A+T/frv3OhNCAs2N2ukn3YMoaU2Fjk0OPq4GJeACfQT?= =?utf-8?q?d4CvvRzfyQXq/CMEpQC42+Fj9CjXSkk2jk6i4p8ALXVQc/W45GjIbGpP?= =?utf-8?q?0RapnbK4lZAvh5Tq2sHKy0r6Ld7sdkDaRWNKpX+qoNydiZnbHREJdEJv?= =?utf-8?q?BqLi68AtnfRd2Qfpc7WCK/vVXyrI5U1W6fjbsSPM1+RLoKWAuAybCX2k?= =?utf-8?q?JLoy23khQdDNVHP761WZM/u2GChU0lG1gbc5BYCxx80BSyMmzQ+HYX3C?= =?utf-8?q?EwcgYeB5FcD3n90kpwlB6oZx1Rgue6J8m+QxjG+Xa4Wuo2+UG/StmRf5?= =?utf-8?q?oNTb7XarLLK4hehta1qIgTDI8DMAnNtpHZMjjEuwVnjLMYiJka4ho5Ez?= =?utf-8?q?EbA0USfnli8VunDWmY4zUk7c4P95/hi9ftW/f1QIMU4izGT4/7CRqGyS?= =?utf-8?q?XUQLNJ/yRlzOF4f0xXF25hmAVMouN/aK4KWigTA2vKXNxEZiZctjFrL7?= =?utf-8?q?ujkgI93f9Yt9xlefwo3/eI5BUIu0zazOe0uPG2rN4rFuF8WPr2kxOm1e?= =?utf-8?q?6nJ+rMe92E/pzh3xI2998HK3DsM/srKzSAwqoniLNuiA9N1j6PNgn0Yn?= =?utf-8?q?fqGsmISPnJztinHZYQG33pZzKFq+UdY?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 97a2113f-a959-4011-a7ca-08d976b6c742 X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2021 13:02:45.0414 (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: mafIeMLxNHRO4gI62cQW9EViLLxjLUKbDwZ0T84QI1sOGkZ2+g66eJiJNy6rwk4jyUnBVSIkvkB8PWA6TrZZ7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR11MB4860 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The driver sometime use the term 'rate_id' to identify a retry policy (which is in fact a series of rate IDs). This is misleading. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 77fb104efdec..caeaf836147f 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -285,15 +285,14 @@ static void wfx_tx_fixup_rates(struct ieee80211_tx_rate *rates) rates[i].flags &= ~IEEE80211_TX_RC_SHORT_GI; } -static u8 wfx_tx_get_rate_id(struct wfx_vif *wvif, - struct ieee80211_tx_info *tx_info) +static u8 wfx_tx_get_retry_policy_id(struct wfx_vif *wvif, + struct ieee80211_tx_info *tx_info) { bool tx_policy_renew = false; - u8 rate_id; + u8 ret; - rate_id = wfx_tx_policy_get(wvif, - tx_info->driver_rates, &tx_policy_renew); - if (rate_id == HIF_TX_RETRY_POLICY_INVALID) + ret = wfx_tx_policy_get(wvif, tx_info->driver_rates, &tx_policy_renew); + if (ret == HIF_TX_RETRY_POLICY_INVALID) dev_warn(wvif->wdev->dev, "unable to get a valid Tx policy"); if (tx_policy_renew) { @@ -301,7 +300,7 @@ static u8 wfx_tx_get_rate_id(struct wfx_vif *wvif, if (!schedule_work(&wvif->tx_policy_upload_work)) wfx_tx_unlock(wvif->wdev); } - return rate_id; + return ret; } static int wfx_tx_get_frame_format(struct ieee80211_tx_info *tx_info) @@ -382,7 +381,7 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, req->peer_sta_id = wfx_tx_get_link_id(wvif, sta, hdr); // Queue index are inverted between firmware and Linux req->queue_id = 3 - queue_id; - req->retry_policy_index = wfx_tx_get_rate_id(wvif, tx_info); + req->retry_policy_index = wfx_tx_get_retry_policy_id(wvif, tx_info); req->frame_format = wfx_tx_get_frame_format(tx_info); if (tx_info->driver_rates[0].flags & IEEE80211_TX_RC_SHORT_GI) req->short_gi = 1;