Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4745137rdh; Wed, 29 Nov 2023 09:26:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IF1eFKG1OPQSY3zg1XgEFHtr81pwACtwJHkvNlv9TPI8uGEMHt7XT27/053j1dau6RWgOQE X-Received: by 2002:a05:6a20:8f15:b0:18c:1248:bb17 with SMTP id b21-20020a056a208f1500b0018c1248bb17mr22642429pzk.21.1701278804798; Wed, 29 Nov 2023 09:26:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701278804; cv=pass; d=google.com; s=arc-20160816; b=0LUHSOKO4XnjL0fVIMq8TQBJJllQzNJCICf/ddkjr3+h26GaeDWHuihPFoHPa5/1qH hswQLzmTEQCyIAgHhPzkcgEYSEM19mGkusfkUFBSBRkgXSI0ZHHuCdxWX9NR5Z73byhj ftdv3Elkmgm5AWx+UNdUhsHmQsupo5uS7b/zF//1KtU+SwCZi3dygTRSR0b+Ow/3Sxew 1+fF/GCE5cjzwIL4Anp8TtrmLgHxODJNACVqviHn36uybwAR0ABh0niep3SXZGuQdmXE cKO4e+4rh6gdUIYD5nyqtzaFBgP8ZYmPIqDrRjEUCSnGCeEPwcFCMHItV7WUPlQrQUWa coxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:date:message-id:dkim-signature; bh=0QyTTQgV6hkmajaKflSgvz0YeNp0ADekIOT3BnEXqog=; fh=U3RcRvw9RMQalYAm3eeb04S9yFlwSebrAGHu/pKSAsQ=; b=P0Y7olaVaAf8u6TP/iyLHOO7iERsnmEAl/uEcWLlR63bLRYtesy2jI65muO+A6q4gw iCAHJrd5Hyga32FNaQb4N6s3VSYRl7kBDc2DWVKF9DFlcmxX9FdgTnczq+ArN5j3lJH3 y41pEWBfdrpnf5KxiNZigWAhdWndO5DgDyDqVAq1wNdaiWPCt2FN2gk2FlOBo2Bjg1KC ySJZeVCGe/m5/cYfMvLpcV/PQQ8OYnufv6syluwTnarg19TsRU+RAFDctYxICyyLTR4C vVvEFoq7zYfXhxTiaLPFfVrXbOWls+QYIpe3bBPZOSqr1JCR5sw4F1F6RoF4E8C4jS3P 6qLw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=qGMG5TMv; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-wireless+bounces-227-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-227-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 g14-20020a056a000b8e00b006cd8454cbb4si9098801pfj.337.2023.11.29.09.26.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 09:26:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-227-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=qGMG5TMv; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-wireless+bounces-227-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-227-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 26FDE282AAF for ; Wed, 29 Nov 2023 17:26:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5F9EF481C4; Wed, 29 Nov 2023 17:26:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="qGMG5TMv" X-Original-To: linux-wireless@vger.kernel.org Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2057.outbound.protection.outlook.com [40.107.102.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44CC9112; Wed, 29 Nov 2023 09:26:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZOYjOSeX3yCgE3FgG4LB20ltWzrmnGVAjXxMecs3Poj7Z4vn8/nSrK0fkBgmqcOHx+W3eK72Abm/2uq1iQTvRAcRskxzzUllnI00JBbsvNnYOH1KyN9kNc8Kr6gvtwvtbXTW7rnPyUJ7+CjI1mKVdZiWPZqIpW49SHtWr+Vf/5ZAUIU29zjC1iZKpnBxnlbofIrv9IxwlkjNAkI/vRNJO93hN/K9v8tHf/uuBlVviiTq3KjedCxyn7oDOFMwwR+BWWLPnptEU0Oc+erZ0eobH6MU9qQMJE3VmXMRjXoAAvhPLc4/wIY2rZvc8dxaiAj71DL9mA7jdbGpusWYvCGTGw== 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=0QyTTQgV6hkmajaKflSgvz0YeNp0ADekIOT3BnEXqog=; b=O91gzX5Sq49SVpblQOdTu4tNeScUDqcmmBJIJiPVi/4m09fUKLGXeOqUtyXG4KEFMx74P+ySSx4cqCTsqHilHDQRONj1N5iz0RP90pEjPnWu/DO1DMsgY5Q+EMB/4rSFHDxaiw4VBktER/0wDgTlYUKvQlWzBOWux46NOHfaZYa1ZBubup97kULg2P9bYSbp8p5AawfLVe8UNbCl9csg5sRKPif6iesTAHbp5uy3YjMw3+5r9i0LaiX/SZ5rgsLkwQfX1Vwv53ASYU8vzAD5hjYV39EqCjwtBdaU5DS4tTyowSQJOjSqxGPe7ew7f77czLUkmVw4ANuXZaMJ2LYBTg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; 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=0QyTTQgV6hkmajaKflSgvz0YeNp0ADekIOT3BnEXqog=; b=qGMG5TMv7RP47neU0jU/Ymghn1oJhYyhTOBFvqsEhuRwLbL8BmHjIIayCUvCerTjDlO4fyFDfvuHPGGSjB+mv/N7OVkIT9wO1CTzYkMlYk6KwS3Cy0rrfCLS/co9aSmYBeOLjjOOo0MAKBgJRye0Jp8ryqwhW4XtHHs0qtP9Tdc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from MN0PR12MB6101.namprd12.prod.outlook.com (2603:10b6:208:3cb::10) by BN9PR12MB5066.namprd12.prod.outlook.com (2603:10b6:408:133::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.22; Wed, 29 Nov 2023 17:26:33 +0000 Received: from MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::83d7:9c4f:4d9b:1f2a]) by MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::83d7:9c4f:4d9b:1f2a%5]) with mapi id 15.20.7046.015; Wed, 29 Nov 2023 17:26:33 +0000 Message-ID: Date: Wed, 29 Nov 2023 11:26:29 -0600 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v14 3/9] cfg80211: expose nl80211_chan_width_to_mhz for wide sharing Content-Language: en-US To: Ma Jun , amd-gfx@lists.freedesktop.org, lenb@kernel.org, hdegoede@redhat.com, johannes@sipsolutions.net, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, alexander.deucher@amd.com, Lijo.Lazar@amd.com, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, platform-driver-x86@vger.kernel.org Cc: majun@amd.com, Evan Quan References: <20231129091348.3972539-1-Jun.Ma2@amd.com> <20231129091348.3972539-4-Jun.Ma2@amd.com> From: Mario Limonciello In-Reply-To: <20231129091348.3972539-4-Jun.Ma2@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DM5PR08CA0047.namprd08.prod.outlook.com (2603:10b6:4:60::36) To MN0PR12MB6101.namprd12.prod.outlook.com (2603:10b6:208:3cb::10) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN0PR12MB6101:EE_|BN9PR12MB5066:EE_ X-MS-Office365-Filtering-Correlation-Id: 3e143049-49cd-48b6-de16-08dbf100555a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: y5ZpoFpiCSjz1raOeTAs6qRL5oiKOfXX38aFV+GOoTC3+kdrwTzSoUKaQsOE5ZXRGdgV2XrvnEAiFF8tksBklpQzTEV1M0Ww3MOCz+0e5YOOGpv7nxxlPoj1qGETYC3zu1g/+A/XWxd6dci/qhSHJAIWkjy6hOQ97GIAl6CfolZKVqrPhgzExYt4fxNl8PN4nzog0R0sXSVkUzD/MMI7kW0pwZt5H3swHjvMaN7XT6XtzjvqXwJbkEMMEVxObJEF7EWYY8LewylSryvBYqz6WEYyBfDCLd7WWkQf04gRjOu22YdswD8ttcfcOjNS4Qi92gP4LYmjccw9cWfIhULQDsrlEoCePTG+5gWNW2KGYQCV81sr+/RuCaTMp82MoMgYN3cj/wf32PsKobfQGA+FYySCp2XsZzVxzp29sr6l8uHHRJ4Jn5a7LpSvoRpSmjX92wgb2hPFA1hyA8yWcGN/JuiH3v6BoL3Zl65qNAjiexjowdc6NPUu1dzqqjp6PyZf4SyC6yc4JMGgJ2UKcoYYBNfFQs4r6smZYB7tGu8/BtyOk2ROJwDpzaQ3wUPV7iUc8+yOqnRltQtAWO7rbSfyOP/An7s1C6FiHyglYoqgPv/U1lwBZxa03WG+nh7uIdCy/S3YD2TJodpPPU54h1QW8NSz09j0MakDdk7nl2BYpDw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR12MB6101.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(396003)(136003)(39860400002)(366004)(346002)(230922051799003)(451199024)(186009)(64100799003)(1800799012)(66946007)(66556008)(316002)(6486002)(53546011)(66476007)(6506007)(478600001)(6512007)(83380400001)(36756003)(86362001)(38100700002)(2616005)(44832011)(4326008)(5660300002)(7416002)(8676002)(8936002)(6666004)(921008)(41300700001)(31696002)(31686004)(45080400002)(2906002)(26005)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RU5SUWprQnloSmdJSG9pYndDV0piN3RZUjBlVG1iRGF6ZEtMQS9EMHdvd0l4?= =?utf-8?B?L0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2c3pxendhYWFJKzZ4R2RJ?= =?utf-8?B?V2Z2T1Y5bFkxMVZTNGI4QlFpK3VSMDN5bHJDRFBWTFVhejZJaEh3WGxOQVQx?= =?utf-8?B?Z01PWHJLWmhoODF1UVBWdWVXcmw0SWEycEU4OTJzWHNHSmhDNzhqTDVrTm8y?= =?utf-8?B?dVJKUy84N08xcUNMbkJzQlFrUStzVlhSZDZaSVBOY1BFV0hVV213Y0ZyTytp?= =?utf-8?B?RFg0VkFWM3hCWEhGTENjYVdXVzM5dU5SNlFkWXBhUHlCN3JWbm9qOHVkWDJN?= =?utf-8?Q?tzh9fqpUq3ZrJU/YozAy2D09d?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3e143049-49cd-48b6-de16-08dbf100555a X-MS-Exchange-CrossTenant-AuthSource: MN0PR12MB6101.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2023 17:26:33.8608 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HcO1/neCC+Hm9/nZJCtdl7p0aFUaDPFppcXR89YZA2LkBPKFRG7XIbdhGBsD8u9TufQP0G7ObkunmB6GZFHi1A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5066 On 11/29/2023 03:13, Ma Jun wrote: > 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 I think the order should be the other way around for these SoB as "you're signing off on Evan's work". Otherwise LGTM. Reviewed-by: Mario Limonciello > > -- > 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) > {