From patchwork Mon Aug 7 15:05:35 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: 712336 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 1D794C41513 for ; Mon, 7 Aug 2023 15:06:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229908AbjHGPGM (ORCPT ); Mon, 7 Aug 2023 11:06:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229483AbjHGPGL (ORCPT ); Mon, 7 Aug 2023 11:06:11 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2081.outbound.protection.outlook.com [40.107.223.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 526D010F8; Mon, 7 Aug 2023 08:06:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MRueQWB98NEBCdGy+QHPwZPVuHeNlMtUR9IBqkiSZx2hmqhUZVlxW3ePAPgQzsfcd/aB4xMhuJLwjc8p71oB9ySn36++XoahdnBl/yVi6mZL+J5xfrfKMmZHvD1skz458rZsBA7BpyRwneuhwpnbBaIJSX6D3WiPhs2jjUgX6F2ANvmtAf/Ys3jtmWPDf1KK4g89R5QqKQ62mTUTpQWczdEIo+howI4gFBHt8w8G7asoVLB/H+bxYZDrj1XlTUsBPzfifR5rPrI9irD+mfqgHiQw/XElUMsUSLhaNTnzc7b4Ljr8C2WG1MYGk5koNDhwFlinrcue0t0uW1MtZvutPQ== 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=JV5OndEi+l3uqa+eDykICL8Az7JS/KrWbvmgefW9BkU5K6E+SY9dTCox6A3xIaBAtmRdS/i6QBh8BIS1922kHA+1XendBdHQ6arRnlg5xn5w2Q83U5NIX/dCmD2y4n7aAs32C75SDgIdsS6l2K3xqUtQaMNXLWQlMr+aoz5L4qWtuaD8iBe3pALAy1n0h714mfrvLrpAPDQn0X2qVKEx7t0URUSYFi0hrfEqymL42JQEivzbznCbc2mgbkPI/6ElgUUiNyGf2/vLNQpnWfe677adyqqdmlC6RUeD3ji04YZzUJdNGQNaavP/DASYyK6pA0yUUJU4TdrifngoUjpieQ== 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=TgNuy6fWywhvqvh9Ld1mq32zvKqd1mhTY7b8uePJ3fxWZ7C2jYdL08GPYVv5PqSHOad3MiM9YEK5e/nJFqMPeynXLVGa5h0QTt9KpYmLMqsyIcoPvsSmU9LXYb/wJhooOdeNkeFp6ESCGsioYVdCHyRLNn+dNXLXqWxDXmZlfgg= 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 SN7PR11MB7590.namprd11.prod.outlook.com (2603:10b6:806:348::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.27; Mon, 7 Aug 2023 15:06:05 +0000 Received: from IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::14b1:be6e:19a3:2eca]) by IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::14b1:be6e:19a3:2eca%6]) with mapi id 15.20.6652.026; Mon, 7 Aug 2023 15:06:05 +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 2/9] wifi: wfx: relocate wfx_rate_mask_to_hw() Date: Mon, 7 Aug 2023 17:05:35 +0200 Message-Id: <20230807150542.247801-3-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230807150542.247801-1-jerome.pouiller@silabs.com> References: <20230807150542.247801-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0252.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100::24) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|SN7PR11MB7590:EE_ X-MS-Office365-Filtering-Correlation-Id: 1919d4d8-34ba-4d34-3363-08db9757d274 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NSPywcVr6fApUXiYHY9vsBGhwupGZjlaNg5D2PmvbNFcbJaLTVVSczI4XTZPVjIBGMtsZX1zvwjAECF9vUD6qLAWAIat8taSi8UAN5omm0G5rZ7aRLMZZuhiqmq67SBNxTBEJMLhWCRmF4bdEF1hBn2h0igNrTJNmCBblQuCOL4YBkC1TZk95u23JchRZiPJqJNYhhF2Hu9B833T7k7whM2aCk8+80vTlHNxtc6YcsuodQ7diqITwI0sUDI14OuMiZiFpC63qHE5GIKHMHDe5xSFRq0XI/CztCzz/l7r7ZkBZorSbxq721baxZpKkEoGWMYPeaKmTnUEeBgZHcAUSePFa+L9fazYKHtB7mIVoFYS14oP8FKDow/nEPoSdIRPi+2rMtu+06flUPhzDtaAmfr13mq2C7G+CKbAGYeTkJjGooEzoxqCcCN7yAXWzlDI3ca0pFrgeQk9ZU1xMCcCpnFhGWMvUJE4ZjEeHS5JzOzipGptPsAwpQ5KpaspMk/xETbYejrpjwTlbZSyKSkZJ7wbkU2PMtp676UfIV3xQvwpahx1nGEexS975qk82hHtBzq9V1jHE79GHGRtm9AZZS04IZrxGet8ObSLTAhAS0+R3ijzhAk4IbpuBdBERZwq 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:(13230028)(136003)(39850400004)(376002)(346002)(396003)(366004)(451199021)(1800799003)(186006)(2906002)(4326008)(6916009)(66556008)(66476007)(66946007)(6486002)(52116002)(6666004)(66574015)(83380400001)(5660300002)(41300700001)(8936002)(316002)(8676002)(38350700002)(38100700002)(2616005)(478600001)(36756003)(107886003)(26005)(6506007)(1076003)(86362001)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?E/s2NS1kWdbkk89EYGzyagUr/Pd1?= =?utf-8?q?QlV8YEjXj0SbglDFAszPLZ42s09mEtZLuejuZuP8vOHTHbnZ4t+7FEhfGx8sU+Zm3?= =?utf-8?q?GmFwaj13eH+Berp90ZMd/9nXukockJ1owL4o7wu8VBykMvbW2rgQGWBzv6+FUGdKT?= =?utf-8?q?S7qvdm9U35cIPGDGbCE5DvcfMgiHDoXiAuYIO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bulI9/F7Sl6AXfTdHMGExe7HmGovxlnSB?= =?utf-8?q?5NJPYzGrYzb0KKGIKsT9MjoY3EzUiZ9wb7VATr7Bbp7EdUpjnulh6Rgu59vTToN4N?= =?utf-8?q?vYPtaPPSJCJpsKesMRoiizcOJiT4cj+FqNe8VfYJiyWt791VDjAP0hoWZHqvFlQWQ?= =?utf-8?q?BsjTrjMhF3K5xCptIp9h+0SfaimE3iXti8q1tOMLgHWTA5UWHwWqxg6yIl0yxylIq?= =?utf-8?q?ah6PlyiKzxv8NV9tO1XdxFF26YQE1bGOy478j9S03EskTbkoDQ0T+xsT/qXSEXyPn?= =?utf-8?q?xU/PUBW8MBpTztaSk4HQE3d7+fzW0yGOww71I6GAbOccok1ogHQAIKlEd/58lA3Gh?= =?utf-8?q?pvq1KV9kcImpkrOkkUu3+I9kVg2+VDmkkSxh9HUQ3JxFizki6Ybjg12Wg5dNfuaSj?= =?utf-8?q?7KtRGLTlixca907g9Uc2s63eJlzbP0QbajX8waKoAMFU1d+s5dAHQYlcO9Sg/pDs9?= =?utf-8?q?wjxCBwhOFesH?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1919d4d8-34ba-4d34-3363-08db9757d274 X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2023 15:06:05.2821 (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: u4JIqNpD8Q/HOVrtcP4AAaCACA5BezAuCJoGe5q8wyh510gqzY+1Y6zNfpPNqCrG3UaLA9v8moFjEyAD1I+4ZQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7590 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