From patchwork Thu Feb 21 16:21:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 10824341 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D960A14E1 for ; Thu, 21 Feb 2019 16:22:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4C28319C2 for ; Thu, 21 Feb 2019 16:22:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3387319DE; Thu, 21 Feb 2019 16:22:22 +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.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 564AE319B5 for ; Thu, 21 Feb 2019 16:22:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=/s1mhY1fdjLAXXC2CVGNLRd/P8Dr+NCKcbVm5bdeOSg=; b=mAxxccNcq51hb7OcSxbp8v7qLX SkjIjQbIw83+usAFqEcpP6A2xST+7gmeZmIbXbA+YLuqF+prQuEpl2iTbw9tFI5sUUNj63QDjLNrX zuysHh06ARqA/xsywCWTaEy9e7672pWJ3FP9MigzyVBWECSljkwVkDEYVoBoxY3AYviR3euUHLLDl 05m/V6GBhHFyZpHXIvIGqZY+dgzXPP0ZNGlqJZ5TyWGS+TdlwC0uJ7a55yz/yUItYarrOl9koBXad ZmYKrQVEF4bN6lWIrri3bF/s/Wy+pYHnSDJwU/+K0BLQkRo/68eUSnaucfBpeYSmsqKwacECFc83Q 821PHUSw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gwr76-0002RH-0w; Thu, 21 Feb 2019 16:22:20 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gwr6x-0002E9-5F for ath10k@lists.infradead.org; Thu, 21 Feb 2019 16:22:15 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8B43760F62; Thu, 21 Feb 2019 16:22:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550766130; bh=+GwZXD4xWjUcnuWSVQ8CBcuz6yezp42EyM9DZzoPnvs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KCSaRXbe3nLLdYzF+hUsxIWCdWzPZqj1ZEDhrKgC7v1dW682RHinyEKBjZsw5qhrc wOx5LsW6LhKi6+CkcVZPLihT5rL4QQ0A1bJ1bJTShShX1Nro0sQmgE07sYJ2//W7h+ +UbO/BaWe6hZ55iLXxcYZdJh2S2YAB5uBKgJDUsY= Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kvalo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 1167260F40; Thu, 21 Feb 2019 16:22:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550766129; bh=+GwZXD4xWjUcnuWSVQ8CBcuz6yezp42EyM9DZzoPnvs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MPixtv6eGoZffmefN73kbozXby6PABiUcU4GEJZYmLf2WbCMN0dSiZOwl0h9cAqlc CUQ7qYHZWPhQt+J0D5MX2fMYy1EmIE37Ptmv0oTnIYvNa9kIgdEbE+7icCCjl/NZxQ bJga742SVLmEjMsliRa+xjYBUD2Aoyb6ofPjCqWI= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 1167260F40 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=kvalo@codeaurora.org From: Kalle Valo To: ath10k@lists.infradead.org Subject: [PATCH 4/4] ath10k: don't report unset rssi values to mac80211 Date: Thu, 21 Feb 2019 18:21:58 +0200 Message-Id: <1550766118-31703-5-git-send-email-kvalo@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550766118-31703-1-git-send-email-kvalo@codeaurora.org> References: <1550766118-31703-1-git-send-email-kvalo@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190221_082211_392977_41463ED8 X-CRM114-Status: GOOD ( 12.34 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alagu Sankar , linux-wireless@vger.kernel.org, Wen Gong MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Alagu Sankar The SDIO firmware does not provide RSSI value to the host, it's only set to zero. In that case don't report the value to mac80211. One risk here is that value zero might be a valid value with other firmware, currently there's no way to detect that. Without the fix, the rssi value indicated by iw changes between the actual value and -95. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00005-QCARMSWP-1. Co-developed-by: Wen Gong Signed-off-by: Alagu Sankar Signed-off-by: Wen Gong Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath10k/htt_rx.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 4fc885617de1..62479b037210 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -2119,9 +2119,15 @@ static bool ath10k_htt_rx_proc_rx_ind_hl(struct ath10k_htt *htt, hdr = (struct ieee80211_hdr *)skb->data; rx_status = IEEE80211_SKB_RXCB(skb); rx_status->chains |= BIT(0); - rx_status->signal = ATH10K_DEFAULT_NOISE_FLOOR + - rx->ppdu.combined_rssi; - rx_status->flag &= ~RX_FLAG_NO_SIGNAL_VAL; + if (rx->ppdu.combined_rssi == 0) { + /* SDIO firmware does not provide signal */ + rx_status->signal = 0; + rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL; + } else { + rx_status->signal = ATH10K_DEFAULT_NOISE_FLOOR + + rx->ppdu.combined_rssi; + rx_status->flag &= ~RX_FLAG_NO_SIGNAL_VAL; + } spin_lock_bh(&ar->data_lock); ch = ar->scan_channel;