From patchwork Fri Sep 10 16:04:48 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: 509075 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, 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 152DCC433EF for ; Fri, 10 Sep 2021 16:10:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F3B866121D for ; Fri, 10 Sep 2021 16:10:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233230AbhIJQLY (ORCPT ); Fri, 10 Sep 2021 12:11:24 -0400 Received: from mail-mw2nam10on2056.outbound.protection.outlook.com ([40.107.94.56]:59105 "EHLO NAM10-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233332AbhIJQJP (ORCPT ); Fri, 10 Sep 2021 12:09:15 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iOme+4a6sHhU6Atl19NARD7dL++YNJvvQYiJL+7grUYLIdx/3QLkMo8t8vgbKdmQiSjD5QL12zyr0gqiJnnG7dfa4/lWJSQjUyFoZd25DlfaQVO+maGvI6mCJyybLRn+5wiXkQXXE/NsGtvAKPjdwJnePsMT/Ck6TLSTmuagNIs60GkxtV7oZMb9wLOJ+nSSNhhyCltZgQiGndYWJk4edMJavchHl1Yf+Aautnt7I/c84hlh/b89Ycj7EGinxPmIGFZ5FSHWSit6tti0/OY7c0RZ2lg2RyMgmEJlKe0ZMcBAtA37FQlIGg0sCnqM3ItV5/yiIApjV5NaXwfYqPrvlw== 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=Vsk6hOIKB9hzwmTIZpsL2rMt0mSfuCuRrlheSq1znTWsa6Oa1u03YKWMtNlczIt3Lf/fzzQpFEieBlTp6P67E/arrSd0wTS+Ndiyz2MIwc+k6T2bb6DgjEY9/wZiJBXEh68zKH3lljbKNakcgJALdEUNQEVG6QZJTN/JwY03JVr9FPoQpboG1/2zZbwSSd47dprUoC3XIthrKC8b2JStt+oOWbLRBYIWzzMPQEI6NOWMe2frbdJunQxtgsbJMp/0i+0hTdufuCHNsnC1B0c1far4a2cSBtlDnRyp9p26B37QQot2gAiZOvz8nSzIygR1wrkO9Mc0dRQ5kWeq+pILGQ== 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=Sr8xAEbV5jK8AY/0fSVHC8HhPgWqVQIFKL/WtUIHDPO/2QOl1tqJCPKKIyJZRiMRWn5KPrGKnPcyGtMma1NW/T93moLZIvqZ+/Uqog0K/nUWGBi43ZpOSIWKI8SQz24gTSC09IhdiIF2Xn4nXcAULp9ovpLcds/5VAh/SFJP1oc= 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 SN6PR11MB3118.namprd11.prod.outlook.com (2603:10b6:805:dc::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Fri, 10 Sep 2021 16:06:01 +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; Fri, 10 Sep 2021 16:06:01 +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 15/31] staging: wfx: fix misleading 'rate_id' usage Date: Fri, 10 Sep 2021 18:04:48 +0200 Message-Id: <20210910160504.1794332-16-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210910160504.1794332-1-Jerome.Pouiller@silabs.com> References: <20210910160504.1794332-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0601CA0006.namprd06.prod.outlook.com (2603:10b6:803:2f::16) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 Received: from pc-42.silabs.com (2a01:e34:ecb5:66a0:9876:e1d7:65be:d294) by SN4PR0601CA0006.namprd06.prod.outlook.com (2603:10b6:803:2f::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.15 via Frontend Transport; Fri, 10 Sep 2021 16:06:00 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d1a9a9d9-61a4-4a61-339c-08d97474e278 X-MS-TrafficTypeDiagnostic: SN6PR11MB3118: 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: 29itTLI6GgbOtsD/NXoYXM09PhwnOZqSFTWPsGoIu57dKbzOX+v4a0OhcVvQX0jiZB8dSvCZ3GZrJIX8MR6EfRU517bH/OZdJ+bvIansF5o2ksdBlwgsFwADMUMfE3WWgPsEPuq3j2ph4fnbZhuJG7wvYNtIGVsCzI+a6eJMC5/DoSvSn80MpuOMcFdQrFll2rDvOBvaUdaFhkIsza6RlfcaI7dsO5aKIvDMlk4XgZUSNhZBdHqAJnh2RkHXMVMs+dS0rakW87WKRwI0CUDau4EyIKRxAgjIu3NJXRye5s/kSExKvP8BTqyrki0ZtPCvYRkC+gSqyKnQ3ueC955qLiGEkGl+i2EcVc11+Aa8VOOWElGfRLNbEUnSmz5GW8bBD3RPT/I2LjCnvN/VCEA2yJTENcsX/Tyzyb9feE+lvjVldVHZEA7s1tHxd+GDRuZd6q1zeDPcYccgqLQiQq4lBW1rDeHLyHblSo3DlG0rAGp+2JVbpvoACuD5srAnYJUYIi4KFWk2x5w0lYxPEEFhSwbkC+RYu6AyjMXER+TlHvLiYMLPrYKMIZHTJI34joPi7OLW7nd508pbOd2fBl6W25aD/YkMCb2Djfr9BPe0oV3/9vvpbZSr1qIkcSrJBf8cY1KaRVXnpDMZkgg/VRcPzg== 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:(136003)(366004)(376002)(346002)(39850400004)(396003)(4326008)(66476007)(107886003)(36756003)(186003)(316002)(6486002)(66556008)(8676002)(6666004)(86362001)(2906002)(54906003)(38100700002)(83380400001)(8936002)(66574015)(5660300002)(66946007)(1076003)(2616005)(52116002)(7696005)(478600001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?NxzZhJxg5hEwDIg3RLN3ajgpj?= =?utf-8?q?UHSfZmgYPk1XSYpqIjR9F0YxWKIPOuq6jiplsqcv2lbcckR0Ef/j0Pwf?= =?utf-8?q?0qDmxoZnEWZU+z5hazckIbO/gEwr1P97BIk6qwjJmiyBaHwLof+nBoS9?= =?utf-8?q?8rTYsK+IZ29VVaz/5ds0VklW/BEPn4knPIdO+GQdLxV1TdgR7Ez/0H+C?= =?utf-8?q?IBRv5+djWxGvmg1Q7/6fBlTelHfK38nIOcwMLGXtXJEx6FKWd+/GOpgp?= =?utf-8?q?7eGHGE3VH15v7PdS45rB5RYEQJXT+6iqGjb9J1kDwz/rz6xW4hcqa549?= =?utf-8?q?E4+awAVux1q42ddzWICx/Mjj/b4uo5RcfAIBZXvwRrWB5cBwYqflSKWU?= =?utf-8?q?/Oay1R0/Tk30dsGt64lgObBkTPIY4r58GpVkdgyPu4uO4t3O1kjoHOfk?= =?utf-8?q?dsO2VaZgkCP5wUIxLXgrWFNcg6yVimXWtW5Vx+wpoX7TsfMUo9O6jtfK?= =?utf-8?q?I0jKx3MDvaOfY4BtFeP7kLhC6hg4u9RjXSmWApUFjFKfybcMRbS82ZeM?= =?utf-8?q?t88nCwE2wpb5hx/IOESrablCi/6v9lPeOrFTlo5pmV4o6caQBGormGSW?= =?utf-8?q?6B36Md2WJgwW+uXiYdYUPoPKUlFXwLoyojj8IjqxP12T7XqwH/FDJNJy?= =?utf-8?q?JQ+8nDb/y2Yy72KUQfHLGi8sFnYfbqgP2sjQk9gRIqMARP/hd1yeMfdm?= =?utf-8?q?RI8ZCqsG1qvygSMKhtVg+4JcQiL6ZgVfagENdQuZjO8TpYvH9XOoPUbu?= =?utf-8?q?v97Lu+KgnJCbWoe/cBHYoZSy8EN0AinyvoylP/B2nLO7+FgWcpCtJ18R?= =?utf-8?q?1A0BtpsCEeftmV1dKXVJI1knxZFWpnrWCdLuagbIh6eLXSuNW/fBSVpg?= =?utf-8?q?xstLsRzkSy7Bp1jaXVtMC3XkUKxprBb8nxhvzwnDcXgHEiL0k4w6nFcv?= =?utf-8?q?O6OsuJWESZ4pz0rX6v3LAxvjBdIf+91WcfYQadvOyDtqd5DkKQxXRCsi?= =?utf-8?q?ehjk1YizZonqDyK9kisisyfRceV5EQsB9BvvBivEEBce/i1nKVLLlZQR?= =?utf-8?q?BezCVaf/J6ylWEsJ3XSjOd62IZUW5owEneaKAn2ttoKT43tVx9sBR/de?= =?utf-8?q?bMIaZZXghi6okTcNEuG4MgBjgZgCd5UjxfKTDN+G3zoK51Vh80nbyWQs?= =?utf-8?q?scRA3eOHBlkHNFAmpnpOewOHAMh7sEyT8pMHLldGKxLWQVRDBJJvBsNB?= =?utf-8?q?+f5CMR7hEVP32LD2bh0/x/bjWMn68PHxILDdwMxHGQ1m0vRcBqJc8evk?= =?utf-8?q?RcSRdYzSLxm58ibO/CfJCaaGTRsMMm2X51CIkkez8CXSnogPf4qKScCn?= =?utf-8?q?MX2FndNpCxiXHyw+Y5pttJ5EHt+xFnymwOmIz675wolIh/O4aMUwpLqs?= =?utf-8?q?br4bp35kl/yJXDmzf7w14Cmdu3EufJryITuCkrF?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: d1a9a9d9-61a4-4a61-339c-08d97474e278 X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2021 16:06:01.6791 (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: Aow5JgABJdvunVLqda3t9vgHabx8CiMait8OKd4hDgXPxf6Ll1qFsUuDbLz2JavUhkU1lMf94ocIkS4E1T7ZQA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3118 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;