Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp748490rdb; Thu, 8 Feb 2024 22:54:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IFSp5S1INLmTxXWFq48ZGAHEkkDpK/s6V5MYY4RzcqVbtE0+0I2eys5IVOgGYAit4Kc2ktp X-Received: by 2002:a17:906:250e:b0:a38:8d35:c8b4 with SMTP id i14-20020a170906250e00b00a388d35c8b4mr416510ejb.46.1707461657337; Thu, 08 Feb 2024 22:54:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707461657; cv=pass; d=google.com; s=arc-20160816; b=xoduDSTJjxsk0SLwE34kbzOY54GF/0UXwzV2B1gw/dY1RrpxKfU/PivGBbVI1dpaOw w513np0VNccsWQLSGOWvCf1Y42SlZ/XOUybrq9m+Y7W+WW6DibB5BL5DdbC1ejuNq63J tLGbCOz3xcUTRyBPqxcZWeTyRelrKIPT9JBjmAXbwU8vkRcuEg/7WIvyEDaXppjQbmTI uzuUJrzVPTR0I3j5jenRlmsxerfhNRpnogIM2nfuOqqplPAUsm6WyK7G+9VmcaMk0oFK Fo51Q4F81CfnA86qzYQkVeItRJVHJgapXzrIZChV+YRuN3NxohYhya56qpqt+5PrIHen G4jQ== 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; bh=Y7Mwb5GflgBcH8pTWbsLy3MboqI8DwZEflsIoYUhNdk=; fh=K7JhCTp/k/0WuGtRx+UwDvY5sZtwzfIZ93wv5+RS3+I=; b=J6zRD58FRag0aHfwVJ8wz4pf04yI2zH4Ry77qZ15x77or8bjuZcIrfGLl4mIYBEdp1 ssAydhjnHi2TWxTu2fSCU9DwpoDpv4h2o8nwvGbpJXKdO70j68+UgUVxnsKekZFFrFRM 3dOPwBjJ5Orbr2+7BDpq2bgwlwfr9Zq0lFSWjJeECmlL2MQBwvky4Mp1faZAACvq9zkD WCr2iZX8U4lkBEcRGxamOmqbqFXftbDfPjDe/pMio/yWh/4hsO6xOZDhZkWnWpmdiYeA Qk/Wx5tWpQJi05gajXlUd0+Frb1IjxfffehktK+gdl66dJFvJIvMjmkGdEYo0YGrqfGa q/Wg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-wireless+bounces-3376-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3376-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCW18rwPBKX6pCyK4Y8ZidRFfGRFclGvKLVh+f1TihmtUT7+00q+iS3NIdlodcMYsqssx1vhL3DnqI4yysQuqg26arBnJCF7H/NU0c+m2A== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id n7-20020a170906118700b00a385a10b9c5si524032eja.351.2024.02.08.22.54.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 22:54:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3376-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-wireless+bounces-3376-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3376-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 17E201F29112 for ; Fri, 9 Feb 2024 06:54:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9041D657B0; Fri, 9 Feb 2024 06:53:55 +0000 (UTC) X-Original-To: linux-wireless@vger.kernel.org Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DBE21657AB for ; Fri, 9 Feb 2024 06:53:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707461635; cv=none; b=twD4dx62qJ90ekDb10z9vMCkHyvnUbm6PKLxYLI5D4Rj7+ooT914JgJh1YVQEQTxgmo+OJUJniqLmu/yppzcAe7SdAgse1T4ur25X6amjFUvgrYSgBG4BrCBJs8VrCc0HGai/Lwj9AIwiRjGp4R3vuMcYiKYu3o4MW/6cv0CklY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707461635; c=relaxed/simple; bh=66lXwcibHzZayG4J8SABxxpqV/qiw6kZGGIqA3nXMM0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=m/5flYYCRWuuOt4Uun2X+u45BNFWFv7wWHOaxu6f3MF+nv9PD5lkhVq7PRGvP4S0qxBpHmFxF4Q8RwC+LxQiCyO3xEQ9xJMgNuC5DJhbFzdYMmtBm+8Wp5SqbpO8bWtAi1rlvYOMsVledXOS9OUEdUW1zDYBM7GXSrW+U+8OKP4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 4196rmavF548409, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.95/5.92) with ESMTPS id 4196rmavF548409 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 9 Feb 2024 14:53:48 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.17; Fri, 9 Feb 2024 14:53:48 +0800 Received: from [127.0.1.1] (172.16.16.210) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 9 Feb 2024 14:53:48 +0800 From: Ping-Ke Shih To: CC: , , , Subject: [PATCH v2 07/11] wifi: rtw89: differentiate narrow_bw_ru_dis setting according to chip gen Date: Fri, 9 Feb 2024 14:52:25 +0800 Message-ID: <20240209065229.34515-8-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240209065229.34515-1-pkshih@realtek.com> References: <20240209065229.34515-1-pkshih@realtek.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: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) From: Zong-Zhe Yang When there are OBSS that cannot interpret 26-tone RU transmissions, we should disable 26-tone RU HE TB PPDU transmissions. So, add registers accordingly. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/mac.c | 12 +++++++++--- drivers/net/wireless/realtek/rtw89/mac.h | 1 + drivers/net/wireless/realtek/rtw89/mac_be.c | 4 ++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c index 44d5195437de..16690295b73e 100644 --- a/drivers/net/wireless/realtek/rtw89/mac.c +++ b/drivers/net/wireless/realtek/rtw89/mac.c @@ -4619,6 +4619,7 @@ void rtw89_mac_set_he_obss_narrow_bw_ru(struct rtw89_dev *rtwdev, struct ieee80211_vif *vif) { struct rtw89_vif *rtwvif = (struct rtw89_vif *)vif->drv_priv; + const struct rtw89_mac_gen_def *mac = rtwdev->chip->mac_def; struct ieee80211_hw *hw = rtwdev->hw; bool tolerated = true; u32 reg; @@ -4633,11 +4634,12 @@ void rtw89_mac_set_he_obss_narrow_bw_ru(struct rtw89_dev *rtwdev, rtw89_mac_check_he_obss_narrow_bw_ru_iter, &tolerated); - reg = rtw89_mac_reg_by_idx(rtwdev, R_AX_RXTRIG_TEST_USER_2, rtwvif->mac_idx); + reg = rtw89_mac_reg_by_idx(rtwdev, mac->narrow_bw_ru_dis.addr, + rtwvif->mac_idx); if (tolerated) - rtw89_write32_clr(rtwdev, reg, B_AX_RXTRIG_RU26_DIS); + rtw89_write32_clr(rtwdev, reg, mac->narrow_bw_ru_dis.mask); else - rtw89_write32_set(rtwdev, reg, B_AX_RXTRIG_RU26_DIS); + rtw89_write32_set(rtwdev, reg, mac->narrow_bw_ru_dis.mask); } void rtw89_mac_stop_ap(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif) @@ -6206,6 +6208,10 @@ const struct rtw89_mac_gen_def rtw89_mac_gen_ax = { .mask = B_AX_BFMEE_HT_NDPA_EN | B_AX_BFMEE_VHT_NDPA_EN | B_AX_BFMEE_HE_NDPA_EN, }, + .narrow_bw_ru_dis = { + .addr = R_AX_RXTRIG_TEST_USER_2, + .mask = B_AX_RXTRIG_RU26_DIS, + }, .check_mac_en = rtw89_mac_check_mac_en_ax, .sys_init = sys_init_ax, diff --git a/drivers/net/wireless/realtek/rtw89/mac.h b/drivers/net/wireless/realtek/rtw89/mac.h index b0a3b2a9eb5b..c5ebac1d5990 100644 --- a/drivers/net/wireless/realtek/rtw89/mac.h +++ b/drivers/net/wireless/realtek/rtw89/mac.h @@ -898,6 +898,7 @@ struct rtw89_mac_gen_def { struct rtw89_reg_def muedca_ctrl; struct rtw89_reg_def bfee_ctrl; + struct rtw89_reg_def narrow_bw_ru_dis; int (*check_mac_en)(struct rtw89_dev *rtwdev, u8 band, enum rtw89_mac_hwmod_sel sel); diff --git a/drivers/net/wireless/realtek/rtw89/mac_be.c b/drivers/net/wireless/realtek/rtw89/mac_be.c index f4b51183e3f4..6388c56a3c90 100644 --- a/drivers/net/wireless/realtek/rtw89/mac_be.c +++ b/drivers/net/wireless/realtek/rtw89/mac_be.c @@ -2400,6 +2400,10 @@ const struct rtw89_mac_gen_def rtw89_mac_gen_be = { .mask = B_BE_BFMEE_HT_NDPA_EN | B_BE_BFMEE_VHT_NDPA_EN | B_BE_BFMEE_HE_NDPA_EN | B_BE_BFMEE_EHT_NDPA_EN, }, + .narrow_bw_ru_dis = { + .addr = R_BE_RXTRIG_TEST_USER_2, + .mask = B_BE_RXTRIG_RU26_DIS, + }, .check_mac_en = rtw89_mac_check_mac_en_be, .sys_init = sys_init_be, -- 2.25.1