From patchwork Tue Apr 4 16:50:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 9662083 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 1F365602BA for ; Tue, 4 Apr 2017 16:50:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1606A27F10 for ; Tue, 4 Apr 2017 16:50:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AFC7283E8; Tue, 4 Apr 2017 16:50:50 +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 A48E327F10 for ; Tue, 4 Apr 2017 16:50:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754766AbdDDQus (ORCPT ); Tue, 4 Apr 2017 12:50:48 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:35622 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753980AbdDDQue (ORCPT ); Tue, 4 Apr 2017 12:50:34 -0400 Received: by mail-oi0-f65.google.com with SMTP id d2so18373713oig.2 for ; Tue, 04 Apr 2017 09:50:34 -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=i9GWJwtKe4YFAPzRaHHCSFrVMts4jZzjyRj8cXw/vmY=; b=BtMJbKVCh7miNsVAB2eLdpd+mTeXvat+lZfapyCcD+5TLSDkAG5hxhZ6xB/ZYdgJvw kg+xbE6t/a19gEnsiXgbZwssQk8Kzl1vjW9mZWYoVbU9dCTKWfKCcXbhwCNSVtBzd+j6 oVjQQZ477P9J0a5pQ7yhAFaAXFewXv6KwZq2ga9R7DZrYB5FgjEIcOsof4QF+tL/SjWW jJFH71dzezuReVxW0nBzQjLzJ5BkIoJF6fd9HzuK1rr9XSJduj38JDSj1LQ4SCpI45lG gmDmPaMV19kJGuGQddEDVlWLkY/sjA0eZACn2YYbiAe5xyHcktXGWN0Q1ZfRgI/Y3LMX Ic1A== 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=i9GWJwtKe4YFAPzRaHHCSFrVMts4jZzjyRj8cXw/vmY=; b=ieke0mdcBr8HdJeELzNjmSZDXbOwaJGGejSealccpOcD+J5WsUbMeA1I2soIN6Nu9g VHrTulaz21TSXa1hr2LeyxSrVviU0vJBxUvtNMWch76Ux3uPTL7fzeGaLbPnyAYevZLo K2uS/m+qxPdUia7fJIQ/YNH2LvX5ORI73A+2sEa9aTuw+Ln2hplPtQwhGt8VLhziRiuQ B6E1wWwHRyTeZSq/Tous5epTWRUlgne9cn7yiA/AST/cZJg+RAs/FExrpPJINiOpZxDV /hNSFs8ZpdbY1Nst9GX+XXtFpDNxfp3DNupi6xtt+TziZHfy2TOOM/x7d8JnqdX0wJvP ubaA== X-Gm-Message-State: AFeK/H2fn81Vcgv9dhBrETXv9xYoQiibecaxyL7eGFj7OSFCxkhUL03fAIpELaMbTLe2Yg== X-Received: by 10.157.18.174 with SMTP id g43mr11756597otg.179.1491324633466; Tue, 04 Apr 2017 09:50:33 -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 63sm8465773otu.25.2017.04.04.09.50.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Apr 2017 09:50:33 -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 11/13] rtlwifi: btcoex: 23b 2ant: turn off ps and tdma mechanism when in concurrent mode Date: Tue, 4 Apr 2017 11:50:04 -0500 Message-Id: <20170404165006.14329-12-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170404165006.14329-1-Larry.Finger@lwfinger.net> References: <20170404165006.14329-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 When wifi is in concurrent mode, we can not distinguish if it is the real PS or just a fake one by sending null data, so we turn it off in case of miracast scenario. Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Larry Finger Cc: Pkshih Cc: Birming Chiu Cc: Shaofu Cc: Steven Ting --- .../realtek/rtlwifi/btcoexist/halbtc8723b2ant.c | 46 ++++++++++++++++++++++ .../realtek/rtlwifi/btcoexist/halbtcoutsrc.h | 1 + 2 files changed, 47 insertions(+) diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c index 31f8a59..88cd28f 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c @@ -3168,10 +3168,29 @@ static void btc8723b2ant_action_hid_a2dp(struct btc_coexist *btcoexist) } } +static void btc8723b2ant_action_wifi_multi_port(struct btc_coexist *btcoexist) +{ + btc8723b2ant_fw_dac_swing_lvl(btcoexist, NORMAL_EXEC, 6); + btc8723b2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0); + + /* sw all off */ + btc8723b2ant_sw_mechanism(btcoexist, false, false, false, false); + + /* hw all off */ + btc8723b2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 0); + + btc8723b2ant_power_save_state(btcoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + btc8723b2ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 1); +} + static void btc8723b2ant_run_coexist_mechanism(struct btc_coexist *btcoexist) { struct rtl_priv *rtlpriv = btcoexist->adapter; u8 algorithm = 0; + u32 num_of_wifi_link = 0; + u32 wifi_link_status = 0; + struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info; + bool miracast_plus_bt = false; RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD, "[BTCoex], RunCoexistMechanism()===>\n"); @@ -3203,6 +3222,33 @@ static void btc8723b2ant_run_coexist_mechanism(struct btc_coexist *btcoexist) } } + /* for P2P */ + btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_LINK_STATUS, + &wifi_link_status); + num_of_wifi_link = wifi_link_status >> 16; + + if ((num_of_wifi_link >= 2) || + (wifi_link_status & WIFI_P2P_GO_CONNECTED)) { + RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD, + "############# [BTCoex], Multi-Port num_of_wifi_link = %d, wifi_link_status = 0x%x\n", + num_of_wifi_link, wifi_link_status); + + if (bt_link_info->bt_link_exist) + miracast_plus_bt = true; + else + miracast_plus_bt = false; + + btcoexist->btc_set(btcoexist, BTC_SET_BL_MIRACAST_PLUS_BT, + &miracast_plus_bt); + btc8723b2ant_action_wifi_multi_port(btcoexist); + + return; + } + + miracast_plus_bt = false; + btcoexist->btc_set(btcoexist, BTC_SET_BL_MIRACAST_PLUS_BT, + &miracast_plus_bt); + coex_dm->cur_algorithm = algorithm; RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD, "[BTCoex], Algorithm = %d\n", diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h index d7ba6ad..022658c 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h @@ -249,6 +249,7 @@ enum btc_set_type { BTC_SET_BL_TO_REJ_AP_AGG_PKT, BTC_SET_BL_BT_CTRL_AGG_SIZE, BTC_SET_BL_INC_SCAN_DEV_NUM, + BTC_SET_BL_MIRACAST_PLUS_BT, /* type u1Byte */ BTC_SET_U1_RSSI_ADJ_VAL_FOR_AGC_TABLE_ON,