Received: by 2002:a05:7412:bc1a:b0:d7:7d3a:4fe2 with SMTP id ki26csp17138rdb; Fri, 18 Aug 2023 12:43:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEWke/5RErQmlNGu8YV2PMx3kZWmnQSPNYXrbknHB+VQLHoZwha6b8BoofRF14a3I6D73Si X-Received: by 2002:a05:6a21:47ca:b0:147:c5e9:ac15 with SMTP id as10-20020a056a2147ca00b00147c5e9ac15mr211102pzc.40.1692387830904; Fri, 18 Aug 2023 12:43:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692387830; cv=none; d=google.com; s=arc-20160816; b=Lb2cvsusFHDIqU4e6DkGtfFohQX5ek+NfmmyLU39zdIyGY2hT2OOkvjhGd6mD5JjDv P+0pRf5tYMOHoMVRtkgZvglgJwzhSXbxqY/fswGjOSbSJibyE6qOUS68KYVCWXfyJZ/m ueq7w61jBcmL/TGELirg2Y4NqDA80Tm1eUcMGEQd8tFsUtnRJNKWkRlwsVgCASgwwkqL n6EGDKDN1GcHfWVTPCec8zGg29Tj8vb1DqVgZpj1RAeEP5Yw676GUiGM5GiMaC4NC7aX ItlJlZBN6DyDoLiHj3bRlIv5lkbq5GKvvgjvuNW9BF+buut4m5XRfTwcaGj1QNG4dneB KUdQ== ARC-Message-Signature: i=1; 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 :authenticated-by; bh=HKKzs+toskPT+cRH3nhyrlRsbRIl27F+D+U0u4JqBP8=; fh=G9/r3ObHYeTjMuQu/3KWxKBH2+wucEcPGH5YyCDrlVw=; b=qFie+IZa9GhjM+Sc9kNdmU0M0AV7UJvqxvmvxe6zvttXY1lA2AmXXFF8Zo+wKHUsvY u48tiFMu+29fLVAs3jrICAh8I1cpr2FZPvStV6qkxAdV8a8Qk7RvPsKI/OPMweg3VPmd xOHDH48w0lPCIF4TZ+abHaqqp/xiwFKTBBDwRpL0K1FDYWoQNQXhbwhg/IdxTLX0v/J8 hZDBTZ0IS15EiQRT6TaLmoQ9Ci0ccVYDAziyeB/IehvhsQCSVzHreetJJSEDWkqFq/wD vCVhXDwGTxIZ4VpSOjyJwxQg+2NEK8MHiCQazYC1twnV4ElI3dyhrmztGG+uHBnOv96f 9jvQ== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x13-20020a170902ec8d00b001b80500f5b8si1998573plg.323.2023.08.18.12.43.27; Fri, 18 Aug 2023 12:43:50 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242873AbjHPIWz (ORCPT + 54 others); Wed, 16 Aug 2023 04:22:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242874AbjHPIW3 (ORCPT ); Wed, 16 Aug 2023 04:22:29 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 390A82102 for ; Wed, 16 Aug 2023 01:22:27 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 37G8M0xM4001217, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.81/5.90) with ESMTPS id 37G8M0xM4001217 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 16 Aug 2023 16:22:00 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.32; Wed, 16 Aug 2023 16:22:20 +0800 Received: from [127.0.1.1] (172.21.69.188) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Wed, 16 Aug 2023 16:22:19 +0800 From: Ping-Ke Shih To: CC: , Subject: [PATCH 2/6] wifi: rtw89: refine rtw89_correct_cck_chan() by rtw89_hw_to_nl80211_band() Date: Wed, 16 Aug 2023 16:21:29 +0800 Message-ID: <20230816082133.57474-3-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230816082133.57474-1-pkshih@realtek.com> References: <20230816082133.57474-1-pkshih@realtek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.21.69.188] X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-KSE-ServerInfo: RTEXMBS04.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-ServerInfo: RTEXH36505.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 From: Zong-Zhe Yang In rtw89_correct_cck_chan(), we turn to use rtw89_hw_to_nl80211_band(). The difference between rtw89_hw_to_nl80211_band() and the original raw judgement is the case on 6 GHz. Since rtw89_correct_cck_chan() is common code independent on chip, if runtime chip doesn't support 6 GHz, it is probably safe. Otherwise, it might not. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c index a338b0a97910..aedabd262251 100644 --- a/drivers/net/wireless/realtek/rtw89/core.c +++ b/drivers/net/wireless/realtek/rtw89/core.c @@ -1659,8 +1659,7 @@ static void rtw89_correct_cck_chan(struct rtw89_dev *rtwdev, const struct rtw89_chan_rcd *rcd = rtw89_chan_rcd_get(rtwdev, RTW89_SUB_ENTITY_0); u16 chan = rcd->prev_primary_channel; - u8 band = rcd->prev_band_type == RTW89_BAND_2G ? - NL80211_BAND_2GHZ : NL80211_BAND_5GHZ; + u8 band = rtw89_hw_to_nl80211_band(rcd->prev_band_type); if (status->band != NL80211_BAND_2GHZ && status->encoding == RX_ENC_LEGACY && -- 2.25.1