Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2893093rdg; Mon, 16 Oct 2023 19:56:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGmdHqqPsTS+oyshsvjBJQvH1ZRtcL9iYowCzfYL+GsCdT3dAIP3P8bnIihawIa94wlQyz3 X-Received: by 2002:a05:620a:818b:b0:774:1494:bb0f with SMTP id ot11-20020a05620a818b00b007741494bb0fmr909595qkn.60.1697511392627; Mon, 16 Oct 2023 19:56:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697511392; cv=pass; d=google.com; s=arc-20160816; b=qDPWc0AvdNGGDeEr744+4FeOz1f2CG8XQwVhAxmrAUFlkQSX4qIJ0KR0bLFxSVnI3Q /ygiif2YcwAdTzwhjqq4kqfNli+2ZbR+Hj7Pq2hvdrBwYVflmGOLW2XDj4Z/XqQyPzE8 vkoSVOrAKyk66jw0tToyMg+Plwaod9RErY9fkF10n9D4LMxoJ6dNgRYZrmIq6WzQYdo9 MDej1lZjqwWisjbsmvvV+04AoecnTuJPvvNysqrDRfOHgjHu/UzQ96CpBg0ewTAzwyoJ jBpZC/hLCfdFEcHQu2CyTTLFdzcYhtNwUmVLBcoAfAx75IteAqSl1FWzbCeT3L4xrUyr NJ2Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JWM0UAslXye3DnOqC0H7Rz0HZbhdEltQo516tP/V/w8=; fh=7qYVagjf06Iuxk0RfQNsh9zjCiQ1YqeRICw8mLp4/sE=; b=jxFz7OfRtvSXm5XiBLbAtC+5ttjK5KuBUH31igUTmtvJGzAPEkD87TnC3IPpSiviH1 waL5ltAH3+h3futi0NZw96NU2oCd1/FKbAmmHsx9z3t7FTOJ23sH07lVheYlNONWb8YK yuu/KYVjB3TQINHkYsf45YTdDSGT4DoTW6TkIEK2OKXolr3+UzBuL3uFah83cyqKVJ1O zUx4Oc9taJ8zcpLwjeg8/VSRCyMqFdWLY5E/Mg8OFllbDlbaaJpn5Fc9u+FIZOYHeZ/s zHs8eN0LBW+Ds/PHZrtLy82FjuWeatc/DhNlnmRfoWo4n5S6zvyBsgcAnI+gR4VtwcSB +rzA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=f2B0pjsF; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id t184-20020a6381c1000000b005b34179728esi750586pgd.237.2023.10.16.19.56.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 19:56:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=f2B0pjsF; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 308FD8069D97; Mon, 16 Oct 2023 19:55:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234386AbjJQCz1 (ORCPT + 52 others); Mon, 16 Oct 2023 22:55:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234379AbjJQCzY (ORCPT ); Mon, 16 Oct 2023 22:55:24 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2054.outbound.protection.outlook.com [40.107.243.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95A24F1; Mon, 16 Oct 2023 19:55:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FWcDrHueLGs406bz9HOjmWziDoy71w9sTlmWNcu24vyl+LtJkFAKdWjKUDGwYzwAkzxOgEq+ctDMw9QezRYcd7QH8Zx2ehm2JaTONohiHVbHY5TnqP5vehvhReetwy2cnNFVVjhivQSUhkeVWAHEAJRQw22DL28Hn1Og3iwnDsRKQz5/+YdkvyJR+U18xAc/wU0VPDZwR1OmmCS1NRO35eATbOF9nmaMgkdMcA4nIL6gW4u0PakJqYKF3JTlAyL+3v+4RJGvUuwZh9KKzI0kI0kRnbUThldIWUfEfjtHz3dgerr/EvgGM2a29nBFYRpXp71DbDoNufluZGrFG45tMA== 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=JWM0UAslXye3DnOqC0H7Rz0HZbhdEltQo516tP/V/w8=; b=IfeXKddFHX42pkwnnm7dae08Zk0RL0NjFJXmWCegT7mgWrG14D3kwKnRjjbmtRt8FGDptODTacvAkz/LyMq61lpl/kGy9HiyzQ+jpCCXMCpuhxdhCYOTtF7D4rvNbSrj7FEWJh9IoXkk9zyWFQTWu2dS0CRblg/bldk9jwUuEyYzaCu6f8B3Eh2qRsQfJ4E2iA4KZTEce5YqoGNS9+FkkCM3mCR+Gjp4pir7Lyj4RGXOT84Xdh7aFr11wVS0InURYXGl9nAHaXKnP2N5XgcXmsRPaegRqQPTdLCc9iQIou5J5+xbtCe/Soh/9tWw+vv1Dtuc9BCIsyF7sphxlZ1h1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JWM0UAslXye3DnOqC0H7Rz0HZbhdEltQo516tP/V/w8=; b=f2B0pjsFopWLxQU66/Aq+5Q9DuacZttp6Qq1xnF4kUa+NsWTt8C8osArSHtJb9lEw11sGOU85DiR+gQOvDoMnZcL/nbLvogrS/XHhIlTz71YjCJt0C0filb+MuI6vtlF3ayjlWW+z05YcOjZif8qp5P0pXahpkEhQ71LfMXbaXI= Received: from BYAPR04CA0032.namprd04.prod.outlook.com (2603:10b6:a03:40::45) by DS7PR12MB6334.namprd12.prod.outlook.com (2603:10b6:8:95::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.35; Tue, 17 Oct 2023 02:55:15 +0000 Received: from MWH0EPF000989E8.namprd02.prod.outlook.com (2603:10b6:a03:40:cafe::dc) by BYAPR04CA0032.outlook.office365.com (2603:10b6:a03:40::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.35 via Frontend Transport; Tue, 17 Oct 2023 02:55:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by MWH0EPF000989E8.mail.protection.outlook.com (10.167.241.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.21 via Frontend Transport; Tue, 17 Oct 2023 02:55:14 +0000 Received: from compile-server.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 16 Oct 2023 21:55:09 -0500 From: Ma Jun To: , , , , , , , , , CC: , , , , , , Evan Quan , Ma Jun Subject: [PATCH v12 3/9] cfg80211: expose nl80211_chan_width_to_mhz for wide sharing Date: Tue, 17 Oct 2023 10:53:52 +0800 Message-ID: <20231017025358.1773598-4-Jun.Ma2@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231017025358.1773598-1-Jun.Ma2@amd.com> References: <20231017025358.1773598-1-Jun.Ma2@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989E8:EE_|DS7PR12MB6334:EE_ X-MS-Office365-Filtering-Correlation-Id: 23cb968e-20d1-499e-7574-08dbcebc7cdd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2UsX+G6ZMAePLz9pLrlg50qJo5NZDVpyaNvr6vUc79UiMayWZZIVk5uPZH9M/rUHo9+roYcwpD8qx8w/cxpumk11EkaQiKKbT3zbG9NCtwe6G7/R13f0n/rVkKhXcEh1Wxg/neqT8wFSTUYsu7iq9nDT/iNfYVB/YCO/30EGkSmBR8X35TNv3WUFPqLcto4vt+A/XVZlz6NuXenkol8NLvxAgACO8vijdHhu9acVh/2A79TtjT9IrQGtfKaFsAUVwQz/Zg1TrfV/2LEjFR771W1IEG17tKFEscnJng14RtEtgf0jD/xLfqbGBZiXe8WCmakbF/w9NOO+iLSO/nM/3eXT46a2K6fuOQNiQiYB5Hv1ywbvGrZHbV5j+ThDnyj5YtQIFVOf3EvuM/XaPABLF7kgmcDh//u2ugg8rCdmyexsohnM2pET4QDDwJ9lsc5WWELINAwP/6t2FXEIL4arkjErsuwLNwKHSToPS92OJ5NebV7nF8f3eNPaa67FmocqCjHOR2eb+sga2QlEIOPCSD57OB8qHI8YPuwEbWc94KrNmp7SQUR+ZdALGSVcQQCNwiIdpIzqMrA2KD2c/cnnbV813xXMbNbouxf72A1h2LW1kBTnOqdRDkhUP0NQKTeO6onq6DajLpwcttOFBD54mtAL5bbvmuRozTVmcVqte8S0AQ2sn20FFFskwEEEN/sKfJgAMupfhUEs7V80sCZ+DMkJP4RxVKsDm3QbpWEyPfhwurbt7tg/IjnlKy4Ivf0A3k/yfSS5rJ1lXSypHERnEv3yafi2JCwVrZingb0A9Lo= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(396003)(346002)(136003)(39860400002)(376002)(230922051799003)(451199024)(82310400011)(64100799003)(1800799009)(186009)(36840700001)(40470700004)(40480700001)(40460700003)(82740400003)(921005)(36756003)(356005)(81166007)(32650700002)(83380400001)(36860700001)(6666004)(26005)(7696005)(16526019)(2906002)(336012)(54906003)(316002)(45080400002)(6636002)(70206006)(2616005)(70586007)(478600001)(1076003)(426003)(110136005)(7416002)(86362001)(41300700001)(8936002)(8676002)(4326008)(5660300002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2023 02:55:14.5556 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 23cb968e-20d1-499e-7574-08dbcebc7cdd X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000989E8.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6334 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 16 Oct 2023 19:55:47 -0700 (PDT) From: Evan Quan The newly added WBRF feature needs this interface for channel width calculation. Signed-off-by: Ma Jun Signed-off-by: Evan Quan -- v8->v9: - correct typo(Mhz -> MHz) (Johnson) --- include/net/cfg80211.h | 8 ++++++++ net/wireless/chan.c | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index d6fa7c8767ad..026d91083f37 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -923,6 +923,14 @@ const struct cfg80211_chan_def * cfg80211_chandef_compatible(const struct cfg80211_chan_def *chandef1, const struct cfg80211_chan_def *chandef2); +/** + * nl80211_chan_width_to_mhz - get the channel width in MHz + * @chan_width: the channel width from &enum nl80211_chan_width + * Return: channel width in MHz if the chan_width from &enum nl80211_chan_width + * is valid. -1 otherwise. + */ +int nl80211_chan_width_to_mhz(enum nl80211_chan_width chan_width); + /** * cfg80211_chandef_valid - check if a channel definition is valid * @chandef: the channel definition to check diff --git a/net/wireless/chan.c b/net/wireless/chan.c index 0b7e81db383d..227db04eac42 100644 --- a/net/wireless/chan.c +++ b/net/wireless/chan.c @@ -141,7 +141,7 @@ static bool cfg80211_edmg_chandef_valid(const struct cfg80211_chan_def *chandef) return true; } -static int nl80211_chan_width_to_mhz(enum nl80211_chan_width chan_width) +int nl80211_chan_width_to_mhz(enum nl80211_chan_width chan_width) { int mhz; @@ -190,6 +190,7 @@ static int nl80211_chan_width_to_mhz(enum nl80211_chan_width chan_width) } return mhz; } +EXPORT_SYMBOL(nl80211_chan_width_to_mhz); static int cfg80211_chandef_get_width(const struct cfg80211_chan_def *c) { -- 2.34.1