Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4438567rdh; Wed, 29 Nov 2023 01:15:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IF3y5XWG8USzK5sPOaUy6AlcXD/RSSmmjoqYsaDoxJiDxlPUoYouMSOumxzNyz++jM61+uO X-Received: by 2002:a05:6a20:1444:b0:187:23f4:d061 with SMTP id a4-20020a056a20144400b0018723f4d061mr15190961pzi.37.1701249306341; Wed, 29 Nov 2023 01:15:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701249306; cv=pass; d=google.com; s=arc-20160816; b=xbyyGJx4ecwBoDXEjBDImWak4+k+5beCxoc01reLxg5DaZ6bV92ke7sks32ldG4uLz shAEhnWfgc5N/AVm8mOdxuOSoeu7PEtKRiT0hS3FRysDfm0NzMyGXqeNBhVOw++E5rt3 hXLRlpaxwlLIjrq+pbyWqyHFyPZxt0obO28BgaEqnK3X3mJdt+oXlEai6lR1JpTp/8Lw a3QLSoFjJLAzmYn0b4ppKhjw2tx4vNsSdd+79/Y+G9YgxOJgSzUlc23w5CfooXm/zqbo J40Y9OFHu6irsBWHu0WH4AQIaS43nwVak4yYiGKx2vCmQJmLCwtAFRlB+NP8Q/Wgavay Jehw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=bttUKqwJUPN6jJABYzXAVbvz0oMxc1gHVVluGh6R+j0=; fh=lEi7TWq7sMNvk3IAe55wFeCBsfaZRx5ZDKS29bJlqjY=; b=hABAx5hHtp0uDx8EGDjD0AUuKgOLdsLTELJakGg12i0ZE5RZWYC2jX0TypZbARGrya AXxr8D4CKyfImlIXMM/nVs1LX+Q2Sbn+OWS3lVOqAM+FLeML6jeWXCaSIQGmD6pYgkd3 xOEGmJtCHOeijr66yPAVT5bk3AUkyOm2WYBmscrX3bK4DsdVf5UpM4d+zNqsDxAxHGO1 4Bh6kiqIyhuiGyZSxBlIhnSYxrUIkVLVp2lupTOSrEZ57L5e7tHsyqnx+kYomVBWi6da UzjWk6FT/WvSca9bSG8/Ttj50fHsuUJOLVVSllx/XDB1b02YKnlXvJIKA9DqUuSMnfbv e2MA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=Xv9UV82R; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-wireless+bounces-201-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-201-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x4-20020a1709029a4400b001ce5b9c6181si13414725plv.549.2023.11.29.01.15.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 01:15:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-201-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=Xv9UV82R; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-wireless+bounces-201-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-201-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 03510282E72 for ; Wed, 29 Nov 2023 09:15:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 06F7613FE6; Wed, 29 Nov 2023 09:14:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="Xv9UV82R" X-Original-To: linux-wireless@vger.kernel.org Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2042.outbound.protection.outlook.com [40.107.237.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52E3510E4; Wed, 29 Nov 2023 01:14:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bzlyTDY5xSR/g2IpngCwxosfuGK17lIjoSAZTz5Mi+trEI6/qUxce5/C7RgK4WqhVj98jnweE/ZgT9m05ISKD9GOwXeoTFpZGgVOkoeyUW+rGce97h4yeSBuVjm6vII8bmnR+wqrdmxqm9o7+aOW3yLl9rGJbhUB7qRR9fICvzqvzOlODskJ4VuqM5wFC56Lbg1PuEkpm9fjNILytPqJs73i4D2DN0frS4aWA1N4BFgXhp1lUiTRe/+0+J0ck+H0c8fjjwS4173HiTKbzH0Cl+JsB/9vTMjqX//ximqfG9jFDCuf3mTEXTv3aAFqPGZLsMxpK6fD+bEDJlBc2VyY9w== 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=bttUKqwJUPN6jJABYzXAVbvz0oMxc1gHVVluGh6R+j0=; b=GvB0WChiLmB4/OLmahkxMpkTNYzN3+uC3oWxnUPHpJ+Xnv2Vtyr3GYdXwTL69DiI9cp3C+ky4ENEN+nVbCX4ZPbflIuvsrbux6uKCkp+HMB7Vm5J32+6uZ3riRUXYCkl1IZfite9poz7I8fgXN/eZij7/WDPUCrwlCilWmWGbeoqEWXOZCleJX/lv1EKnmK4Psl6hOYfyL5rc8VXTIlt6UPUpibcqkSrSKjbJVINzkrBv/r1tkkj6BXj3dGToUhVXsIOyfEs3S/BVIiBChfpkvikAoac7tDn67ap6BufsMHh/TpebLgMvE0U1O/ZEJtMhiulHwmZSntRGY/p7Rje0g== 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 (0) 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=bttUKqwJUPN6jJABYzXAVbvz0oMxc1gHVVluGh6R+j0=; b=Xv9UV82R2mpHglioXAEn0Cw8Vv7d7TaFpjaR25+KzZOFLtHhWEQ2uK/Qa/4ZvzwnAXzU4DL/Ty0Dz22pptyOwfZCh4mibuCa9uajrFqGaeuKrBO85cGhkj4KJDxKRnYj3rRvTy2Hzq1+E7N7Qjq8gDV07bh0Rfv9bx1LQlF65gw= Received: from BL1P223CA0030.NAMP223.PROD.OUTLOOK.COM (2603:10b6:208:2c4::35) by DS0PR12MB7996.namprd12.prod.outlook.com (2603:10b6:8:14f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.28; Wed, 29 Nov 2023 09:14:38 +0000 Received: from MN1PEPF0000ECDA.namprd02.prod.outlook.com (2603:10b6:208:2c4:cafe::78) by BL1P223CA0030.outlook.office365.com (2603:10b6:208:2c4::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27 via Frontend Transport; Wed, 29 Nov 2023 09:14:38 +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 MN1PEPF0000ECDA.mail.protection.outlook.com (10.167.242.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7046.17 via Frontend Transport; Wed, 29 Nov 2023 09:14:38 +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.34; Wed, 29 Nov 2023 03:14:32 -0600 From: Ma Jun To: , , , , , , , , , , , , , , , CC: , Evan Quan , Ma Jun Subject: [PATCH v14 3/9] cfg80211: expose nl80211_chan_width_to_mhz for wide sharing Date: Wed, 29 Nov 2023 17:13:42 +0800 Message-ID: <20231129091348.3972539-4-Jun.Ma2@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231129091348.3972539-1-Jun.Ma2@amd.com> References: <20231129091348.3972539-1-Jun.Ma2@amd.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: MN1PEPF0000ECDA:EE_|DS0PR12MB7996:EE_ X-MS-Office365-Filtering-Correlation-Id: f2845fb7-8307-48cf-1d45-08dbf0bb9cf3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dsnStSmM/6vAIye++eR5XIS96HmSWlJ7KHwkC0FFRBOvgpDVALJd9MKAb5vTn323PnWRHo00xSEZIWxXjx4nNLq6J2lHHwuftCwMy/7vo0PC96hDqbZ5RKRu2mugcoVAk+a79usi/HQZx5hFeQMgm6WS76sQv+LkeV+q5WX1iYJnB2PfMnRh6szka1Jec5FLzQFST/Tb0uDT+fDgiFuSPy8FbAgvEDTwnJ9HlekjC7PuKxsXY6i8ao5MQu1AZdwNh0qhUtjVLLI0fomi8a4J6nRaPbqHkmXLCJ3yQGIpIyCsUac0JYoZOVsDm46knrvqEY+Lgoh61jWxWb7WVlQXDIcewhqQ+f9kqlyu9gD2YRSH+CxdYRM3xLdASlT5aCyvVoGP/wM9pspI4Le4IdGWO/xgv7I5omC0ujGOtX+9UzYMjd2W2cFxp2hP5jLtjgDnaKaTvqXWHYhuiLWG0oObiSI/5t+Rgs2G8bqaPluJpaVczD3mhySSa/GL/iuHVf3VN66BtU8sWvNl9iNmCUjjtRh2npeV/wIrDQBO1XOMsShTJNm7Mii+9CW/6GG+ADjgQ6bv6+erUPiS8xTc8kjzbIJCSyEgCKUAkCK00O+elp+EZNM/qGWOn9nZaIHdUOA++gIdDuSJO9ttLabsa9eU/7kgU9zEx6vVlEgG2/0Xx7AMs/0mrA32F/qHLEa/tQno6ArzCfCsZsSTREUhFty89RNTRRp2x1fw0DaCkLZCMVvXGKRKlX6u8x9YjC+OoqSxjg+OwZ79W/uNR6ruQexK14Akc3swLRo9qxtlMBp3qdg= 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)(376002)(346002)(39860400002)(136003)(230922051799003)(82310400011)(1800799012)(64100799003)(186009)(451199024)(36840700001)(40470700004)(4326008)(41300700001)(8936002)(2906002)(40480700001)(8676002)(336012)(2616005)(7696005)(426003)(86362001)(316002)(921008)(54906003)(5660300002)(7416002)(1076003)(478600001)(36860700001)(32650700002)(82740400003)(16526019)(36756003)(26005)(6666004)(70206006)(110136005)(45080400002)(70586007)(81166007)(40460700003)(356005)(83380400001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2023 09:14:38.5317 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f2845fb7-8307-48cf-1d45-08dbf0bb9cf3 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: MN1PEPF0000ECDA.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7996 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) v13: - Fix the format issue (IIpo Jarvinen) --- include/net/cfg80211.h | 9 +++++++++ net/wireless/chan.c | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index b137a33a1b68..08f0d7184167 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -976,6 +976,15 @@ 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 2d21e423abdb..dfb4893421d7 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