From patchwork Thu May 11 23:24:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 9723247 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 A56E76031B for ; Thu, 11 May 2017 23:25:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2CCD28738 for ; Thu, 11 May 2017 23:25:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 979BA28745; Thu, 11 May 2017 23:25:15 +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=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 3A1D628738 for ; Thu, 11 May 2017 23:25:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756740AbdEKXZE (ORCPT ); Thu, 11 May 2017 19:25:04 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:34495 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756635AbdEKXZC (ORCPT ); Thu, 11 May 2017 19:25:02 -0400 Received: by mail-oi0-f65.google.com with SMTP id w10so6440859oif.1 for ; Thu, 11 May 2017 16:25:02 -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=162mggeLuOd0uDaRAsd6H0iR14ruvPHIdp58w8WYnFA=; b=HBDz+WOimeAApE4PPfvVXkdEhBGusD80BQVnw+oC35mi/iRwgm7sZTM+/9FwiNuwbW l0t9K4YYpN4EXew0J0cTgjvDgibV/OPcnNdmRXMye51mTsgM1vpxg8lWfdFejS7cEwIz FDIrkRQFeX6IAMYG7fAbxtpJvpAtxr9eFscXcrtVnBrXnNQBBpV0EMsdwQFzbMiGf/NK h69FfkOpBBkWJInvAYgTQM54kZb5Zon8eb5f8ijQbuECtgFKXdCGtUdBIPyJdf2gn0cv ND2nWwy8ect6Sa8fpvEcfo3Y2ZacqqLgJXUUekGRdklziUJDONDaqCR0iRjr4nLWDWgO LE6w== 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=162mggeLuOd0uDaRAsd6H0iR14ruvPHIdp58w8WYnFA=; b=W16h5LTkAopMaGvS/dqR89pyvEuljPU1PJtjQO7Fy5uyNfM6ml1GTWuVkuejhVw9Rj j9BDftp8AEleFMNIiaTYr7HUpGhuabRdRbxCGsuFh77jArhQB90i7N0nh7Yywmx6VTbQ NSnLP3vN6K1E3JkISUWiPetxQMxcgQP8ctsr+e4jcP3sQpHIsIeVoFfJCdT6+ezYG9Ay 1SF6W6c/qCuThlK43rFwpJfhtC9EXFahE+mON+mRFSI1lPKuGFC3GvpKQoN6DjgEgWu4 1czn5WQig01m9pVZTy3v6Vqs5rtUb5K9ICOKY2csglyMmUttYmURL9StxNpHN/e6SMR6 87Rg== X-Gm-Message-State: AODbwcCxJ6mhSoFcPXtN9vqI/qkwiVSu6Us1b8r2Zz6oo/ctWJWxj2FO PVrEmFtVvDSGXhm/ X-Received: by 10.202.204.141 with SMTP id c135mr524937oig.187.1494545101726; Thu, 11 May 2017 16:25:01 -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 b67sm797950oif.7.2017.05.11.16.25.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 May 2017 16:25:01 -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/10] rtlwifi: btcoex: 21a 1ant: coex table and tdma settings for softap mode Date: Thu, 11 May 2017 18:24:33 -0500 Message-Id: <20170511232438.23159-6-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170511232438.23159-1-Larry.Finger@lwfinger.net> References: <20170511232438.23159-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 f5a4640577c2..6a434334a418 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); }