Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5360598ybp; Tue, 8 Oct 2019 01:24:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXOrNuWtLn6t8d5vT71+pMlGzAowrWXjOJo3pLpqaIwe/NOp2jjTjhH7ebJlSzCGPGdNxf X-Received: by 2002:aa7:ce8b:: with SMTP id y11mr32467974edv.231.1570523040187; Tue, 08 Oct 2019 01:24:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570523040; cv=none; d=google.com; s=arc-20160816; b=WLViD6f+jKKk1jlSpzXiDw9Q1S9azOJ1CW4uCqvu3J6k8NjC+SyTapRRRnn9TZ2gMY TauawgPED0nlzj+RxYIhhyB/gq9wMwTYV/QLq/yKeFIK+CTgnMsfWcGajbNfsjMrpOtM jQ9Q0SW+M1yfKCRcRavGOMxJq8WBhLh5FGx3sPks2AYkt8N2Ps8rXlUXePrdEEuS9g1y nJsnHWhUkkhZoaTzLxKBJ3wSwilmGY9UCRF25XRZUTZr9uDnXHgvmYe89u/5cB9Mmxc2 rC7/eozpa5k/zjNkQCJeMSh6CyQ2vhZcjYEH6L8GtaJtDx3P7V3s3dsWxECSB/n+zcEc 2O6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:authenticated-by; bh=MUsXRjmNtf0kTDVG3EfKWJUllwq1RltyxbU9Hfv5je0=; b=sp4wUH8+tPanZsmlNlsoMlOAapRQAMZ/GDiqLSkFGrfYQ8N6IWoMssD9wHb9tUtt5C +SZc/VbAD5O76pf5hZO+AE6jHW3brJajK6pYn8cA2bSecttgdS5OcUIehjX54dHmlT21 z9Qrm3KOqLYH5B4FgC4wXjWxoVwPlkYJB3W2diPqjBOu2Yj2W2C4RQc8BR9dyu36xPYK J+PXvH5CC6tIpDMH1OglGO9Y+JrSQzc/pGFWTaobLD5RkkQFDImIUc4HHfxdP+0GxbTY 4nAXUP4OBDCp/6XgVYJ80KWTgRhhcWL/Qxm/sgdY/vha8rRbKQZheS0/U6lD43n4RjcD jXbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b3si8271417eju.357.2019.10.08.01.23.36; Tue, 08 Oct 2019 01:24:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730622AbfJHIVR (ORCPT + 99 others); Tue, 8 Oct 2019 04:21:17 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:47352 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730614AbfJHIVQ (ORCPT ); Tue, 8 Oct 2019 04:21:16 -0400 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID x988LB8s028158, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (RTITCASV01.realtek.com.tw[172.21.6.18]) by rtits2.realtek.com.tw (8.15.2/2.57/5.78) with ESMTPS id x988LB8s028158 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 8 Oct 2019 16:21:11 +0800 Received: from localhost.localdomain (172.21.68.126) by RTITCASV01.realtek.com.tw (172.21.6.18) with Microsoft SMTP Server id 14.3.468.0; Tue, 8 Oct 2019 16:21:10 +0800 From: To: CC: , Subject: [PATCH 09/10] rtw88: coex: Set 4 slot mode for A2DP Date: Tue, 8 Oct 2019 16:21:00 +0800 Message-ID: <20191008082101.2494-10-yhchuang@realtek.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191008082101.2494-1-yhchuang@realtek.com> References: <20191008082101.2494-1-yhchuang@realtek.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.21.68.126] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ping-Ke Shih With shallow buffer size, certain BT devices have active A2DP flow control to fill buffer frequently. If the slot is not at BT side, data can't be sent successfully to BT devices, and will cause audio glitch. To resolve this issue, this commit splits TUs into 4-slots instead of 2-slot for all of the A2DP related coexistence strategies. That makes BT have higher opportunity to fill the A2DP buffer in time, and the audio quality could be more stable and smooth. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang --- drivers/net/wireless/realtek/rtw88/coex.c | 24 ++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw88/coex.c b/drivers/net/wireless/realtek/rtw88/coex.c index 9d8cbd91e5ff..4dfb2ec395ee 100644 --- a/drivers/net/wireless/realtek/rtw88/coex.c +++ b/drivers/net/wireless/realtek/rtw88/coex.c @@ -1302,6 +1302,7 @@ static void rtw_coex_action_bt_inquiry(struct rtw_dev *rtwdev) struct rtw_chip_info *chip = rtwdev->chip; bool wl_hi_pri = false; u8 table_case, tdma_case; + u32 slot_type = 0; if (coex_stat->wl_linkscan_proc || coex_stat->wl_hi_pri_task1 || coex_stat->wl_hi_pri_task2) @@ -1312,14 +1313,16 @@ static void rtw_coex_action_bt_inquiry(struct rtw_dev *rtwdev) if (wl_hi_pri) { table_case = 15; if (coex_stat->bt_a2dp_exist && - !coex_stat->bt_pan_exist) + !coex_stat->bt_pan_exist) { + slot_type = TDMA_4SLOT; tdma_case = 11; - else if (coex_stat->wl_hi_pri_task1) + } else if (coex_stat->wl_hi_pri_task1) { tdma_case = 6; - else if (!coex_stat->bt_page) + } else if (!coex_stat->bt_page) { tdma_case = 8; - else + } else { tdma_case = 9; + } } else if (coex_stat->wl_connected) { table_case = 10; tdma_case = 10; @@ -1355,7 +1358,7 @@ static void rtw_coex_action_bt_inquiry(struct rtw_dev *rtwdev) rtw_coex_set_ant_path(rtwdev, false, COEX_SET_ANT_2G); rtw_coex_set_rf_para(rtwdev, chip->wl_rf_para_rx[0]); rtw_coex_table(rtwdev, table_case); - rtw_coex_tdma(rtwdev, false, tdma_case); + rtw_coex_tdma(rtwdev, false, tdma_case | slot_type); } static void rtw_coex_action_bt_hfp(struct rtw_dev *rtwdev) @@ -1469,13 +1472,13 @@ static void rtw_coex_action_bt_a2dp(struct rtw_dev *rtwdev) if (efuse->share_ant) { /* Shared-Ant */ + slot_type = TDMA_4SLOT; + if (coex_stat->wl_gl_busy && coex_stat->wl_noisy_level == 0) table_case = 10; else table_case = 9; - slot_type = TDMA_4SLOT; - if (coex_stat->wl_gl_busy) tdma_case = 13; else @@ -1579,13 +1582,14 @@ static void rtw_coex_action_bt_a2dp_hid(struct rtw_dev *rtwdev) if (efuse->share_ant) { /* Shared-Ant */ + slot_type = TDMA_4SLOT; + if (coex_stat->bt_ble_exist) table_case = 26; else table_case = 9; if (coex_stat->wl_gl_busy) { - slot_type = TDMA_4SLOT; tdma_case = 13; } else { tdma_case = 14; @@ -1788,10 +1792,12 @@ static void rtw_coex_action_wl_linkscan(struct rtw_dev *rtwdev) struct rtw_efuse *efuse = &rtwdev->efuse; struct rtw_chip_info *chip = rtwdev->chip; u8 table_case, tdma_case; + u32 slot_type = 0; if (efuse->share_ant) { /* Shared-Ant */ if (coex_stat->bt_a2dp_exist) { + slot_type = TDMA_4SLOT; table_case = 9; tdma_case = 11; } else { @@ -1812,7 +1818,7 @@ static void rtw_coex_action_wl_linkscan(struct rtw_dev *rtwdev) rtw_coex_set_ant_path(rtwdev, true, COEX_SET_ANT_2G); rtw_coex_set_rf_para(rtwdev, chip->wl_rf_para_rx[0]); rtw_coex_table(rtwdev, table_case); - rtw_coex_tdma(rtwdev, false, tdma_case); + rtw_coex_tdma(rtwdev, false, tdma_case | slot_type); } static void rtw_coex_action_wl_not_connected(struct rtw_dev *rtwdev) -- 2.17.1