From patchwork Fri May 19 15:59:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 9737603 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 10129601A1 for ; Fri, 19 May 2017 16:00:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CA682880A for ; Fri, 19 May 2017 16:00:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0149B288F4; Fri, 19 May 2017 16:00:14 +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 6FDD42880A for ; Fri, 19 May 2017 16:00:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756444AbdESQAH (ORCPT ); Fri, 19 May 2017 12:00:07 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:32976 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756432AbdESQAC (ORCPT ); Fri, 19 May 2017 12:00:02 -0400 Received: by mail-oi0-f66.google.com with SMTP id h4so13056360oib.0 for ; Fri, 19 May 2017 08:59:51 -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=HtX5oM+lKTLQM+Ef8zf5t6ro8y36Aq5ZgkTmqzEme68=; b=L6X1Gk4mS1hO13TrFSZNX59KboNP6cyGjz960Ee2DAmgLqAel1ttzs5vuY5odnVyVY cUrextGH19JrutRk6YRR3sA8EQ0CL+mh61uMRQAEB+j1tN9VzBZLvyBw1Gl768g9qWQY KcQIPq7ecR1hHTCT0rZ1JQr8kc1gOlrE8VSbStAgIRuZsSC5A6CmkLKa+FE27Cr7eKUg TqFmhI97B6+klN3i7xHhVxh3AD/OVNcmbfZb84JpNJIOifvC3/HqUTyCq0pUldHfeNx2 zaOdTNlTNNIvRXQjEIN9AY8ay1oPHF0ilkEI16e5KSbFFsDlronzsqlnxMTuMnjsDxx3 Flew== 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=HtX5oM+lKTLQM+Ef8zf5t6ro8y36Aq5ZgkTmqzEme68=; b=RYM5VWfSmXVJn0MRlLdWZI8MqyjzciW/U0rosCSip5YP6bdpRlVpRBhfJ0HD/NjjCX U9RsQApI31t833I3+VgvMbxldYFrQl3L69NTFbHTUlvYHzaPGiRd0CukPx2Yzn4VLJVd VbkKWinLfxhLEcG2moLewDwHB410Sv+6ibj8eg74v9wRHfjlq3AcbAp16L2aJffykVTw WL2Pjbuqj9iAdbuYQAyinY1OPChd5FBrnCOUv+c1knjhgrGS9Qjpc0hIUi4UfvIb1TpH +V3e5Kwpw+PLYdVrhyJpUmnIpHjEA7dUyGLDLxFWWBI+rSxwWjVbub9IpO9oWhIqpPX5 SMjQ== X-Gm-Message-State: AODbwcARZqqMzZu5ZOuUloYKuoKBQuKhAaQfF6YngywShk1gTHbzWxDO oXLixK2/op5L5Q== X-Received: by 10.157.80.47 with SMTP id a47mr5954860oth.220.1495209591379; Fri, 19 May 2017 08:59:51 -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 v202sm4267684oie.31.2017.05.19.08.59.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 May 2017 08:59:51 -0700 (PDT) From: Larry Finger To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Ping-Ke Shih , Larry Finger , Yan-Hsuan Chuang , Birming Chiu , Shaofu , Steven Ting Subject: [PATCH 10/10] rtlwifi: btcoex: 23b 1ant: Revise media status notify to fix no scan result issue Date: Fri, 19 May 2017 10:59:37 -0500 Message-Id: <20170519155937.17526-11-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170519155937.17526-1-Larry.Finger@lwfinger.net> References: <20170519155937.17526-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: Ping-Ke Shih Force antenna setup for no scan result issue Signed-off-by: Ping-Ke Shih Signed-off-by: Larry Finger Cc: Yan-Hsuan Chuang Cc: Birming Chiu Cc: Shaofu Cc: Steven Ting --- .../realtek/rtlwifi/btcoexist/halbtc8723b1ant.c | 39 ++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c index 61e8a7e95a91..b8b50c13d911 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c @@ -2804,18 +2804,53 @@ void ex_halbtc8723b1ant_media_status_notify(struct btc_coexist *btcoexist, u8 h2c_parameter[3] = {0}; u32 wifi_bw; u8 wifi_central_chnl; + bool wifi_under_b_mode = false; if (btcoexist->manual_control || btcoexist->stop_coex_dm || coex_sta->bt_disabled) return; - if (BTC_MEDIA_CONNECT == type) + if (type == BTC_MEDIA_CONNECT) { RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD, "[BTCoex], MEDIA connect notify\n"); - else + /* Force antenna setup for no scan result issue */ + halbtc8723b1ant_ps_tdma(btcoexist, FORCE_EXEC, false, 8); + halbtc8723b1ant_set_ant_path(btcoexist, BTC_ANT_PATH_PTA, + FORCE_EXEC, false, false); + btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, + &wifi_under_b_mode); + + /* Set CCK Tx/Rx high Pri except 11b mode */ + if (wifi_under_b_mode) { + btcoexist->btc_write_1byte(btcoexist, 0x6cd, + 0x00); /* CCK Tx */ + btcoexist->btc_write_1byte(btcoexist, 0x6cf, + 0x00); /* CCK Rx */ + } else { + btcoexist->btc_write_1byte(btcoexist, 0x6cd, + 0x00); /* CCK Tx */ + btcoexist->btc_write_1byte(btcoexist, 0x6cf, + 0x10); /* CCK Rx */ + } + + coex_dm->backup_arfr_cnt1 = + btcoexist->btc_read_4byte(btcoexist, 0x430); + coex_dm->backup_arfr_cnt2 = + btcoexist->btc_read_4byte(btcoexist, 0x434); + coex_dm->backup_retry_limit = + btcoexist->btc_read_2byte(btcoexist, 0x42a); + coex_dm->backup_ampdu_max_time = + btcoexist->btc_read_1byte(btcoexist, 0x456); + } else { RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD, "[BTCoex], MEDIA disconnect notify\n"); + btcoexist->btc_write_1byte(btcoexist, 0x6cd, 0x0); /* CCK Tx */ + btcoexist->btc_write_1byte(btcoexist, 0x6cf, 0x0); /* CCK Rx */ + + coex_sta->cck_ever_lock = false; + } + /* only 2.4G we need to inform bt the chnl mask */ btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_CENTRAL_CHNL, &wifi_central_chnl);