From patchwork Mon Apr 17 00:06:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 9683301 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C9D4760389 for ; Mon, 17 Apr 2017 00:07:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB2A527D4D for ; Mon, 17 Apr 2017 00:07:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AFBFD27D5E; Mon, 17 Apr 2017 00:07:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID, URIBL_BLACK autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3531A27A98 for ; Mon, 17 Apr 2017 00:07:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757016AbdDQAHP (ORCPT ); Sun, 16 Apr 2017 20:07:15 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:35922 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756927AbdDQAHK (ORCPT ); Sun, 16 Apr 2017 20:07:10 -0400 Received: by mail-oi0-f68.google.com with SMTP id b187so25347776oif.3 for ; Sun, 16 Apr 2017 17:07:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=IJhaHz68L1OOFgYtS4zjNKCICWOh+mcISR83MpubkiM=; b=kC8sW2y4iGO4tDAFL3imQ3S10ZzGD7w2CJJLLY9ZlEzqYSgHCw/DN9JUgIpeAJYyph poPedKOyQlSAU5EhrgBu5cdTtWDGFp4ZJFCzzw0Heqi2VBd1YlIcbatjx9Ny0sbJSF6Z GgNZYmoA+VslxSLiJfdzjGd9HqqjWKj7L6XIYrbrbnBOWe6LFpDMVgbgiB3aZlDDpAUT URXAsetjZRsloPW8zepFamtti4Vj75ml7vAZKlOrIECRWa1EWml3p3pann4uoNxcTcKi DkNQsdnEbDXqo8CU6FFZqCgsQoOfo6CmE0WE2TE/BSjxOQE/Q98unVzHd1e8RNn2jDJT iC/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=IJhaHz68L1OOFgYtS4zjNKCICWOh+mcISR83MpubkiM=; b=lnIzE7jERzxgL8dXqywsGe+2Kgrt8zNDah6dmtHAmYbWVyYo8nOx4d6G8J172IvFS+ kXKoP+ZO3OKBvULZTPSVIT8RU0B2ePPKjZTfm0SHXK/MXJZT3QXMDk6auC9VxcmpWD53 WewxWC0l0mMXCYykWzpaCt6fJjcFpB2FAV9CE0YnN1bTTCunMdjwfn4LBLCw24uH9OjA jZica0z5v7y14qYZwJAQQWbMM46WI5x6FqLPMxHJNfe1jTHQKX64frp3xxDLOjBiO/Ww V/YnQQbN+kSimaDLfpaa/NkG5bWUXbpZ2ULY+Xjuh4VLoiDwptvVgNxKhIm8mBBAavWc +Swg== X-Gm-Message-State: AN3rC/4srQpwLoamNUSWU4UtljtumgrJ7xz4SovvN4czJj+qeZivDFCk +J603tnQkNT1HA== X-Received: by 10.202.196.70 with SMTP id u67mr3873666oif.190.1492387629876; Sun, 16 Apr 2017 17:07:09 -0700 (PDT) Received: from linux-4v1g.suse (cpe-24-31-249-175.kc.res.rr.com. [24.31.249.175]) by smtp.gmail.com with ESMTPSA id v49sm3963286otb.13.2017.04.16.17.07.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 16 Apr 2017 17:07:09 -0700 (PDT) From: Larry Finger To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Yan-Hsuan Chuang , Larry Finger , Pkshih , Birming Chiu , Shaofu , Steven Ting Subject: [PATCH 05/13] rtlwifi: btcoex: 21a 1ant: coex table and tdma settings for softap mode Date: Sun, 16 Apr 2017 19:06:52 -0500 Message-Id: <20170417000700.29057-6-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170417000700.29057-1-Larry.Finger@lwfinger.net> References: <20170417000700.29057-1-Larry.Finger@lwfinger.net> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Yan-Hsuan Chuang Monitor if the wifi is softap mode, and set the tdma and coex table accordingly. Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Larry Finger Cc: Pkshih Cc: Birming Chiu Cc: Shaofu Cc: Steven Ting --- .../realtek/rtlwifi/btcoexist/halbtc8821a1ant.c | 25 +++++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c index 51dfa94a9cc7..113e22640bbc 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c @@ -1782,6 +1782,7 @@ static void btc8821a1ant_action_wifi_connected(struct btc_coexist *btcoexist) bool wifi_busy = false; bool scan = false, link = false, roam = false; bool under_4way = false; + bool ap_enable = false; RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD, "[BTCoex], CoexForWifiConnect()===>\n"); @@ -1810,17 +1811,26 @@ static void btc8821a1ant_action_wifi_connected(struct btc_coexist *btcoexist) } /* power save state*/ + btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, + &ap_enable); + btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); if (BT_8821A_1ANT_BT_STATUS_ACL_BUSY == - coex_dm->bt_status && !btcoexist->bt_link_info.hid_only) - btc8821a1ant_power_save_state(btcoexist, - BTC_PS_LPS_ON, 0x50, 0x4); - else + coex_dm->bt_status && !ap_enable && + !btcoexist->bt_link_info.hid_only) { + if (!wifi_busy && btcoexist->bt_link_info.a2dp_only) + /* A2DP */ + btc8821a1ant_power_save_state(btcoexist, + BTC_PS_WIFI_NATIVE, 0x0, 0x0); + else + btc8821a1ant_power_save_state(btcoexist, BTC_PS_LPS_ON, + 0x50, 0x4); + } else { btc8821a1ant_power_save_state(btcoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + } /* tdma and coex table */ - btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); if (!wifi_busy) { if (BT_8821A_1ANT_BT_STATUS_ACL_BUSY == coex_dm->bt_status) { btc8821a1ant_act_wifi_con_bt_acl_busy(btcoexist, @@ -1832,8 +1842,7 @@ static void btc8821a1ant_action_wifi_connected(struct btc_coexist *btcoexist) btc8821a1ant_act_bt_sco_hid_only_busy(btcoexist, BT_8821A_1ANT_WIFI_STATUS_CONNECTED_IDLE); } else { - btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC, - true, 5); + btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 8); btc8821a1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 2); } @@ -1848,7 +1857,7 @@ static void btc8821a1ant_action_wifi_connected(struct btc_coexist *btcoexist) btc8821a1ant_act_bt_sco_hid_only_busy(btcoexist, BT_8821A_1ANT_WIFI_STATUS_CONNECTED_BUSY); } else { - btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 5); + btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 8); btc8821a1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 2); }