Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp3096rdb; Wed, 7 Feb 2024 18:36:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUM/LZCBvFhvr0oFpkgZu/zqHKtUv165BZmpYMiM8lXSUwe9ySvOmBHv3TOMlEt66p4ucAnoEHYho1jheRuInSsY4Phmeok/FntkQvWkQ== X-Google-Smtp-Source: AGHT+IHGwKXC38bErATJ6UyaLlW1bdfTg7ldDVDhvuZHI3LhKTfjOGQfBfJRSce42zfMdRgVHexJ X-Received: by 2002:aa7:d1c6:0:b0:560:dbcd:61df with SMTP id g6-20020aa7d1c6000000b00560dbcd61dfmr2567286edp.29.1707359799078; Wed, 07 Feb 2024 18:36:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707359799; cv=pass; d=google.com; s=arc-20160816; b=COJ+ghII4DcXVWuGgY6lRtn0jiv2s6RR3oORoFXnO3aZjk1W5kUasYqv4rfWqerJUq uc7Tq7f4B4pz2SD8B0FZZ2aSxa2MGHu6M33hjPaxVSEHvxkC/dRyo/QxLdNHppXBeqRN 4D4atrJe2sS0UhVkzR5UccwQAAI3yYzo5XIWaWRQU9e5G2RGxoRdUl9hG7E6M+UxMHcA iupq4NlTLbcCIfOhkNvvoeUqng/UPLmDdoMsZYEw4rmWvXfFtcfzZeibN0bR9EY1Dx/G qbSsAKL586uBX9Hka1fCO7ND/O6BMcLCwr0IwJtlfztvShyCh1AxZM3zMPW3EDKLP12e ae5Q== 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=k0bfjC34+WgmCI5k/v7HrJgkGUdSYcZW9V9wz27LL4Y=; fh=YvoeIkQTEbINr8I2woTccOhDRBcfaO8VOqv6vivw2oc=; b=mKuvUh9xQzyaE679BNkiEyeDHn/X60Je14ssRTORJNiNrrumLl+Q0z40Fry9DhOUh9 IMI0ztTP79VkYGsGGb2Dg4ocuhGekYnVOgoAKGbjwu/yAfp1MoWRuCIDmU3yArPMqGmX 8th/yZLM5C8lrgyBpVmEpMjcQKk8vCqnaWGiA/sTYRx2dVWC0AG9o6hVVeG+lBUJhET5 R+YhgP+rq8mjBwXFhrkFrCoDfgxbMetk+HeA8NdlkQCMew/hnR6FyQgEuTpFsWTmZOGO /QUkOoXyoe8AkyKwepfnFL9oKG+2ZpPF8mxB6QRCGYs+CbgQH+5MypfbIGrC2AyZiciV AMLA==; 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-3318-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3318-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCXh3QrOvpA2cW61nqIZK992nebbkeP6vSUI4zCWIZ4SMuCBVST5bMfVeW/ak19DitMpnIq6HG7B9fZIOnpZN6xppbNcOIP6qYdOCWWr3w== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h19-20020a50ed93000000b0056024727ba4si392446edr.323.2024.02.07.18.36.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 18:36:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3318-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-3318-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3318-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 551741F241F3 for ; Thu, 8 Feb 2024 02:30:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 01E3E10A0D; Thu, 8 Feb 2024 02:30:18 +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 1DBE3149E03 for ; Thu, 8 Feb 2024 02:30:15 +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=1707359417; cv=none; b=k4CEFfP7WLBol05JiooLVea77/SJDZ719FB3EBEv7xRICfUj+o+f3apczI+oHU38TdWWfOVcclKTkXB1dRAloQAnVD6pJolWL5szdk233ydRxd+ynJDVUNhbZqz4qadpuhSFRgk5uJ90VZbrIBDvI9iS8m+pWgjS7Xd5zRiPSvQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707359417; c=relaxed/simple; bh=Gqnm/gVqc2JGfTxIppAPs8VgVuKtVFeqp44sbQjHpoU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Hs05+MqUonjFfO9rsXOuunmJxbxSj0PvlTx1MwBc1uPYVRtllPZOGxLHC9LGXstxd2hl/58rnqZCZbfpst2fZ3yYfSavDATDs/YCTmRyZd8mIHyyOKUgsoRcpXJVVMvkAaL5EjaPl7kofLkaEnzv/johH92bqpTD9RM3mUa8AjI= 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 4182UAEw8192080, 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.95/5.92) with ESMTPS id 4182UAEw8192080 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 8 Feb 2024 10:30:10 +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_256_GCM_SHA384) id 15.1.2375.32; Thu, 8 Feb 2024 10:30:11 +0800 Received: from [127.0.1.1] (172.16.17.45) 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; Thu, 8 Feb 2024 10:30:10 +0800 From: Ping-Ke Shih To: CC: , , , Subject: [PATCH 06/11] wifi: rtw89: use PLCP information to match BSS_COLOR and AID Date: Thu, 8 Feb 2024 10:28:52 +0800 Message-ID: <20240208022857.14379-7-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240208022857.14379-1-pkshih@realtek.com> References: <20240208022857.14379-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) 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 Hardware can use spatial reuse to reduce interference in OBSS environment, and originally use MAC header to match BSS color and AID. Change to use PLCP to match them earlier to prevent margin timing. Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/mac.c | 3 +++ drivers/net/wireless/realtek/rtw89/mac_be.c | 3 +++ drivers/net/wireless/realtek/rtw89/reg.h | 14 ++++++++++++++ 3 files changed, 20 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c index bad716cc9839..44d5195437de 100644 --- a/drivers/net/wireless/realtek/rtw89/mac.c +++ b/drivers/net/wireless/realtek/rtw89/mac.c @@ -2537,6 +2537,9 @@ static int spatial_reuse_init_ax(struct rtw89_dev *rtwdev, u8 mac_idx) reg = rtw89_mac_reg_by_idx(rtwdev, R_AX_RX_SR_CTRL, mac_idx); rtw89_write8_clr(rtwdev, reg, B_AX_SR_EN); + reg = rtw89_mac_reg_by_idx(rtwdev, R_AX_BSSID_SRC_CTRL, mac_idx); + rtw89_write8_set(rtwdev, reg, B_AX_PLCP_SRC_EN); + return 0; } diff --git a/drivers/net/wireless/realtek/rtw89/mac_be.c b/drivers/net/wireless/realtek/rtw89/mac_be.c index f3c82751993c..f4b51183e3f4 100644 --- a/drivers/net/wireless/realtek/rtw89/mac_be.c +++ b/drivers/net/wireless/realtek/rtw89/mac_be.c @@ -988,6 +988,9 @@ static int spatial_reuse_init_be(struct rtw89_dev *rtwdev, u8 mac_idx) reg = rtw89_mac_reg_by_idx(rtwdev, R_BE_RX_SR_CTRL, mac_idx); rtw89_write8_clr(rtwdev, reg, B_BE_SR_EN | B_BE_SR_CTRL_PLCP_EN); + reg = rtw89_mac_reg_by_idx(rtwdev, R_BE_BSSID_SRC_CTRL, mac_idx); + rtw89_write8_set(rtwdev, reg, B_BE_PLCP_SRC_EN); + return 0; } diff --git a/drivers/net/wireless/realtek/rtw89/reg.h b/drivers/net/wireless/realtek/rtw89/reg.h index 20b538526541..31bdc7616749 100644 --- a/drivers/net/wireless/realtek/rtw89/reg.h +++ b/drivers/net/wireless/realtek/rtw89/reg.h @@ -3246,6 +3246,13 @@ #define R_AX_RX_SR_CTRL_C1 0xEE4A #define B_AX_SR_EN BIT(0) +#define R_AX_BSSID_SRC_CTRL 0xCE4B +#define R_AX_BSSID_SRC_CTRL_C1 0xEE4B +#define B_AX_BSSID_MATCH BIT(3) +#define B_AX_PARTIAL_AID_MATCH BIT(2) +#define B_AX_BSSCOLOR_MATCH BIT(1) +#define B_AX_PLCP_SRC_EN BIT(0) + #define R_AX_CSIRPT_OPTION 0xCE64 #define R_AX_CSIRPT_OPTION_C1 0xEE64 #define B_AX_CSIPRT_HESU_AID_EN BIT(25) @@ -7208,6 +7215,13 @@ #define B_BE_SR_CTRL_PLCP_EN BIT(1) #define B_BE_SR_EN BIT(0) +#define R_BE_BSSID_SRC_CTRL 0x1144B +#define R_BE_BSSID_SRC_CTRL_C1 0x1544B +#define B_BE_BSSID_MATCH BIT(3) +#define B_BE_PARTIAL_AID_MATCH BIT(2) +#define B_BE_BSSCOLOR_MATCH BIT(1) +#define B_BE_PLCP_SRC_EN BIT(0) + #define R_BE_CSIRPT_OPTION 0x11464 #define R_BE_CSIRPT_OPTION_C1 0x15464 #define B_BE_CSIPRT_EHTSU_AID_EN BIT(26) -- 2.25.1