Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp748655rdb; Thu, 8 Feb 2024 22:54:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IHigZZZ+X8t016OEd++F675PDXyW4TGO8JrL/eyRLNJNySOm84hV6OOchD2ZSUAKt+PSh7f X-Received: by 2002:a05:6a20:439e:b0:19c:9f98:f7e2 with SMTP id i30-20020a056a20439e00b0019c9f98f7e2mr1220107pzl.13.1707461688193; Thu, 08 Feb 2024 22:54:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707461688; cv=pass; d=google.com; s=arc-20160816; b=rgtQplUhPlymJMtY8dtP8jhg3xMlWhMZdExEBS6KpMd9qgCDlAH7ENU6skdZ8Ct01e V40I6kDZWzyp8cnjMBXGCmEtjuQtu6GN9yuiVydWVTiq8kTQH/yfCP7Qrkqn5YfurSGk 240jxHaDUqF02tCFD7mr7sb5m+FPevGEmBwjHTT64SlLPNbrdT9tiUXDeN3YDvZa9bOs u9VMSNPBkpkReR+2JZe0wJwgEfB+Mo6Smxem3E5DBLusOa2duIBR+b8B+nY9ipvKbSRw wBasWJbEZCqjbERfvjYC/Uw+ZsF69IUWKpu62oaH2bZWdZdqDOVhGXWgV0ucfPrShcXC k3Bg== 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=mfQlA6ZX8kFgzzLTjFQGjGfg1AG04dSrIDMyciqbjD4=; b=LqNI/oqKpJ1tSoUMQdYj4/dF7riz0+G7FSDhujdd8EGgZ/SKOP3Y2KElTRlIgLuY88 oLYTBD177toUg1tjaa0mJPzwq3nj4aUzAQgSvUrISxTKGGT2rFhj0tsJZZzBJuxkMNGk UktqyectIwoatGQel9RG0zUOL6f5thkaNQRKOZ2/YOCfopgkI0qeObOLMLb1vnsk/5Ug kDsJQXGEWgRHV4g3Ej+vH/2wIACVexm3RZHM99warvBPGmT6KOtjJGa03OYY6jZxZ7CQ FZmg0uobtkV4pQs/fgash9/g1pNlpqNhi9yztzTjxqYX2YleBEoV4IZACGUYuUISlWA/ w2Rg==; 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-3375-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3375-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCUhCPd/mCnTvBVa93dCZyak4NtdoJq8RHnLXLf6HsMb6VKpc8BXRD6iYXscMktz12G4vRHID3oYDfrVg+jtalBjUmk4asKJcjF/Qa0ybA== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id l6-20020a170902d34600b001d952ae03fcsi1102128plk.602.2024.02.08.22.54.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 22:54:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3375-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-wireless+bounces-3375-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3375-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 0ECE9281CD9 for ; Fri, 9 Feb 2024 06:54:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CF1B3657AA; Fri, 9 Feb 2024 06:53:50 +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 28751651BA for ; Fri, 9 Feb 2024 06:53:49 +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=1707461630; cv=none; b=sjdiREPaw9YmXa1j/Fk4FcdIDmqZpaLyaoFyCKZjfSiJp2bk7EWEJoSpL++H+enqlfRvS+UtlWHADCHvqVg2LuP8aiKHVXg7k8sAhYDmD7tGeErQL/5c9CDkZh5Rp7Xj6xLXNkkHu71Zw9EESK4r+Ms4YAisPIykjA0IbD87ibA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707461630; c=relaxed/simple; bh=Gqnm/gVqc2JGfTxIppAPs8VgVuKtVFeqp44sbQjHpoU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Mdn8Aucm+TX3d2ltGKrk4kyLbAwXeFwzNSzxwVx9E1W/JCOYoGbx1ukWlQ5QMMX8zKj+IfSqN3jI0NWydoC1XSUhekzuY2lUSzw677PFrOuave+N12A9FMjGEtKc7FZU/65B6egBRfcGtxuKq9ZPcJx/hTIqgGqQxLBqCTSUIME= 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 4196rhYE3548402, 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 4196rhYE3548402 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 9 Feb 2024 14:53:43 +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; Fri, 9 Feb 2024 14:53:44 +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:43 +0800 From: Ping-Ke Shih To: CC: , , , Subject: [PATCH v2 06/11] wifi: rtw89: use PLCP information to match BSS_COLOR and AID Date: Fri, 9 Feb 2024 14:52:24 +0800 Message-ID: <20240209065229.34515-7-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) 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