From patchwork Fri Jun 30 10:32:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evan Quan X-Patchwork-Id: 114657 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp10255150vqr; Fri, 30 Jun 2023 03:36:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4kvbUoG+kifYFJdeQ88jOR88pZ45+G4ZXJds2d/Tw4T8UfouhoJSinsQI0sAslm1ooRllX X-Received: by 2002:a9d:77cf:0:b0:6b7:6e07:4951 with SMTP id w15-20020a9d77cf000000b006b76e074951mr2694330otl.25.1688121402415; Fri, 30 Jun 2023 03:36:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688121402; cv=pass; d=google.com; s=arc-20160816; b=R3801ARuYcP9dLzq93etJ0CIEB4WFKMmB5uTch2wurs5yHoHEbo5zhxXrSNuzBS4aQ VkAg6oOUCnfHD576/CVm9KrRdu3SuUNP6lBpFMyl91YKERhjrfquZmoL0PLMArlJUWRw Pl5hCN9KzyXWwtFOhLwOv7CbQ0969hsQrfssZjnche1mPg3ZG7Py1tOGw2nVUen1vhrF OtenL1Q+yh2OSnMZ/Y8ErPIVh5oPp+wPF8a5hQ9TQHNe0VPAqo2dmEVCMBy9Wq6hzBwg vV8XgBBgFQosZOmwTIoFceicjSiPldRUExJv6U9f3UlW3xO5FCDt81SkD3Z1UMcXcYGN faeA== 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=; fh=tZamKbvZatpQvAZ+RR1feUGppizA8+3zYl3Ia8p51XE=; b=B6ecWuAIfevrDsQ8yKgik34B8biHf+LuI9NBWYdeiz7g8fdB9+EtpOU+3tYfcxy3YI FXcOTSGsUyxULwvFAQkznC7S8Tq4jH8DBVZO3V1oLLHFBA+31rrbd63OlsjEwih2I4Wt STEUs+DmwOz57LVskLzsYVzcq3SeVOHTHTdf5Y+HfgfQNnPx7kDDIiXsnCWrV0+79A84 2Q+1pYtJUO4VAw1VUowDdjJRRC8Mo9MQLlhXBdALPKXmDOrIlljOiV5NRHZRHwSVED2h /mhxJAKJIxAOSLfb2euXYGTeiCsGjVqEWbtGJbjDgrPfSPAihAJz1QTWVHcflMNrgJM1 IfLw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=rTCowzhn; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b4-20020a630c04000000b00528d0d8b7bbsi12016605pgl.595.2023.06.30.03.36.29; Fri, 30 Jun 2023 03:36:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=rTCowzhn; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S232536AbjF3Keq (ORCPT + 99 others); Fri, 30 Jun 2023 06:34:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232563AbjF3Keh (ORCPT ); Fri, 30 Jun 2023 06:34:37 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2057.outbound.protection.outlook.com [40.107.220.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D53E30DD; Fri, 30 Jun 2023 03:34:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NWtMc0Zaw6/Pth9VSmhIJF3J0wD802OpLVQrVAfJZ6j1NLPm5k2Qo8EtlVXQHC2m3U0c081fIy2viLe+I9cu6yec10hT/aeXa9myLPRyszN3Td2Cxa6LQjd6E4N+DHsFr10S9rMFToEHqu9OT3E915a8QNRpIjvL3/uuEKxVb2vdk90CslTjsxtvjwCRg5zfNMe3NYoZ1icqdIH8dj4KGBv8pd4LPzD9cQrYNfd2Mpsru1P4LE7cMu88X1j3L2ANVOxM5CHYuEv4YZ8KVjISAZYKOHFcYzkMrDTPaMs4RCGA3DvMZA3SsUQv84BOywsvt/yoJJb0PUjZGX6+gXq6lA== 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=cAycHEny0G5gxvP2lDPK7jeIKjQha6nSEg2dlVZiamO2sQTQ70Lj/IwSfvjp7mAddTqZCpT6dhXma3CLMu7y+sXuDMN5CdLnMz294H16AXmkL4FtspHTZ/ndOXWo8gwtAAFWDKpJLPJodNoIJ/nzFX8hsCrMvg366PfYB3Ms9Jk1xPdV9lBUhhvn4stKUDYoGDiVI3WE3j81x+CX5/B63TOXUoojQfoPj4gimddn87XjV8pT1KnH2xdllHIzg3e4utR8EaRb9ZfejdmcaT46ScjC4zfZSik7bZqyjj1nFSLllK7g/7gieYBgoUnVMWa/OfGu12C4OT0NJrknJR6Qpg== 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=rTCowzhnDQoiPYBFFq5s9WBfTp3gJWfxLdkdKy/hZnnUAbGCBGamVYnCktst80NRDCyTy3QNbyPDbJbX9NRhOmp8XFnEUUE1/RTqyjEmotJ5FDraMZ7zJNGw5E8gFQLYrs2k9gYlPZohvLcfnv2c4B98ybaAOE3BHEHBbwREMZw= Received: from BYAPR05CA0085.namprd05.prod.outlook.com (2603:10b6:a03:e0::26) by IA1PR12MB6140.namprd12.prod.outlook.com (2603:10b6:208:3e8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.26; Fri, 30 Jun 2023 10:34:33 +0000 Received: from DM6NAM11FT050.eop-nam11.prod.protection.outlook.com (2603:10b6:a03:e0:cafe::ab) by BYAPR05CA0085.outlook.office365.com (2603:10b6:a03:e0::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.10 via Frontend Transport; Fri, 30 Jun 2023 10:34:32 +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 DM6NAM11FT050.mail.protection.outlook.com (10.13.173.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6500.50 via Frontend Transport; Fri, 30 Jun 2023 10:34:32 +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; Fri, 30 Jun 2023 05:34:09 -0500 From: Evan Quan To: , , , , , , , , , , , , , , , , , , , , , , , , CC: , , , , , , Evan Quan Subject: [PATCH V5 3/9] cfg80211: expose nl80211_chan_width_to_mhz for wide sharing Date: Fri, 30 Jun 2023 18:32:34 +0800 Message-ID: <20230630103240.1557100-4-evan.quan@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230630103240.1557100-1-evan.quan@amd.com> References: <20230630103240.1557100-1-evan.quan@amd.com> MIME-Version: 1.0 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: DM6NAM11FT050:EE_|IA1PR12MB6140:EE_ X-MS-Office365-Filtering-Correlation-Id: f455329f-e084-4063-cc58-08db79559797 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kIJxXKLc0HPVNAoT+yvortIcRzQkHoI047h52HmQX4N1GcrapD60p6ejfoy57QEBBXVaPZ424bsYWpgDZvUl0LrzSnELnUPQfR/GXm52nxQ9OHHeH0cGUqB3dgVFZ/jCzBjxxrbxOcX3ABq91/lRetW5zrOLGa72R+yV8YLW6k6q5Uf1i/W7Xjr9MSXDiscrZjZB+Z+U5E6FvFMHRl9r4dM4gNVPogOiP9gQHUejg+UK7lW9eLg0+kiEbv+I8s6I67DDGwLBdbQForl94G/fyFM9cigqKmrIDPMFGdEYpYi/iBqnRpvMQXCtb5bLLhho9VhFLALWhKPeKwylGGw97W/emW0UdEFXWpJ53mrVMwi+7D+HMrL8GrNt68WDzW8WXzZeKbwABQjOFlEA3jK3yo31pZXUDJEwlmCBvwckub8dsoxpXBF+bZp1VCPtXiauqgn7fmq709NEzqmcKF2mdclBuJNjO8pz6UpfIpe/PvzIwfcbH93VjTK5ODi6GdYwDj6M4Lv4sNUpkXuOgO62P0S/96mAYw7XEW1icwecqkTS7peRgrtbFer8sRx9bABPOnpIoYAgO7rLYom6DYb8ELvVINNA0xt/9y3xTNfnpIUO78g557OF0slvI76Yb3GxUnb34RkpX/RpB05oI3IklEY1jK0jepZGKaMQN2+91O2Cp0tfNTDNeq7AdwKrdrpGHxmL9S3wqvaXXSbMzDlAZU/Ld4IbTxRb8EB5lUu4A85VFeU/8QEGLOfpIdKgoFdcAPmtFoVYYFVRvnpAEgBXGRxhc4o/0Iym1LtWwiwo5xP8BsA3I78zysEQkPIIUljo/P50AVRmi7CzPFq9h/x/Wg== 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)(376002)(396003)(346002)(39860400002)(136003)(451199021)(36840700001)(46966006)(40470700004)(5660300002)(1076003)(7416002)(44832011)(70586007)(316002)(36756003)(4326008)(478600001)(70206006)(8936002)(8676002)(86362001)(2906002)(26005)(110136005)(54906003)(40460700003)(41300700001)(36860700001)(40480700001)(7696005)(6666004)(82310400005)(356005)(186003)(336012)(426003)(47076005)(16526019)(82740400003)(83380400001)(921005)(81166007)(2616005)(36900700001)(2101003)(83996005);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2023 10:34:32.4764 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f455329f-e084-4063-cc58-08db79559797 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: DM6NAM11FT050.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6140 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770123588069256150?= X-GMAIL-MSGID: =?utf-8?q?1770123588069256150?= 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) {