Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5652863img; Wed, 27 Mar 2019 12:30:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwXvS2BOzJIlcwTen53ugqjspisT2CyS8kbiimPYkDPpgtc3zSdB+1cYmcWz1wcvn766A3J X-Received: by 2002:a62:6504:: with SMTP id z4mr2743626pfb.202.1553715010113; Wed, 27 Mar 2019 12:30:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553715010; cv=none; d=google.com; s=arc-20160816; b=a89iy7ISHdKH/CuPloG8SoTCMHUM7SaGxewwrXTLVNa360ftrXLm2EI4wOWyJ/c2W5 TgKP630Hn5eZhR7KCdiAINt0Xy9oWuFOoPb0Jz7wh8ZbpfAcbrdnOq9ivYu1YRs0j/Wq E1vHRclwQnX+dKRPz0ogKredYYeV8g3MyGb+mZb8MDiaVZQpRLHhmBt4cU+itGh9XMEG oYU0XGaNloaNbuP6l3BOMLejf+MG4oTeUZi1xV/f3ZNA6sCZD0STsrfXJaMzxQUr+F9M njWfe2VuSwsk+fDhr07LiXf5LI/rvktcwR/aEKUKzT4wH34bLYqfluaa1o/fAWhWr1Ai W/1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3qnY5vpTlmkWvMVItneZiqBhGNAnr5zYhF1KYgGNqD0=; b=jjLgCgPtDYmi/fum7Cw13OmmbxT3gDhiTaxkT9WRDCdj6X8Emyda13lCLl0t0J1qi8 wWjcs/+tvhcUe3KeX2Xwdk2WrMfPs3bPuJRBZ6Y0nmAzwvRLeuL0Cx6666LcY4F3Y9cE wYwjApk+LzcY0++uechgrGouEyGpQuG/uBuqlOYsTsaOIU3CBbZqhZkV8608n+hXUWQj ImPRgJphozsF1+QPUHZd73KpEo0eCXF1yjuvLbp2CRKT9vvI1g47X0ymDG1OtDX2gWdP MDzUo6lUvjeVvc1cVnSxD3LqmQvOsV+Ltc61GEN68iQS1zKD2W+giPyT/Sg/pS/4pwRP 4BCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1vmZh5Rv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l32si16991658pgm.130.2019.03.27.12.29.54; Wed, 27 Mar 2019 12:30:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1vmZh5Rv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387855AbfC0T2J (ORCPT + 99 others); Wed, 27 Mar 2019 15:28:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:45126 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731242AbfC0SE1 (ORCPT ); Wed, 27 Mar 2019 14:04:27 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 58B6F2183F; Wed, 27 Mar 2019 18:04:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553709866; bh=kgyC4AFq3DDzsDi/XjOf0++6sqCrex772RFyGxRgOwc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1vmZh5RvmUa/9B0qMfKiGNrIHDjlTIKD2F7lMAHXCAH2Tw6+8SAYTmA++me2KHrnb 3kk/dANDvXGTDPNtpvSqGNPr6EEkn8RAH+MzZRBNVdRa5imfFrOcAmUBSU2oic79EI 0hkyZ8mso6ArZLZpxSIBTnKvbyfMZ3ZNHQyX4G0E= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Alagu Sankar , Wen Gong , Kalle Valo , Sasha Levin , ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.0 079/262] ath10k: don't report unset rssi values to mac80211 Date: Wed, 27 Mar 2019 13:58:54 -0400 Message-Id: <20190327180158.10245-79-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alagu Sankar [ Upstream commit 7d444522303177f3a3c09b9abb104ddeea470a70 ] 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 Signed-off-by: Sasha Levin --- 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 f42bac204ef8..ecf34ce7acf0 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -2130,9 +2130,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; -- 2.19.1