From patchwork Thu May 11 19:01:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 9722767 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 5CC5260364 for ; Thu, 11 May 2017 19:01:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51740286E2 for ; Thu, 11 May 2017 19:01:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 461DA286FB; Thu, 11 May 2017 19:01:53 +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 E0BB7286E2 for ; Thu, 11 May 2017 19:01:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934342AbdEKTBq (ORCPT ); Thu, 11 May 2017 15:01:46 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:35437 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934314AbdEKTBc (ORCPT ); Thu, 11 May 2017 15:01:32 -0400 Received: by mail-oi0-f66.google.com with SMTP id m17so5519976oik.2 for ; Thu, 11 May 2017 12:01:32 -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=lIk3p+bXpe8+4U+7/w2KsYkBLUlt2TLApjkGmlXZTO8=; b=bbCzm4ZUyvbdklEcfgX1rRt1jXdVLD3xyuF8Vp8duhWT+dmscy1rK23+EqdGi5Sv7C Wf7KPqJaKpJepU+qH1TZ+f4TI+SmzIzERVwkweYph8x7Rv4RDjQCMOOI9wE7neLeFbCC H3KoBRzsTv/9hgYlxAh0Li+twPQeiyZBbUNykxrfWG9lfVsExDuJxEc7pSheX4ankm2i IM/TdE2/4tdXVoMTfY9+ioJU70Rojc3dmDjkK2fSUxyDN1gTj74Jsp6X6r82WXbo8Bk6 s/j6c0G9mJzmQpj+U+qb9n+9YP8bsWHrwSkOTISsEyNXVNNRnsQZXzSms7yeepuhUSMd +GuQ== 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=lIk3p+bXpe8+4U+7/w2KsYkBLUlt2TLApjkGmlXZTO8=; b=OwMYuIn4X5gMF08fyGTwv9PZJfB8flc4jAlF+AwklSYnvNF4HdBlJCrzMAxWMPVOEn Oq8IAiDHkArg5jwDKdXbO9Um4tOjW8CL1dgCHWvvXjlZSdi+/xWLIwa+isFF1iixbPwi daKpxnUg6NeNWednAd+h8ahU+iFDR2xQXHsKGefBSjn/GLcDBwC78jPvl3djj2D37vHr G1hsLG7RQdvcV66xjQ2mNnHqJy1N1ehydZAxBKUEOqz0vo5Z5jUVHtFwWFE7lKrVmalV zC+qeacLqORp5fuzddlNoSOB59eH7SJVbCDx526E6xi8T2/EK4jaAUTjaMpFObcUR8Qu dQQw== X-Gm-Message-State: AODbwcAW10deZO2kJ0ED5T9Fz589ud9/U/C/SrNFY1VL0Exw9QC+ZIX1 50s+SQAlngfV9/98 X-Received: by 10.157.51.120 with SMTP id u53mr28679otd.240.1494529292024; Thu, 11 May 2017 12:01:32 -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 s64sm472123oif.14.2017.05.11.12.01.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 May 2017 12:01:31 -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 v3 06/10] rtlwifi: btcoex: 21a 2ant: run mechanism if status changes or auto adjust is set Date: Thu, 11 May 2017 14:01:15 -0500 Message-Id: <20170511190119.23426-7-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170511190119.23426-1-Larry.Finger@lwfinger.net> References: <20170511190119.23426-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 The driver will periodically ask the coex, and the coex only runs the mechanism when the status was changed or the auto adjust is set. Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Larry Finger Cc: Pkshih Cc: Birming Chiu Cc: Shaofu Cc: Steven Ting --- v2 - resubmit after removal of BT_AUTO_REPORT_XXXX symbols. v3 - remove one additional usage of BT_AUTO_REPORT_XXXX --- .../realtek/rtlwifi/btcoexist/halbtc8821a2ant.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c index ca7649dca352..0d97e214ee10 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c @@ -3485,14 +3485,14 @@ static void btc8821a2ant_run_coexist_mechanism(struct btc_coexist *btcoexist) if (btc8821a2ant_is_common_action(btcoexist)) { RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD, "[BTCoex], Action 2-Ant common\n"); - coex_dm->reset_tdma_adjust = true; + coex_dm->auto_tdma_adjust = true; } else { if (coex_dm->cur_algorithm != coex_dm->pre_algorithm) { RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD, "[BTCoex], pre_algorithm = %d, cur_algorithm = %d\n", coex_dm->pre_algorithm, coex_dm->cur_algorithm); - coex_dm->reset_tdma_adjust = true; + coex_dm->auto_tdma_adjust = false; } switch (coex_dm->cur_algorithm) { case BT_8821A_2ANT_COEX_ALGO_SCO: @@ -4200,7 +4200,14 @@ void ex_btc8821a2ant_periodical(struct btc_coexist *btcoexist) "[BTCoex], ****************************************************************\n"); } - btc8821a2ant_query_bt_info(btcoexist); - btc8821a2ant_monitor_bt_ctr(btcoexist); - btc8821a2ant_monitor_wifi_ctr(btcoexist); + if (btcoexist->auto_report_2ant) { + btc8821a2ant_query_bt_info(btcoexist); + } else { + btc8821a2ant_monitor_bt_ctr(btcoexist); + btc8821a2ant_monitor_wifi_ctr(btcoexist); + + if (btc8821a2ant_is_wifi_status_changed(btcoexist) || + coex_dm->auto_tdma_adjust) + btc8821a2ant_run_coexist_mechanism(btcoexist); + } }