Search Linux Wireless

[PATCH] mt76: fix invalid rssi report

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Deren Wu <deren.wu@xxxxxxxxxxxx>

Drop invalid rssi value to calculate a reasonable report

Fixes: 4550fb9e9810 ("mt76: improve signal strength reporting")
Signed-off-by: Deren Wu <deren.wu@xxxxxxxxxxxx>
---
 drivers/net/wireless/mediatek/mt76/mac80211.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c
index 372b94a665ec..5b53d008eb66 100644
--- a/drivers/net/wireless/mediatek/mt76/mac80211.c
+++ b/drivers/net/wireless/mediatek/mt76/mac80211.c
@@ -942,10 +942,11 @@ mt76_rx_signal(struct mt76_rx_status *status)
 	for (chains = status->chains; chains; chains >>= 1, chain_signal++) {
 		int cur, diff;
 
-		if (!(chains & BIT(0)))
+		cur = *chain_signal;
+		if (!(chains & BIT(0)) ||
+		    cur > 0)
 			continue;
 
-		cur = *chain_signal;
 		if (cur > signal)
 			swap(cur, signal);
 
-- 
2.18.0




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux