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: 510319 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 DFB07C433FE for ; Mon, 13 Sep 2021 08:33:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CC78B61051 for ; Mon, 13 Sep 2021 08:33:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238627AbhIMIex (ORCPT ); Mon, 13 Sep 2021 04:34:53 -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/o5BQKCdUkt2OZ?= =?utf-8?q?sFQJr2SOWpCDR2Xd7lszrcv1bDO4M2h2qAE/bV97Tagu1Q5cugf0g2Wo?= =?utf-8?q?byHREx5Ws3QJmtSXDreMZK4kinZJ6bIIj37sj18oU+FJwExhyr14VHaG?= =?utf-8?q?RLcf0+p4hWb5LXfdX5VsEiR34UUzSBPX/N/RUiVKBrwCLuEcv7xxxywM?= =?utf-8?q?RRe8YfMMLfl7vmU1/P3StctIeNi5w+uzW+XEJ16+cJQXyW/9+nUQlO8k?= =?utf-8?q?UDnEv2tV572ZgSQTpeiz6t6EXVGINI4anjgorfsjOVWmReW3+qEE4vtp?= =?utf-8?q?VSGa/KItGxVImgR34mmYOXtKRjB1vWTJ/QsMCZCoEWcNlgHLpkzjZXaJ?= =?utf-8?q?BLZ4/DCEoybz0kSny5vCA8dSb0k5bQzQxHuw4slktNjl9XPb7NpnlH9d?= =?utf-8?q?9iYwDokMAXMtk8N/2wfI+2tYVZbJo/VOhfrTBLGk835ZVXNYyiTWU3kJ?= =?utf-8?q?ndJ4FZgTu92dtn4SDKauvwJUxeGvCLpBbP2rapT0Sue7sC/ibTw3pTyE?= =?utf-8?q?bKAg2+TGxcffEN4pi8lB7hRI4bxr3rdR2tYswHTIDyugdeAxRhXokORL?= =?utf-8?q?yursd4vzUCufYBp7x6ygjekXqVEFvMLkbPQin6lrvkBWLwb1HagwgY5C?= =?utf-8?q?O2Ty9ybHN/hFaClB332h/ynWAmJryDjN4kOGYeM/STgGOsfsDeD3KwCJ?= =?utf-8?q?946DXMyBATd5EP2UEK7ZdHo1iPN00Ie3BCFx772T1xQNUPsNhyJqY+7w?= =?utf-8?q?hiO3Bo9biaKwjB6TSySeT00GI6hzPuwLWCx7Vrjt5fedfLQfKi+/IL1M?= =?utf-8?q?TncyGhkHCjQ01pzE2nARvt/KU0bzdr2GGwQpMR4Uz4V9Z1z3tMN9tqJy?= =?utf-8?q?ovY4MN8uXb59yGHs3F68zVltp3WxU9Oyc9sxY/YKSKDjTpa4YjCJTXA1?= =?utf-8?q?D1CjkHjXh4zUOEnqBlSx+R2C3SUHt8YRXi7uFi4YyoVdrhbC7cRvemSI?= =?utf-8?q?MT+cQSbfvTScXXiBxR8QTC6j5sID/V60L+y1PUWROhuJvegjXMlDsQ2T?= =?utf-8?q?vm1sAOVazIE0gJP2VgEBlc1L9j+8oByhXzrQvPYUVZrJ3p8dK683tiTu?= =?utf-8?q?ro7fmsJk43wNyM1bqMOOQAI4euuiHnCzDIPUwTc9AXq0VX2RS3ULGf2a?= =?utf-8?q?eGoHmMxiwCCCu9lLuL8MCce2AZunlmC300tyc12GXF1idLYYThKbf2Lw?= =?utf-8?q?aV+o8c3v9xaHfGZxD0Mt+JNAT3+ANFRfsZjqhbiODA2/jkJ7SCN4F3nx?= =?utf-8?q?IPzlwRjMpUc+C4eBL49iP0KLnBtm1xKEnREquKKsfsKyYp4bKHOQsv+r?= =?utf-8?q?5eLlabsEX3VB8zNWm/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: netdev@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;