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: 132287 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp1599143vqr; Mon, 7 Aug 2023 10:25:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEKDzaaMwyDmNiT5SD331I1UXCOCB7D8HSEQY3785ZnlMmnf4xSuuYMHc0Rpckw1QVRdMJC X-Received: by 2002:a17:902:7883:b0:1bb:c7c6:3454 with SMTP id q3-20020a170902788300b001bbc7c63454mr9395228pll.48.1691429151302; Mon, 07 Aug 2023 10:25:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1691429151; cv=pass; d=google.com; s=arc-20160816; b=tw6QdbwI6MjCDpqlSpm8VJIQYuXCdtdEoTWuiEDxgc9WXD/Y9yqOUGdnP+WNzfohUJ sfPqUwBC5pFEThdN92OLRuCmuWnD7nAcOHZ8wcNYD+d10reH5rweZC6oNb64JAl+8Tcr XEbNmA3v/KQ5GweQvo+s98T/k4AIhZk6DanN6bLk6LuMC7vt7liwXo/JJFWuE0wH22PT 09ZKwu9WMI5gN4cZvIz1UkeohLuQ91WFgTJXTut6Ip86iipTFSZEauAwCoIAuN1660EH kim6Vfmo3j1s6J4s02zZJnPcX1Ts66iLO0m5m6Aj4UDquT1ACnlMWtoQVKg3vUJVtejg sYcQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jOP92MESOXRIE8UQeRoit76K7t7rRgsKKFRdemcA71k=; fh=JxyQ9cOxFJCXit3b6bV33e45OVX7DLo5Wt+gwsJ5HK0=; b=D5mqoBePr++DbEuGYzEZuLKTQRW1QHYsATT/DWxLIr8X9faOZYsu+ojqSc57yLUFnk fBpahLfCSJH4WMggWNC2zrwaN1X579qToet44vWoa+iLEDlap1YkaPrZ9IjBCLhCdD6q qIIgWX0Csb0i77a5QBHH46G1OawKa/i3nrDwpqAvwH7oxfnYSVrzkiIS1GWILC8hg1ti ahYF8DflXnCDmR1UUmQiGf7LGeI9YXuJ6K4cxfmYNr1IjjsDEAh8RWWfjirnEpil7y6Y eT5MhdVT3GaSK/zaxoqwWIvwseIkhbXY3KvpVE6WI72eUEEDQzUVrFw4hMZ18ZGAkq0M JPIA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@silabs.onmicrosoft.com header.s=selector2-silabs-onmicrosoft-com header.b=TgNuy6fW; arc=pass (i=1 spf=pass spfdomain=silabs.com dkim=pass dkdomain=silabs.com dmarc=pass fromdomain=silabs.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=silabs.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e9-20020a170902cf4900b001b6ae9f8bb1si6071811plg.75.2023.08.07.10.25.37; Mon, 07 Aug 2023 10:25:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@silabs.onmicrosoft.com header.s=selector2-silabs-onmicrosoft-com header.b=TgNuy6fW; arc=pass (i=1 spf=pass spfdomain=silabs.com dkim=pass dkdomain=silabs.com dmarc=pass fromdomain=silabs.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=silabs.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229829AbjHGPGP (ORCPT + 99 others); Mon, 7 Aug 2023 11:06:15 -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?S7qvdm9U35cIPGDGbCE5DvcfMgiHDoXiAuYIOQZNE5ByRg+5Ag/EXsDmNSUZ8ZmEC?= =?utf-8?q?EdkpKBzZWGKI8ZgaMH4uc0/a2K6GxJaNgQurJ/ulUVEypYH3+QO8/9N8gqYuuwBNi?= =?utf-8?q?+GvZ17beK+NeHyiVW7PbDpj0HFjE7JCfW0xgSX0VvzajszTtEeblj94qvtXu3tdMW?= =?utf-8?q?o2rOV35aFPt7GhtSxQE1QuYprKqkElt8++crxYgjU0l1jtw/YYAxxpm/kE+vQXjnd?= =?utf-8?q?jf9fhRFck6OybgiXMGTImM376Xg3+fgccVNLnLJXvWfCWiYU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koDQ0T+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 X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773592013870226215 X-GMAIL-MSGID: 1773592013870226215 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