Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp8846032rwd; Tue, 20 Jun 2023 22:51:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6RzPmBMJeIHnprpWlz1f+u1IiPk6BG1SQYUJvNua/T2S9RElUbYcO/pjq0yj+Pncu/BCFa X-Received: by 2002:a05:6a00:15cc:b0:668:9e7b:a3c1 with SMTP id o12-20020a056a0015cc00b006689e7ba3c1mr5354224pfu.8.1687326661109; Tue, 20 Jun 2023 22:51:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687326661; cv=pass; d=google.com; s=arc-20160816; b=jJWJtUyKYjKC//G/PP70w0bzrTQ7WJHcqkeEpDo6ja1tVVNE8PBNWL0MzdDaIWXwWs HtDEEhf5Iluu6Rm1Cid4fRK9kqcGJMF/ABBdQvBMkYGgf4uw452aika5r9Bg3ApQKPK2 gb+Di7YGqxR1xoWM5zeb9kXU9iuHvpOlVHDdf0VI4mm303HIkglhNB2OwliGgt6OF26D ntp/jGJJh9aYhH04VSkxvhk+fQALw+dw6o6o3FOlUOvFy6h65bfdlkhp4wGvfjjNyHMM XawB4bqB1XNVtY4ANTupSSLJIGHVT7WZsF3OtbZgTQO7SVRzZgn6kZA47QbqD2fbFMIv kZAg== 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=V2W7MeeYoJAjHpnZBPrbz+KWPIKBQOAP/ttwqdtMG0c=; b=fRocwRMMFHpgMFk6+P/9lAMYZWA5ZFIqvKizI80dmURPFgkJFXd/G49N+qXVuQwYkn oXiNkf7aGW1eAWKL1fiboQhV0sFoittHvsEVIuLjIkobxEjNd8hhPrIkRkR931U4BxU7 Z9CmirwkJfhj+V9C6RlxR8kcZblfjcwybPbxUmM2focF/KVPxBvv1Cb8T3Qa1qLJEFNe im5RSUW6AVm4iBHlwGun3ixucWVKE8Y/PuNoIUUQAS2ZunFn7zW3pmcV/8FZqnc9E8c2 bapVCu213rskCoc14H77Y8ywCaRSDAybH1/BOFrt5153ZWEG3mKnf2tsqHMdykZjstGc OYxA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=HLOWVUKE; 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::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w23-20020aa79557000000b0065f12af3ec7si755186pfq.104.2023.06.20.22.50.54; Tue, 20 Jun 2023 22:51:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=@amd.com header.s=selector1 header.b=HLOWVUKE; 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::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230122AbjFUFsG (ORCPT + 59 others); Wed, 21 Jun 2023 01:48:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229918AbjFUFrw (ORCPT ); Wed, 21 Jun 2023 01:47:52 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2047.outbound.protection.outlook.com [40.107.94.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9458B1989; Tue, 20 Jun 2023 22:47:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Refr58cvqrJFU6+4aA6hNN16815N84AxWM1kIfUylIvfgyNXK6bh3yeIBoUrAHUdaoHGMuNWXR3tLRJ7saaLsN76JpIBnoV4fTWeD40ocTQIKMGNvl88xVMZonKvmfuEs1GIkPlscTLQoFdaZrBkdQim4xDSITY3lF/cRnmtnH5cMw1Pg6J5ZQj+YXc90i3OFn8HMso7/YmWiM28ZohPY18BBVx/c/JEZkqJkyqijW4No0V9wmCiTds/vq0WGwBsSLYYE4u0WKS10Ix3NZCf/xD/lqYzQYcs3wzdJiTbLrZopX/h88jUV6Wk+OdL8iZ8eaSS9c1HOy4vff0jew0QAw== 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=V2W7MeeYoJAjHpnZBPrbz+KWPIKBQOAP/ttwqdtMG0c=; b=aT2nTD/1vqR7FmZYDsAd//KmVNa2NhSPFOHCjcFJKZlMFZlJyJJA9db9tJMrJrYeVpS1Qp7t0+QMH4dPSaRWotVJdpZeFquc9Ubzmu0qMv7CongixFml9wx+envEnE0MEh/QZD7/u7uFQgSLviG8S3q0jdrqr4Q601zzPRI2GKJUanJbZCR/HRnHpa6i3UID/q8NMZ04RMYG6UqGmAOo07+9MRw16AWfN93ugD4Rbsfsvx+JqTh7dtMEmV0v8hhlzOrs4oCLhyxDEIaS/LGsNgWmruQI6/raCREVkBcJQGuBE95JOzsYRTfci8E/+IVYkrHpRiaNE/jWHqj1iU2N6A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.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=V2W7MeeYoJAjHpnZBPrbz+KWPIKBQOAP/ttwqdtMG0c=; b=HLOWVUKEdQ/s+VVBNZ6cIuj3QDdqj7dFaydXbVB7eDhaPqZMd7CP2XOH0hCDY2t1NwEabwrwmgnMX/mtSYwmqK/q/1RV2ch1+P5XlPQAKQ6e32nOUPnx+hl3TFEyatEuve7MFi9Rw6GJOXCRWatmgHdmcxHCz1Fcd0sWxzB0Qd0= Received: from BY5PR17CA0035.namprd17.prod.outlook.com (2603:10b6:a03:1b8::48) by SJ2PR12MB7848.namprd12.prod.outlook.com (2603:10b6:a03:4ca::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Wed, 21 Jun 2023 05:47:44 +0000 Received: from MWH0EPF000989EB.namprd02.prod.outlook.com (2603:10b6:a03:1b8:cafe::57) by BY5PR17CA0035.outlook.office365.com (2603:10b6:a03:1b8::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37 via Frontend Transport; Wed, 21 Jun 2023 05:47:44 +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 MWH0EPF000989EB.mail.protection.outlook.com (10.167.241.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6521.17 via Frontend Transport; Wed, 21 Jun 2023 05:47:44 +0000 Received: from equan-buildpc.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.23; Wed, 21 Jun 2023 00:47:35 -0500 From: Evan Quan To: , , , , , , , , , , , , , , , , , , , , , , , , CC: , , , , , , Evan Quan Subject: [PATCH V4 2/8] cfg80211: expose nl80211_chan_width_to_mhz for wide sharing Date: Wed, 21 Jun 2023 13:45:57 +0800 Message-ID: <20230621054603.1262299-3-evan.quan@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230621054603.1262299-1-evan.quan@amd.com> References: <20230621054603.1262299-1-evan.quan@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989EB:EE_|SJ2PR12MB7848:EE_ X-MS-Office365-Filtering-Correlation-Id: 2c50bf97-b33a-451c-ea4e-08db721b0900 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6D1F66XADojQEHzi1ZXWJdKTHLhBoVRdWgIj8ntD2cEcEO3yzuSMOyU0zik5S5hDbGs+HQXuutBgx2wnYWbHBlY94ZtpoBPO4LmmcZ6DnbvcezgxUuiTOfl2IR/C5E3HF+IHO+BkuW0JWfblDLwF4NTljWWSAbIfbwxP5T0B2cj5mJo3V5x8HO10d+aprsi1YO8yJICqWXGOCvZVrdCIaPrEA95wABBPAgVT9qhqjxyp1qEBAGfTNhXijdNb1eodwrelTWCjpNqzZLoNEDlYDrD9YIi6Mxz1/aht0oxbQxY01bDU5lxZ/Kf0G9kt+jy79Ia0lXM9HHPyj80lrVyxOx5Aq+BwZ4ARUQ2ehWQlqTV8F20q4Reh1+m8Slx4z1P3Xz2KhQ/AsSGAdFM33zPEdh6gt3M6V5aoy1CIPONbLLVyvaltgaCBF98+dWZaeaEd2+jAM9enIBliF29eu4mWf5rSQno4WQhZ3ZfuKbm95/T2IwQRx1fKLq/MWvZ4HrjhV0P5B/kr6vp99pxYgg+ZT/5xu/60aNC9wphhWIfIFhdmo2GfK6EI067oD1J0h1kqXFyK1RKJjqqRPNRxa90lu8trDIB66K2RDFlJMXy/uEvzWwWAduA3IhJwq8/HWVECkIii5jfldGZUZzyWnNrHn65QKVrIw+Hd6xn4DwN5k7bkZ7RC2ozpmQGD7nwTTw7NJj5HsO6UaEeWiO8wwe9KWprjzItVUVZLyg70caB0tz6X12EctpbpmnaJLHqB2SGkJS+z/4me4VsZ5B659xGGfFAc2slGQMk0F4msZlsE8nYfKLG9qmZm75pddxEQl0hIEBXllUx4vVWkS4ecxzII2g== 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:(13230028)(4636009)(396003)(39860400002)(376002)(346002)(136003)(451199021)(46966006)(40470700004)(36840700001)(110136005)(54906003)(6666004)(478600001)(82310400005)(70206006)(70586007)(16526019)(26005)(186003)(1076003)(2616005)(336012)(40460700003)(7696005)(4326008)(5660300002)(41300700001)(316002)(8936002)(8676002)(44832011)(7416002)(2906002)(40480700001)(81166007)(356005)(921005)(82740400003)(36756003)(86362001)(426003)(36860700001)(47076005)(83380400001)(2101003)(36900700001)(83996005);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2023 05:47:44.2858 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2c50bf97-b33a-451c-ea4e-08db721b0900 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: MWH0EPF000989EB.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB7848 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 The newly added WBRF feature needs this interface for channel width calculation. Signed-off-by: Evan Quan --- 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 9e04f69712b1..c6dc337eafce 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -920,6 +920,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