From patchwork Wed Sep 27 16:32:50 2023 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: 727065 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A026E82CB1 for ; Wed, 27 Sep 2023 16:33:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231886AbjI0Qd2 (ORCPT ); Wed, 27 Sep 2023 12:33:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231565AbjI0Qd1 (ORCPT ); Wed, 27 Sep 2023 12:33:27 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2088.outbound.protection.outlook.com [40.107.237.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F213BE4; Wed, 27 Sep 2023 09:33:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CqlB+5lgIte6IAxgfpjVVBwy1lCyHPL5veEz9yt9/obLBW4u1ujVf4TXf0E9nbkZRM44AhUQ9FOTP6P13+6mMDve5MbJgvdrn1F0LZB5SUfUwCf2VUeqZ8j9EiH6y2Y6TZfT9eSHvchdf2cWoARlLmiHZuD4X9TiwHJBJzGHbAViZ2YkSVwFfRVPohIZcnf/E5rRagbtHvd6dN8eJgpd56p1bZYv+k1AT8kysbDw8P3PZ9cJ5IAiJ1nQUrvM4eQtsYr6ag95EuLxhHe/X1yJ+G7Eu1E/IBS3GiYbqQPo2fqWryvalfsOuYq2N7bTSYqjAEEyQcrqNV9cd0qQsBz/KQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jOP92MESOXRIE8UQeRoit76K7t7rRgsKKFRdemcA71k=; b=kkSTKMtfQgfmTsypVUJiOmBrcypfZGJmB+37k8eAmIW1G0/u55S26wuqUJahvFtB5jZeHFESvFru/YMdxD7lsMJdc5xPTUm7hLbklkNBnW0GL5OKKm8ghbV4mkrQcd1ZRZnuvT2bW3RG4Qu8l6zKUjGt5kPaxwOWWqKgDkB/aW54BE8+j76rAOXXP7HOgX5bEjuF1hjHHp1qV8TBuOHEG9fl4CmdwcRj/HvFk3cVQkBxDoQCDQVcBBqS8dOu9aCs5dyu62VTWIlCtPB5LzsazqvjcLc6TVUXNYSTe7tZObdewO0BhmxMY8hpmEzBh73QuF3WuKO0EYfu7VobJmBcWA== 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=jOP92MESOXRIE8UQeRoit76K7t7rRgsKKFRdemcA71k=; b=N7AlkFB1/gaO3kFghs7nVtKyFzYoI75rIcChUSbWOwZ/m+KglD/ukZdO/jse9SR4+8FigqXCNG+NZin9ezTKR7GT1mMNHQrHyIP1PLUbkPBbVFtORDU6uqY0oWLT08hNl462oAVZjIvG2hKSQPHGQl589XrlVeGhbylx9GBSq+o= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=silabs.com; Received: from IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) by CO1PR11MB5041.namprd11.prod.outlook.com (2603:10b6:303:90::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Wed, 27 Sep 2023 16:33:21 +0000 Received: from IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::d6c8:4cb6:2594:d8f3]) by IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::d6c8:4cb6:2594:d8f3%4]) with mapi id 15.20.6813.027; Wed, 27 Sep 2023 16:33:21 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: Kalle Valo Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH v2 2/9] wifi: wfx: relocate wfx_rate_mask_to_hw() Date: Wed, 27 Sep 2023 18:32:50 +0200 Message-Id: <20230927163257.568496-3-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230927163257.568496-1-jerome.pouiller@silabs.com> References: <20230927163257.568496-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: DS7PR06CA0052.namprd06.prod.outlook.com (2603:10b6:8:54::30) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|CO1PR11MB5041:EE_ X-MS-Office365-Filtering-Correlation-Id: 80fa8505-873d-4169-667d-08dbbf777556 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VGMY5yMdWT04GTSojxrFwnT8/BT8O+sE12s0hWLVcI+Serae+p3dq7vUJBFY5HZyDIfr7q+wd1L7fk+cgRFcJ9H73DvF6F+NDhP3+Lkc6RjhCG9eO9Ly3otrV2kAD3YSShVXpraeVqDjh0YT5JT4rlY92ncgrYzmfLSxK6l2tifRNqNlNxvaiAuzvEOVuqPwQvczjYpyNxA9aada4K+zQjEWarC79KEqVKmvzzRxqvBopf+dC0Lq60HXXINpFdEx2BTUy9yg7fL2danYc4zwd0rxyr0GNFUxoPJlgMRG/mESQ2HQxoiLzvP/wSAz6nF6GtDazjczBphi3l3gKMYVU11fpwqwZL2qmXyJXXZlJMQSwET3OO5eYJ1xQAlEgG3T041bA1fRp/OdiAXQZY0/aPGptkIR6gcpHPQmZVvKLfCXFCZxRzLC+R4ChVTyw53qjOTzx8OwnRFWyF/FtemAIqV5BnKjjkF2y9gnwgJhaA046c3tUpKmTTwMrrw5p6VCikpUrnrxfKMNmy9m/HdAVXw4Fihpovalj3TRaRMaang5VuQV+2QrOn6nWSS9NDna X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:IA1PR11MB7773.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(136003)(346002)(39850400004)(396003)(366004)(230922051799003)(1800799009)(186009)(451199024)(6506007)(107886003)(66574015)(66556008)(66476007)(6666004)(1076003)(86362001)(6486002)(52116002)(6512007)(478600001)(38100700002)(2906002)(83380400001)(5660300002)(316002)(6916009)(36756003)(8936002)(8676002)(2616005)(66946007)(4326008)(41300700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?30z6exFaMUYq9NswSNS0W9KxsCMT?= =?utf-8?q?UwzV7bbC6ze/oJTAUG3fjPVS8TbqqMTRRUvMkH2/A+mJDFbJ984Lecj45XzL5OCOd?= =?utf-8?q?nOmrx6SwWHhXDHxHgMk2nREg+JO9dCnPrYxIq4uk9XEi3LgPn57h/Z7wNM+Tn8HZd?= =?utf-8?q?RRmCpaOn/4t0u7xWtAdnS3p4XzrppCGLJyYtwkjwc7AXxebJRlnOW9D5ksDYI0hbk?= =?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?utf-8?q?wG/cAQwsIMv29e3WfybY8am5Wqk63eDGEod9MJiUj9IaZmnncP9o2rrOGX81UGACi?= =?utf-8?q?7+TE9FPtz/s3V4grC1kWPWRdXVeRrYCizX7eR4MdRddqal7AxklIiCL5H+9QqXW/q?= =?utf-8?q?fuoIZgtYno3DwuELDdEASYX1QmfVx3MRihvWzYbUvxfwhd9371ZRL2yiDzE4nf71q?= =?utf-8?q?xy+V5083pefM0tBrT+xr2QDiiSHnL/7mB22l62JX/Tz8aGBFzpFEwtW/LECMuGz1x?= =?utf-8?q?7Pfazfm4mVYHCdEwGX4tuJpgYNJiAxNAosgfktUg9bL/zn+89YNx2iGzW6Mym5Shp?= =?utf-8?q?a+YJOZ2ByT+8MSXZ4eZ8xBDxLtWOrCeyVfG2R6v8ppoD/Ue2L0R7fqUEvtNMZ2wwV?= =?utf-8?q?JHtRYUHKhe2+d1d0m1ha8IYiKB5eED3icaNzpjMm4rWHnEhdum6OL+/3t2IQUhbkr?= =?utf-8?q?ozLq3foOdPgXfczRw10C1fKi0C3ZLIi17DK9Hzd0E7J7V4t1TbjY6NNXDmJQuGckD?= =?utf-8?q?DH32UrLUfVq?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 80fa8505-873d-4169-667d-08dbbf777556 X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 16:33:19.6087 (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: MyrM3r982D6cpJ/TaaOPu2vLxZBGoFNFxpa5K/te1a/mKnsm7yBVEJM8xmguV7Mcsx8QIEsS4kuQmZoUy1EnCg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5041 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org wfx_rate_mask_to_hw() is only used in hif_tx.c. So relocate it into hif_tx.c and mark it static. Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/hif_tx.c | 18 ++++++++++++++++++ drivers/net/wireless/silabs/wfx/sta.c | 18 ------------------ drivers/net/wireless/silabs/wfx/sta.h | 1 - 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/drivers/net/wireless/silabs/wfx/hif_tx.c b/drivers/net/wireless/silabs/wfx/hif_tx.c index 9402503fbde3c..de5a31482df38 100644 --- a/drivers/net/wireless/silabs/wfx/hif_tx.c +++ b/drivers/net/wireless/silabs/wfx/hif_tx.c @@ -45,6 +45,24 @@ static void *wfx_alloc_hif(size_t body_len, struct wfx_hif_msg **hif) return NULL; } +static u32 wfx_rate_mask_to_hw(struct wfx_dev *wdev, u32 rates) +{ + int i; + u32 ret = 0; + /* The device only supports 2GHz */ + struct ieee80211_supported_band *sband = wdev->hw->wiphy->bands[NL80211_BAND_2GHZ]; + + for (i = 0; i < sband->n_bitrates; i++) { + if (rates & BIT(i)) { + if (i >= sband->n_bitrates) + dev_warn(wdev->dev, "unsupported basic rate\n"); + else + ret |= BIT(sband->bitrates[i].hw_value); + } + } + return ret; +} + int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request, void *reply, size_t reply_len, bool no_reply) { diff --git a/drivers/net/wireless/silabs/wfx/sta.c b/drivers/net/wireless/silabs/wfx/sta.c index 9c0a11c277e97..c58db2bcea87b 100644 --- a/drivers/net/wireless/silabs/wfx/sta.c +++ b/drivers/net/wireless/silabs/wfx/sta.c @@ -20,24 +20,6 @@ #define HIF_MAX_ARP_IP_ADDRTABLE_ENTRIES 2 -u32 wfx_rate_mask_to_hw(struct wfx_dev *wdev, u32 rates) -{ - int i; - u32 ret = 0; - /* The device only supports 2GHz */ - struct ieee80211_supported_band *sband = wdev->hw->wiphy->bands[NL80211_BAND_2GHZ]; - - for (i = 0; i < sband->n_bitrates; i++) { - if (rates & BIT(i)) { - if (i >= sband->n_bitrates) - dev_warn(wdev->dev, "unsupported basic rate\n"); - else - ret |= BIT(sband->bitrates[i].hw_value); - } - } - return ret; -} - void wfx_cooling_timeout_work(struct work_struct *work) { struct wfx_dev *wdev = container_of(to_delayed_work(work), struct wfx_dev, diff --git a/drivers/net/wireless/silabs/wfx/sta.h b/drivers/net/wireless/silabs/wfx/sta.h index 888db5cd3206b..c478ddcb934bd 100644 --- a/drivers/net/wireless/silabs/wfx/sta.h +++ b/drivers/net/wireless/silabs/wfx/sta.h @@ -66,6 +66,5 @@ int wfx_update_pm(struct wfx_vif *wvif); /* Other Helpers */ void wfx_reset(struct wfx_vif *wvif); -u32 wfx_rate_mask_to_hw(struct wfx_dev *wdev, u32 rates); #endif