From patchwork Thu Apr 13 18:06:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 9679821 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 32EA3601C3 for ; Thu, 13 Apr 2017 18:08:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 292E82869E for ; Thu, 13 Apr 2017 18:08:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E001286A7; Thu, 13 Apr 2017 18:08:29 +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 BCF852869E for ; Thu, 13 Apr 2017 18:08:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755332AbdDMSHX (ORCPT ); Thu, 13 Apr 2017 14:07:23 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:36630 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755282AbdDMSHT (ORCPT ); Thu, 13 Apr 2017 14:07:19 -0400 Received: by mail-oi0-f66.google.com with SMTP id b187so13575806oif.3 for ; Thu, 13 Apr 2017 11:07:19 -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=1OqJhnZaYaKJ7uon4jrgS8jkTGWCj+P8lHYyP8B+4AA=; b=ozbrs/ROC95h5TAlWQfj8JIVGHtYXcA3ohGR9VRaW7jXvX8PSE5+3TZRzHU0UBEEyd rdrXTFJnYzbSQPwJd7NTMTQKi34SssdE5wSJ+3RI/EIsLJsLbauuOdzF98wLfrRTxkT4 8+eFDSCIbmknXv6yUHZvhvVNKeMRLdcCaLHUe961V2B4EyYpHCisefG/kZYQGKeVQ770 4cNgjvMXk5vHBlrwn9ibP9jPwkWpmbX988ranvOlAqBxDMJ23SafW8uhb6yaOqVFkAKu kxgEwSrzQ/hm3nA7bQM++5f9qTtES8AdX6fjviaAMiEkvZzXpXG+ySUHGHByYk7avErw IRDQ== 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=1OqJhnZaYaKJ7uon4jrgS8jkTGWCj+P8lHYyP8B+4AA=; b=ko7PCSWeGnYZnrRZ6JRrKoASTDxu7NbJC/GzH99Xyw0kInLPPiTaF/aVJDq67G4yZK WR3csiBTtYWb6ciWms4/alg7565rR7WmUd8/1Az8kIeIgD6N0Xnf92zW/LkozrOlNGRZ o+tWam27LHInP4l1CXypC7v3QxgazKK2N5sCvTvp8H8KidRSY5lXOmipKOIFrB10k397 W3eivb7EFQ8PQY/fwR/Oy1sCozkhRqc4pFDFdCjlmZJhxj9a2iYVWfq+qwftVTFGrmWr pkdqdktm6gBZ4EG82oS0UHfnKmTaGUqQdqTZtrG/p9bSLOaDjcEkze/idNlxnOELLmm4 Mzkg== X-Gm-Message-State: AN3rC/6FcSJKi5LCypEw96CTTCpO17tkh4h4/4vCJWxJBpDJYkHrBlPI gOImaQFKIMI8rw== X-Received: by 10.202.74.196 with SMTP id x187mr2523572oia.171.1492106839050; Thu, 13 Apr 2017 11:07:19 -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 x54sm10897996otd.11.2017.04.13.11.07.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Apr 2017 11:07:18 -0700 (PDT) From: Larry Finger To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Yan-Hsuan Chuang , Larry Finger , Pkshih , Birming Chiu , Shaofu Subject: [PATCH 04/19] rtlwifi: btcoex: 21a 2ant: update bt profiling information Date: Thu, 13 Apr 2017 13:06:55 -0500 Message-Id: <20170413180710.19953-5-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170413180710.19953-1-Larry.Finger@lwfinger.net> References: <20170413180710.19953-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 This function updates the information of bt profiling to help us decide the network status and dispatch the resource properly. Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Larry Finger Cc: Pkshih Cc: Birming Chiu Cc: Shaofu --- .../realtek/rtlwifi/btcoexist/halbtc8821a2ant.c | 51 +++++++++++++++++++++- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c index e23670a23e4d..a9ce79d7f4b4 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c @@ -359,6 +359,54 @@ static void btc8821a2ant_query_bt_info(struct btc_coexist *btcoexist) btcoexist->btc_fill_h2c(btcoexist, 0x61, 1, h2c_parameter); } +static void btc8821a2ant_update_bt_link_info(struct btc_coexist *btcoexist) +{ + struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info; + bool bt_hs_on = false; + + btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, &bt_hs_on); + + bt_link_info->bt_link_exist = coex_sta->bt_link_exist; + bt_link_info->sco_exist = coex_sta->sco_exist; + bt_link_info->a2dp_exist = coex_sta->a2dp_exist; + bt_link_info->pan_exist = coex_sta->pan_exist; + bt_link_info->hid_exist = coex_sta->hid_exist; + + /* work around for HS mode. */ + if (bt_hs_on) { + bt_link_info->pan_exist = true; + bt_link_info->bt_link_exist = true; + } + + /* check if Sco only */ + if (bt_link_info->sco_exist && !bt_link_info->a2dp_exist && + !bt_link_info->pan_exist && !bt_link_info->hid_exist) + bt_link_info->sco_only = true; + else + bt_link_info->sco_only = false; + + /* check if A2dp only */ + if (!bt_link_info->sco_exist && bt_link_info->a2dp_exist && + !bt_link_info->pan_exist && !bt_link_info->hid_exist) + bt_link_info->a2dp_only = true; + else + bt_link_info->a2dp_only = false; + + /* check if Pan only */ + if (!bt_link_info->sco_exist && !bt_link_info->a2dp_exist && + bt_link_info->pan_exist && !bt_link_info->hid_exist) + bt_link_info->pan_only = true; + else + bt_link_info->pan_only = false; + + /* check if Hid only */ + if (!bt_link_info->sco_exist && !bt_link_info->a2dp_exist && + !bt_link_info->pan_exist && bt_link_info->hid_exist) + bt_link_info->hid_only = true; + else + bt_link_info->hid_only = false; +} + static u8 btc8821a2ant_action_algorithm(struct btc_coexist *btcoexist) { struct rtl_priv *rtlpriv = btcoexist->adapter; @@ -2856,8 +2904,7 @@ void ex_btc8821a2ant_bt_info_notify(struct btc_coexist *btcoexist, coex_dm->bt_status = BT_8821A_2ANT_BT_STATUS_IDLE; } - if (bt_hs_on) - coex_dm->bt_status = BT_8821A_2ANT_BT_STATUS_NON_IDLE; + btc8821a2ant_update_bt_link_info(btcoexist); } if (BT_8821A_2ANT_BT_STATUS_NON_IDLE == coex_dm->bt_status)