From patchwork Thu Feb 8 05:28:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai-Heng Feng X-Patchwork-Id: 10206603 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 A648660327 for ; Thu, 8 Feb 2018 05:28:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98F952937B for ; Thu, 8 Feb 2018 05:28:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D80D29385; Thu, 8 Feb 2018 05:28:40 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable 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 1E0382937B for ; Thu, 8 Feb 2018 05:28:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750898AbeBHF2L (ORCPT ); Thu, 8 Feb 2018 00:28:11 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:60251 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750711AbeBHF2K (ORCPT ); Thu, 8 Feb 2018 00:28:10 -0500 Received: from 2.general.khfeng.us.vpn ([10.172.68.175] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1ejekg-0005LX-3w; Thu, 08 Feb 2018 05:28:06 +0000 From: Kai-Heng Feng To: kvalo@codeaurora.org Cc: ath9k-devel@qca.qualcomm.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Kai-Heng Feng Subject: [PATCH] ath9k: turn on btcoex_enable as default Date: Thu, 8 Feb 2018 13:28:01 +0800 Message-Id: <20180208052801.15670-1-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.15.1 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 Without btcoex_enable, WiFi activies make both WiFi and Bluetooth unstable if there's a bluetooth connection. Enable this option when bt_ant_diversity is disabled. BugLink: https://bugs.launchpad.net/bugs/1746164 Signed-off-by: Kai-Heng Feng --- drivers/net/wireless/ath/ath9k/init.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index e479fae5aab9..f8f6b091a077 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c @@ -56,7 +56,7 @@ static int ath9k_led_active_high = -1; module_param_named(led_active_high, ath9k_led_active_high, int, 0444); MODULE_PARM_DESC(led_active_high, "Invert LED polarity"); -static int ath9k_btcoex_enable; +static int ath9k_btcoex_enable = 1; module_param_named(btcoex_enable, ath9k_btcoex_enable, int, 0444); MODULE_PARM_DESC(btcoex_enable, "Enable wifi-BT coexistence"); @@ -693,7 +693,6 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, common->hw = sc->hw; common->priv = sc; common->debug_mask = ath9k_debug; - common->btcoex_enabled = ath9k_btcoex_enable == 1; common->disable_ani = false; /* @@ -715,14 +714,17 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, /* * Enable WLAN/BT RX Antenna diversity only when: * - * - BTCOEX is disabled. * - the user manually requests the feature. * - the HW cap is set using the platform data. */ - if (!common->btcoex_enabled && ath9k_bt_ant_diversity && + if (ath9k_bt_ant_diversity && (pCap->hw_caps & ATH9K_HW_CAP_BT_ANT_DIV)) common->bt_ant_diversity = 1; + /* Enable btcoex when ant_diversity is disabled */ + if (!common->bt_ant_diversity && ath9k_btcoex_enable) + common->btcoex_enabled = 1; + spin_lock_init(&common->cc_lock); spin_lock_init(&sc->intr_lock); spin_lock_init(&sc->sc_serial_rw);