From patchwork Mon Sep 13 08:30:27 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: 12488199 X-Patchwork-Delegate: johannes@sipsolutions.net 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=ham 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 B3217C433F5 for ; Mon, 13 Sep 2021 08:33:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9EBFF6101C for ; Mon, 13 Sep 2021 08:33:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238503AbhIMIer (ORCPT ); Mon, 13 Sep 2021 04:34:47 -0400 Received: from mail-dm6nam12on2050.outbound.protection.outlook.com ([40.107.243.50]:38689 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S238492AbhIMIeS (ORCPT ); Mon, 13 Sep 2021 04:34:18 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LHjxPSyWhnOJFquFjpZmrJZADrwRN/kkJBjLLcdSy+fQXkCQVpGFfZtcRGMQILUOmF20q4nndYrxQBX922cZ8i1vcqeu9noA83NLdZ3N3cFIb4lJL0+/f0uNOwzEm+tyCgdGOEGKouA3oqzedYjizrO01P84J7CoYI6NJvfgPuN98ibGpi/FIZZ7s97dOiRTpfpJp8zgdUGl5D8GuFj7uOxOfBxCsEL6C1C5q/cs9XsvwZEtzQCklKq0qwhhDqWWG63Bp61M+L0BIGGg9328tdIje++8faqrfL9yArZwy7JpxLMm8a0/OxR/VZPIy8IeHawrtb/XEh2qNNNiGyZOsg== 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=oO9BPzLSre2iYvnNlGZ7W2bjporWmGTvb3BHUg8tVwCnPUnRZGoUs7KyoAuHwqY+WZ2BK559RspWrzV5k01kYB3BlkAzIo/pn3Vs5TSPDwBBU8S5oGnr8z63bEHWiv0mB5D1heHq9Pwd+AdZKZytqUVygWWT8j088lYXZmb0+rQyQOn6yPHbT/sxpPNZMD6UOnGjIOMwoQ0D/B2OxQalwKomYI65CEfBAuDf95gwMA9rjZPurXgAySIG65tTWUiz0H2m6SOJeooH9+ONHudZSY+wEnMvIBQi7wlWfz2bETGfyaKXP1/1X4ppnQDhzfuQgNpKajfLjQHfzOmGssB20g== 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=AScfunU90kECODd5ks4Z7M5pnirrg8I52vlXLGORTKk5YtkX3h1/HGMfIfWWS0+n5s04tM9YjPtaxuigVvb+XHD5ltDEOAKpEzqt9Hutrnef7KPgs4/osmyqr9gGx4wMBOW6QM3Nyq3b1Ddx3cdl0dhE3Pw/p/vEv8C8h2EAV3E= 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 (52.135.97.18) by SN6PR11MB3263.namprd11.prod.outlook.com (52.135.109.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.18; Mon, 13 Sep 2021 08:31:53 +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 08:31:53 +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 v2 15/33] staging: wfx: fix misleading 'rate_id' usage Date: Mon, 13 Sep 2021 10:30:27 +0200 Message-Id: <20210913083045.1881321-16-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913083045.1881321-1-Jerome.Pouiller@silabs.com> References: <20210913083045.1881321-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PAZP264CA0067.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:1fd::10) 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 PAZP264CA0067.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:1fd::10) 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 08:31:29 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f3ad9465-56d6-4f61-45f9-08d97690e32d X-MS-TrafficTypeDiagnostic: SN6PR11MB3263: 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: FKfh30aoSfjfnBuBF/RRTUP95MK4kW3q9T53OpHnJ5IGv/G5OSaGPSYmTRx37ofABM9i3I4xUrwycg9tHFDwrjGYrtx+1/l3W8DL0B2kmkwFRPMURRLwXTABH9QBKa8/dlAjYiMwEAQWyFLWUB+ajm7wMdguH30ZXIwvh39DoY8sp1aAksUQuFuH9cD3vsE3Gg41OYIhDguCSrsGkCjUyf/6jXgsxU3F1T539D2vgDBukomEt4VPD6nEbC1/i6/XOTvEThkCx9YvGHoc/44CdqSvoXrflB7+HPf5ky9wYfE5kdK0ME7c0vQIUTwtOpth8LnBWgYYRg846VoAp/SO3UMA3g45jcj4y2N0OAaFlr7zphPsw2sA7S4EAGcbtY8LAWdXw1dsn/BC2JZTOLpmGgHDC5Fmt3YniGzChaZctZ6v1u2sVwVPA4sUH0tOaL0h1srcdp0DRDcbxVcEPgl1AjbWDqjmnrXmAuEx69m+2NWSJYn+/9UH+WtxrUsfA6A0v3pSzIQIsDvAql9EO2ykecLmLfu3Z68BJN4qd9oBB0W4aQ/KBao49fstZM3ds4OFpXZeuPs2VardtzHNUgE5xZIfxUiRlihvEn+MS2uR8eQCSIWUa6VM9YR+/3C4v0ge+y8kOqtZY8S7LfhR4sg/PmmvZ6YEvjAWncfHhWSRrdAtDZN+bL4lFigVwh4PtQ6wvNpaiwrpykM1HR+BgBIGNg== 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)(83380400001)(66574015)(107886003)(956004)(2616005)(5660300002)(54906003)(38350700002)(4326008)(316002)(38100700002)(66946007)(26005)(66476007)(66556008)(186003)(8676002)(36756003)(8936002)(86362001)(508600001)(52116002)(7696005)(6486002)(1076003)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?DtDVYon5k0a/o5BQKCdUkt2OZsFQ?= =?utf-8?q?Jr2SOWpCDR2Xd7lszrcv1bDO4M2h2qAE/bV97Tagu1Q5cugf0g2WobyHREx5Ws3QJ?= =?utf-8?q?mtSXDreMZK4kinZJ6bIIj37sj18oU+FJwExhyr14VHaGRLcf0+p4hWb5LXfdX5VsE?= =?utf-8?q?iR34UUzSBPX/N/RUiVKBrwCLuEcv7xxxywMRRe8YfMMLfl7vmU1/P3StctIeNi5w+?= =?utf-8?q?uzW+XEJ16+cJQXyW/9+nUQlO8kUDnEv2tV572ZgSQTpeiz6t6EXVGINI4anjgorfs?= =?utf-8?q?jOVWmReW3+qEE4vtpVSGa/KItGxVImgR34mmYOXtKRjB1vWTJ/QsMCZCoEWcNlgHL?= =?utf-8?q?pkzjZXaJBLZ4/DCEoybz0kSny5vCA8dSb0k5bQzQxHuw4slktNjl9XPb7NpnlH9d9?= =?utf-8?q?iYwDokMAXMtk8N/2wfI+2tYVZbJo/VOhfrTBLGk835ZVXNYyiTWU3kJndJ4FZgTu9?= =?utf-8?q?2dtn4SDKauvwJUxeGvCLpBbP2rapT0Sue7sC/ibTw3pTyEbKAg2+TGxcffEN4pi8l?= =?utf-8?q?B7hRI4bxr3rdR2tYswHTIDyugdeAxRhXokORLyursd4vzUCufYBp7x6ygjekXqVEF?= =?utf-8?q?vMLkbPQin6lrvkBWLwb1HagwgY5CO2Ty9ybHN/hFaClB332h/ynWAmJryDjN4kOGY?= =?utf-8?q?eM/STgGOsfsDeD3KwCJ946DXMyBATd5EP2UEK7ZdHo1iPN00Ie3BCFx772T1xQNUP?= =?utf-8?q?sNhyJqY+7whiO3Bo9biaKwjB6TSySeT00GI6hzPuwLWCx7Vrjt5fedfLQfKi+/IL1?= =?utf-8?q?MTncyGhkHCjQ01pzE2nARvt/KU0bzdr2GGwQpMR4Uz4V9Z1z3tMN9tqJyovY4MN8u?= =?utf-8?q?Xb59yGHs3F68zVltp3WxU9Oyc9sxY/YKSKDjTpa4YjCJTXA1D1CjkHjXh4zUOEnqB?= =?utf-8?q?lSx+R2C3SUHt8YRXi7uFi4YyoVdrhbC7cRvemSIMT+cQSbfvTScXXiBxR8QTC6j5s?= =?utf-8?q?ID/V60L+y1PUWROhuJvegjXMlDsQ2Tvm1sAOVazIE0gJP2VgEBlc1L9j+8oByhXzr?= =?utf-8?q?QvPYUVZrJ3p8dK683tiTuro7fmsJk43wNyM1bqMOOQAI4euuiHnCzDIPUwTc9AXq0?= =?utf-8?q?VX2RS3ULGf2aeGoHmMxiwCCCu9lLuL8MCce2AZunlmC300tyc12GXF1idLYYThKbf?= =?utf-8?q?2LwaV+o8c3v9xaHfGZxD0Mt+JNAT3+ANFRfsZjqhbiODA2/jkJ7SCN4F3nxIPzlwR?= =?utf-8?q?jMpUc+C4eBL49iP0KLnBtm1xKEnREquKKsfsKyYp4bKHOQsv+r5eLlabsEX3VB8zN?= =?utf-8?q?Wm/SmulZE2+3Mw8d?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: f3ad9465-56d6-4f61-45f9-08d97690e32d X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2021 08:31:31.0347 (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: Uev+2Gd0mbA+a+TSRO8eZUoYiTue1/hhlJYCcZCuUdUD77nK87TX87IrBLycfB3p7tF2lKen9ERC4Yt0v3k9oA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3263 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;