Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1018752lqb; Wed, 17 Apr 2024 19:13:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWTSPLfjeuuuFZxfKWnceiTRqS54qZ4a9JjNPqa/40B1R+UTRDHqnY8GKfYxmRrrGaFJ1zbOcHtijJ0wFW3+VfaL68vzGVMPfZJtfQX4g== X-Google-Smtp-Source: AGHT+IELE2+kjzQoLLTs+U+aHkd2fbKwS2NhdBoH+COoDR1eBuPqKTqv+YmegdxZIX/Ht7CEfWKG X-Received: by 2002:a17:90a:430f:b0:2a5:3438:a31b with SMTP id q15-20020a17090a430f00b002a53438a31bmr1211125pjg.37.1713406422581; Wed, 17 Apr 2024 19:13:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713406422; cv=pass; d=google.com; s=arc-20160816; b=P+SeQDAsy6X1wxxSmhiCS2O7LQr8+86tA3gY8gdRwXB4fpMUBWSujLMvE76l9EbyMH VueSp5Qzk3Ezbhy3akl1Ar7pwhroaqK8DSS3Qf4fmfbopF6AyJyTLKHjjpwonJ5mmzuJ Xnnoyj9mx21C6e3RgvKS0490lr6UVuBVAMzmy+eLHSsm2b3o4Xjjf4+IAERkBV7NbC95 NSVJVyBTdfquw36Dx/pveljaLXjR0vTI6AJ5yErQ7iGZ7YFopJMxuioSzXPNGHSUfKO+ D9Z0KKRhx4Gp6n5Cbr2+d/y2uB9sojtnD6j9WjNGoy5Gld1k+smC4wGH5XVOevkFaAhB FKHg== 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=BZOjGWb8a71KimjnCI0Oy5UlAnzkJihq775EtBzAkiM=; fh=MNKRx4WJmBaVWzQe39dfqMazHXuwPQWBzq8iA6LUjvg=; b=BZFutWXG3xz3Ue6k8rHs7cSu/QLaXfu1oL8Up43TIdEquu0q2QMXivpvi7EZiIZvm2 SS954CUbqTwYvhxBbzV3Esj2v0fYf/F4c7Cofy/51GBqi8Nyt84/AGMgolRAlVTV9gCO Be5pUcberAN4PCUqle8vFvXjJl5lhDl5rte0JxbtFh9o0JGNCT1F01Aj3HGebX4IYdp3 oOjXq0jX4b9/3TKEtfD7R+vhEGtV46uLcU7KmVItJW0vFcqYHHpUtpx/tDyRpHbQ0mnl BA/F17COyH9D/7TRt8H+MKUvY1pWwAo5ukcKIUHek0GoxcNQhe4A++jIU78wI4Zl5705 TcJA==; 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-6483-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6483-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id h12-20020a17090a9c0c00b002a26a9f6b4esi2126506pjp.175.2024.04.17.19.13.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 19:13:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6483-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-wireless+bounces-6483-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6483-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 74E5FB22964 for ; Thu, 18 Apr 2024 02:12:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9EBD54F888; Thu, 18 Apr 2024 02:12:53 +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 4272B4F889 for ; Thu, 18 Apr 2024 02:12:51 +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=1713406373; cv=none; b=CcIsX43VKcGvlYuylyyIe7hXkfq3cdqs9NGJdtsUQQIEo+YourJIy+ybwoLVXAsvwYWfYcAER/wBY1A9Bww1j4yKqVIViA3bBKevJfQ6eSuBbxhYqYZ3Kc3vLVRp8uh4AeDDL6IBX9HBGeZUEDl5HzaG5YWVw2bpnr/6Hth/CiY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713406373; c=relaxed/simple; bh=dOZULi/makXT/hRmlIcIUXoNoAs9cywIXy4LVdniZIw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NONUKYnj/WowUYRkpKk8B40nO2oxHbRpYMkH7nhCyfYhqLntOftZ/usfVxbwi2EUDrb6uSieiWIHiyTjzdDazXIra7BK0T+8yeRBdjMtlo6ey5SKy1OS3VMu3xFnLNeTvgKlsrs5CWyW47tyDyLFV+BHhIeiZS83d8LS1e21O4Q= 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 43I2Cn9423994731, 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 43I2Cn9423994731 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 18 Apr 2024 10:12:49 +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.2507.35; Thu, 18 Apr 2024 10:12:49 +0800 Received: from [127.0.1.1] (172.21.69.94) 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, 18 Apr 2024 10:12:49 +0800 From: Ping-Ke Shih To: CC: Subject: [PATCH 5/9] wifi: rtw89: coex: Update Bluetooth polluted Wi-Fi TX logic Date: Thu, 18 Apr 2024 10:12:03 +0800 Message-ID: <20240418021207.32173-6-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240418021207.32173-1-pkshih@realtek.com> References: <20240418021207.32173-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 From: Ching-Te Ku When the PTA breaks Wi-Fi traffic request caused Bluetooth traffic, it means Bluetooth polluted the Wi-Fi traffic. When Wi-Fi is TX, the mechanism can ignore the polluted Wi-Fi packet retry counter, it is help to the stability of Wi-Fi TX rate. The chip RTL8922A has not only one MAC, so need to include the all MAC as reference. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/coex.c | 45 ++++++++++++++++++----- drivers/net/wireless/realtek/rtw89/core.h | 1 + 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw89/coex.c b/drivers/net/wireless/realtek/rtw89/coex.c index 37eb85d63657..b296217d593a 100644 --- a/drivers/net/wireless/realtek/rtw89/coex.c +++ b/drivers/net/wireless/realtek/rtw89/coex.c @@ -3800,21 +3800,32 @@ EXPORT_SYMBOL(rtw89_btc_set_policy_v1); static void _set_bt_plut(struct rtw89_dev *rtwdev, u8 phy_map, u8 tx_val, u8 rx_val) { + struct rtw89_btc_wl_info *wl = &rtwdev->btc.cx.wl; struct rtw89_mac_ax_plt plt; - plt.band = RTW89_MAC_0; plt.tx = tx_val; plt.rx = rx_val; - if (phy_map & BTC_PHY_0) + if (rtwdev->btc.ver->fwlrole == 8) { + plt.band = wl->pta_req_mac; + if (wl->bt_polut_type[plt.band] == tx_val) + return; + + wl->bt_polut_type[plt.band] = tx_val; rtw89_mac_cfg_plt(rtwdev, &plt); + } else { + plt.band = RTW89_MAC_0; - if (!rtwdev->dbcc_en) - return; + if (phy_map & BTC_PHY_0) + rtw89_mac_cfg_plt(rtwdev, &plt); - plt.band = RTW89_MAC_1; - if (phy_map & BTC_PHY_1) - rtw89_mac_cfg_plt(rtwdev, &plt); + if (!rtwdev->dbcc_en) + return; + + plt.band = RTW89_MAC_1; + if (phy_map & BTC_PHY_1) + rtw89_mac_cfg_plt(rtwdev, &plt); + } } static void _set_ant_v0(struct rtw89_dev *rtwdev, bool force_exec, @@ -7842,6 +7853,21 @@ static void _show_bt_info(struct rtw89_dev *rtwdev, struct seq_file *m) #define CASE_BTC_EVT_STR(e) case CXEVNT_## e: return #e #define CASE_BTC_INIT(e) case BTC_MODE_## e: return #e #define CASE_BTC_ANTPATH_STR(e) case BTC_ANT_##e: return #e +#define CASE_BTC_POLUT_STR(e) case BTC_PLT_## e: return #e + +static const char *id_to_polut(u32 id) +{ + switch (id) { + CASE_BTC_POLUT_STR(NONE); + CASE_BTC_POLUT_STR(GNT_BT_TX); + CASE_BTC_POLUT_STR(GNT_BT_RX); + CASE_BTC_POLUT_STR(GNT_WL); + CASE_BTC_POLUT_STR(BT); + CASE_BTC_POLUT_STR(ALL); + default: + return "unknown"; + } +} static const char *steps_to_str(u16 step) { @@ -9345,12 +9371,13 @@ static void _show_mreg_v2(struct rtw89_dev *rtwdev, struct seq_file *m) gnt = gnt_cfg.band[0]; seq_printf(m, - " %-15s : pta_owner:%s, phy-0[gnt_wl:%s-%d/gnt_bt:%s-%d], ", + " %-15s : pta_owner:%s, phy-0[gnt_wl:%s-%d/gnt_bt:%s-%d], polut_type:%s", "[gnt_status]", chip->chip_id == RTL8852C ? "HW" : btc->dm.pta_owner == BTC_CTRL_BY_WL ? "WL" : "BT", gnt.gnt_wl_sw_en ? "SW" : "HW", gnt.gnt_wl, - gnt.gnt_bt_sw_en ? "SW" : "HW", gnt.gnt_bt); + gnt.gnt_bt_sw_en ? "SW" : "HW", gnt.gnt_bt, + id_to_polut(wl->bt_polut_type[wl->pta_req_mac])); gnt = gnt_cfg.band[1]; seq_printf(m, "phy-1[gnt_wl:%s-%d/gnt_bt:%s-%d]\n", diff --git a/drivers/net/wireless/realtek/rtw89/core.h b/drivers/net/wireless/realtek/rtw89/core.h index 43f42774eccc..517966423969 100644 --- a/drivers/net/wireless/realtek/rtw89/core.h +++ b/drivers/net/wireless/realtek/rtw89/core.h @@ -1807,6 +1807,7 @@ struct rtw89_btc_wl_info { u8 cn_report; u8 coex_mode; u8 pta_req_mac; + u8 bt_polut_type[RTW89_PHY_MAX]; /* BT polluted WL-Tx type for phy0/1 */ bool is_5g_hi_channel; bool pta_reg_mac_chg; -- 2.25.1