From patchwork Wed Jun 21 17:15:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 9802335 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 2507B60329 for ; Wed, 21 Jun 2017 17:15:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 09676285E8 for ; Wed, 21 Jun 2017 17:15:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F21D128610; Wed, 21 Jun 2017 17:15:51 +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=-5.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, 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 E3F38285E8 for ; Wed, 21 Jun 2017 17:15:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752669AbdFURPu (ORCPT ); Wed, 21 Jun 2017 13:15:50 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:36533 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752265AbdFURPs (ORCPT ); Wed, 21 Jun 2017 13:15:48 -0400 Received: by mail-oi0-f68.google.com with SMTP id g14so16355977oib.3 for ; Wed, 21 Jun 2017 10:15:48 -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=gj7CkH/8ktmV7z5OnePtjrBX0zO6zDlKSwKChbv/9ts=; b=rzyiZjEFUm9vAt2AQ51pWff+u7YwH8D6XiQVnbdYdAVf83rUaQOgr3B72Eb7Wwpsyl Q45ICjNySjRqRfgP9oUd4DJGhTUrZxryPCRApBDdJ1q42Bcn/nTkInJnCeGR4Y/GoImB Dyq+PRQafsdxhHt8T13TTaUHqs6UZPZHFkffpYhI5loMjbbp7zQ6QsOD9GPTcgMHAOcf 0eBq8JTb9mlSczp2MEHfDDPTMjN4youEpoiF5QOkHOqF1ZhTfBDjtxDHENkuT+Vaf9E4 NdRLnIqKopJxHd8aPTQwW1Um5aHqG3kg1lbABofE7n7fikA9ZfkB8jbK1khBsL4smF8n ZhnA== 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=gj7CkH/8ktmV7z5OnePtjrBX0zO6zDlKSwKChbv/9ts=; b=LigPSszL5TQR9/8u+6JN2ZB9pFH7a4nGKrrtoF+1rUtNzlKiXltA8VaNc+qAFK+Dw4 tnIaB+iX6ZhQ04jc+qg4ysdb90sl5e9M2wJAmNMB90xs34zDRcFZRdT0WNwbtR5I8Oyk csGICQYGfJ04We8RLJh6oOWdIf4vSTSHBJ8CFZAWm+TwkzMcI9VoDF1wv8iYtGsaAPmK j2W7YYF4uqSInoaUzerVLnT94+UsfThnwjF51NgdWYRKru/s8vBglIds9fH7jmbbYqr2 GmDlVeLkASwE8DYYmFRsZUmectEYsvkNQCdUqDtm4yeD9aZOWu076LPyU9wMAY8XacUY M1CA== X-Gm-Message-State: AKS2vOyTPbr7KMqrbUES6Z/ij2bZ/fy/Qf9dBZAOcVi7qxAXe84CTX27 NVmIsFfmGawxrw== X-Received: by 10.202.214.65 with SMTP id n62mr20631098oig.35.1498065347992; Wed, 21 Jun 2017 10:15:47 -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 i38sm6785237ota.3.2017.06.21.10.15.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Jun 2017 10:15:47 -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 v2 4/8] rtlwifi: Update some cases in btc_get function -- roam, 5G, AP mode, and return value. Date: Wed, 21 Jun 2017 12:15:34 -0500 Message-Id: <20170621171538.4462-5-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170621171538.4462-1-Larry.Finger@lwfinger.net> References: <20170621171538.4462-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 Return value may be false in some situations. 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/halbtcoutsrc.c | 24 +++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c index eaa916a0727b..d8fb2442f795 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c @@ -381,6 +381,7 @@ static bool halbtc_get(void *void_btcoexist, u8 get_type, void *out_buf) u32 *u32_tmp = (u32 *)out_buf; u8 *u8_tmp = (u8 *)out_buf; bool tmp = false; + bool ret = true; if (!halbtc_is_bt_coexist_available(btcoexist)) return false; @@ -388,9 +389,11 @@ static bool halbtc_get(void *void_btcoexist, u8 get_type, void *out_buf) switch (get_type) { case BTC_GET_BL_HS_OPERATION: *bool_tmp = false; + ret = false; break; case BTC_GET_BL_HS_CONNECTING: *bool_tmp = false; + ret = false; break; case BTC_GET_BL_WIFI_CONNECTED: if (rtlpriv->mac80211.opmode == NL80211_IFTYPE_STATION && @@ -429,11 +432,16 @@ static bool halbtc_get(void *void_btcoexist, u8 get_type, void *out_buf) *bool_tmp = false; break; case BTC_GET_BL_WIFI_UNDER_5G: - /* TODO */ - *bool_tmp = false; + if (rtlhal->current_bandtype == BAND_ON_5G) + *bool_tmp = true; + else + *bool_tmp = false; break; case BTC_GET_BL_WIFI_AP_MODE_ENABLE: - *bool_tmp = false; + if (mac->opmode == NL80211_IFTYPE_AP) + *bool_tmp = true; + else + *bool_tmp = false; break; case BTC_GET_BL_WIFI_ENABLE_ENCRYPTION: if (NO_ENCRYPTION == rtlpriv->sec.pairwise_enc_algorithm) @@ -460,8 +468,8 @@ static bool halbtc_get(void *void_btcoexist, u8 get_type, void *out_buf) *s32_tmp = halbtc_get_wifi_rssi(rtlpriv); break; case BTC_GET_S4_HS_RSSI: - /* TODO */ - *s32_tmp = halbtc_get_wifi_rssi(rtlpriv); + *s32_tmp = 0; + ret = false; break; case BTC_GET_U4_WIFI_BW: *u32_tmp = halbtc_get_wifi_bw(btcoexist); @@ -491,7 +499,8 @@ static bool halbtc_get(void *void_btcoexist, u8 get_type, void *out_buf) *u8_tmp = halbtc_get_wifi_central_chnl(btcoexist); break; case BTC_GET_U1_WIFI_HS_CHNL: - *u8_tmp = 1; + *u8_tmp = 0; + ret = false; break; case BTC_GET_U1_AP_NUM: /* driver do not know AP num, @@ -512,10 +521,11 @@ static bool halbtc_get(void *void_btcoexist, u8 get_type, void *out_buf) break; default: + ret = false; break; } - return true; + return ret; } static bool halbtc_set(void *void_btcoexist, u8 set_type, void *in_buf)