From patchwork Wed Oct 4 17:28:37 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: 148441 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp292135vqb; Wed, 4 Oct 2023 10:29:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHzqL7/o0UxYebuQQNmZaurPV3EimqTHWCc2k8D17xvRSnG3FYPWyKQcwmLf7DjCfhNCdOB X-Received: by 2002:a05:6a20:9781:b0:166:82cf:424a with SMTP id hx1-20020a056a20978100b0016682cf424amr2626137pzc.33.1696440579952; Wed, 04 Oct 2023 10:29:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696440579; cv=pass; d=google.com; s=arc-20160816; b=umDvA94A3f9F6+K59N2mXcSFknAz+ADC0ogLu/+u1XDNSuGXRBCuogezz59qG3vjwa F6JgUwWF/LDZKKDEsvGUIb9UggiJ2SfSwkLSmIPX/M6vHvz1gj9O1tvDOJ2gsm4H4Yny tngKC2aJp1Jr3oOvTIlSvABJPnsF9C3JFiLuebMKVc30ZZ3AXT7EdTPK8Aui+qthsWSz r9YeOz1n/P9hNvSBx/9rsCVht3i9luSwOkJCRbM216UuaRmQ0pjV1iA1xrS0Wk3Mtsqp 2OQybvTLNEWJbeCq0ULSVGHsBHUvi+ugqzAfeskwiklF7M5j9R2QCEpLmffOFFtOfj7R //SQ== 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=l0GbbulFVEGIByrdVk2PDAYC0467jisoj0AJEvNmoTE=; b=psKyvqyTwc8QMhH9lFp3ajOC8aix+Hku/PYxjPTPxxgSgQolPWpCfOynhhm/qBU5tG YhN0KrTmCw0AaguQWQQXugaAIDaSCfFG/13BmkKZ8jmiooUMFSo+mlAYLaxPMfZ+XaNg BHhRA2mUc5LzPLJ+R9B3xEW9Hnw6VbyBbpUj5kjejtvZfaMQAmFnvPddIOL9mzdS092V ICuqG7bc+5Y0yEm3OSOqvrGJX6oZE6nRlkSnQYhjxiQwFHND5PVT1rjrRHvmBLHVJONI TvmcIizW0FO+Zxv9eyWHry7TdY2QNVkhf/+nRnFqqX0THuu0cQI3trBiQsQUSnXxoxLP XqUw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@silabs.onmicrosoft.com header.s=selector2-silabs-onmicrosoft-com header.b=o75cJpJt; 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 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id d18-20020a056a00199200b00690d4b91636si4250121pfl.229.2023.10.04.10.29.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 10:29:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@silabs.onmicrosoft.com header.s=selector2-silabs-onmicrosoft-com header.b=o75cJpJt; 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 23.128.96.34 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 3CE2E8374395; Wed, 4 Oct 2023 10:29:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243749AbjJDR3c (ORCPT + 19 others); Wed, 4 Oct 2023 13:29:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243689AbjJDR3N (ORCPT ); Wed, 4 Oct 2023 13:29:13 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2053.outbound.protection.outlook.com [40.107.94.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA534A7; Wed, 4 Oct 2023 10:29:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=laRXG6CIpEE6TaINlFtrZ7qAJxhtXgs9k1D5xmIw2S1q3U2kl36+ZzmrIkI0ZdL5Rj5dNqyMU3EGBKrE0J/UEavKIYu7fYGliXAzgYVzlzg9ivzaWosUXipfPfHZpzUDqhfgG7cxOVfZSqqFdwOdqpZZABWfK/3jwqYkcg/X/0TZO0CrNA9GZ3sRvZwqL9b+h8y1E2nJ/6MFQTfgWdkIBT0yZqmOZf5GdmTTjyZRHpJo1N2reWMdkeKawSRnBpF1PTWZQQvbAAV6lOGOk+r2bI9U5yohmItCI68/Bj8MMpA5lQp5VBqefge8k4SDMoMT/jpHVRgCFlstbPqlLyHCZg== 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=EwIaUrNrCW3n84R00YvxajMa9LvmWXVQvvcnYf1NHIh+s7yJ8ftreA+I27kR0tffjzyCsrHxg6t8WKFVOGUxeCB/TsJXxGhfPZkOD18OUcMNC5rw41VPzEiccLSQdvre64rNk/q3FxyP6OhI2LElj8uGwtbhOJr1MnbA6jYY5dHHViMjQk+Pj0M7hLrvsqDwmfml5mBMUR9xBQLMRZF8YGcACP/IfvhNG1IHREicvVwGflIyjEMCEmawbNA09+2hgrFFsiYdfiLKIt+/D8ASxg9XCRSPmjRJXpGVXcy2nWkN6wAMl92d/0LSFr/h/ttBhlzQJ7u7J5Fm9fDzpywTNQ== 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=o75cJpJtJBwDmSxh2rzB5zrJRbxazcd1hTuxaC0/oBY0eyORfHHJza5eQmGMWPimFe+0RVIcIJ2cSZ3WKKqBz9GvQhvwlHNwqx9m7walsGu/FBex0qUSCyjKGTfst+fFuBUf8W1YhvILYKW9zrPFQK6EnDPZXDG9aN0cjSIXX/0= 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 PH7PR11MB5982.namprd11.prod.outlook.com (2603:10b6:510:1e1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.34; Wed, 4 Oct 2023 17:28:57 +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.6838.030; Wed, 4 Oct 2023 17:28:57 +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 v3 2/8] wifi: wfx: relocate wfx_rate_mask_to_hw() Date: Wed, 4 Oct 2023 19:28:37 +0200 Message-Id: <20231004172843.195332-3-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231004172843.195332-1-jerome.pouiller@silabs.com> References: <20231004172843.195332-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: DS7PR03CA0305.namprd03.prod.outlook.com (2603:10b6:8:2b::25) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|PH7PR11MB5982:EE_ X-MS-Office365-Filtering-Correlation-Id: 548c618b-fea0-4d8a-4370-08dbc4ff63f0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: E5V5M2pEkRHL7tLoZAGRO9usdWKX1IrYoVKrdEY/wdpRKt0sUe7D/PwflCy4Udy5t47PlB1xG9zDAmuj+Gdfj/aYupG2mBG2F8ErXbpETkE3mg9YaAYhjbg5Nj5XK0m/UoaRtkn7utDY9XEd0+GmPQZz1Lhpeaic2m+/qgmCu8fxckCGevBGhinP0RR2J4C05ypnEkd3YpoO59YwyGaiQuTWrZPahiA33BnpH+SIrOF1pLTdWNWU2k4BmBPg4tr1i9kvNRTv+qJ+BsL0zGjtOfVXPWX9/qIdplJftU6wfdE+GsRtYZVhc/Ecbm+kjhRUxNDAxC+mbk1Bft18kDY1xfa+nL6tCF8LuSoBPtvum/UC+8m12zjbRAsPL7vPC3o3WkR8vK1lT1pNEBlQ42KwFLwSvgYd3z1vT/xfLJJbemPwr1aWUsrX9uU2+Qr3nHrDwObAg+U2Qm9dqvOl+WihAmBQEt3cOxT1vtVtRlA5FidZdk8MsB6LaLrSuzImJ/f7lPteo6dcLMMxVuEl6VGJHGGDA/4vAoTLxRPrs31gM9X8IyAvQpxU7j8lHNgAlSl/ 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)(366004)(346002)(39850400004)(396003)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(6486002)(36756003)(6512007)(38100700002)(6666004)(52116002)(86362001)(478600001)(6506007)(66556008)(66946007)(66476007)(316002)(6916009)(41300700001)(2616005)(107886003)(1076003)(8936002)(4326008)(8676002)(66574015)(5660300002)(83380400001)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?nNS6EAs0e0OneECAWo/7Igh3Sa6z?= =?utf-8?q?PgO4BFarHWGdkt6/usd0nDcday1ZHvYKkBB2R996KGUKwzBZTFk4sFW9IQZCyuFw1?= =?utf-8?q?ZcsHCcuBnCBl26B+q3BwIDDtFCjK8I7qs0Pcn+4NO0q/rOjUolS6kfbuXZAzGo3T4?= =?utf-8?q?x9w3pCVLihcPzM7OBd3uYXMdyNJcEeoHTEoSoTcxgYxJtmuV4LFGgZwby0BGu9n/E?= =?utf-8?q?+bC6PDuO8a/4eciGk1iHT4NW8IrpEkZ86ZxVacwNfaFXz+w/tRXa0mcwKUEl5p5M3?= =?utf-8?q?ZMRZfjHazrb/3H6EnZP2w1n6Ywk5pSLAotPm5AJC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wCQcnEe35+cRYfugiAcffyY9?= =?utf-8?q?ERVlm2tYB8yuVpvGeqmdI1Ng+l7t/+/kGA1ZDzf/tEPa85cFrftqItXbgC8zNm1cc?= =?utf-8?q?7GFfN0WO4a3a7CEn1YRM2Nq+Vx9X4H/xajhuKiB0Tp0zcOLVaP6HSBvb3yAONlNeg?= =?utf-8?q?+ZFsuTwbypj77rIwyFtVMF0LWZFtBcvNvkqGNaxIvJMxi8GEZnakfocay75jzLOgD?= =?utf-8?q?m/so5P4U62iZQbMEqDKuiX6VdDRu/pP/eMnO+VLE9IX+Q3NFkxr52Nvn0LiidpTaN?= =?utf-8?q?XsrK0xQ7UoVOPWtyMG+BPy+FaM47bbL2CLoS1+zk7hYm3wM1qxUv4icpkOVQfWdPB?= =?utf-8?q?klEYUrrKgANYEynH+KAF/LHYJ3URHVK7uleSc8JWFUysvGAlw21OmY1E7kvQW0u5g?= =?utf-8?q?Aa+1yNTJwqq?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 548c618b-fea0-4d8a-4370-08dbc4ff63f0 X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 17:28:57.7424 (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: LQnnQKM3fmwn5kY4P+c5GcbRVYh5D9RpG30S1/Hnwe8rZ3zFlm7C4R9jmEbdf2J4PwpfmF5szXaJgSCX3gbWRA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB5982 X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,RCVD_IN_DNSWL_NONE,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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 10:29:39 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778846877276270218 X-GMAIL-MSGID: 1778846877276270218 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