Skip to contentSkip to conversation

mt76x2: fix avg_rssi estimation

PATCH In review Lorenzo Bianconi 3 participants 3 messages May 2, 2018 – May 4, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 mt76x2: fix avg_rssi estimation

Add leftover filter coefficients in IIR rssi estimation

Fixes 7bc04215a66b ("mt76: add driver code for MT76x2e")
---
 drivers/net/wireless/mediatek/mt76/mt76x2_phy.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt76/mt76x2_phy.c +4 -2
index 038d1fe6c726..c1c38ca3330a 100644
@@ -508,8 +508,10 @@ mt76x2_phy_update_channel_gain(struct mt76x2_dev *dev)
 	u8 gain_delta;
 	int low_gain;
 
-	dev->cal.avg_rssi[0] = (dev->cal.avg_rssi[0] * 15) / 16 + (rssi0 << 8);
-	dev->cal.avg_rssi[1] = (dev->cal.avg_rssi[1] * 15) / 16 + (rssi1 << 8);
+	dev->cal.avg_rssi[0] = (dev->cal.avg_rssi[0] * 15) / 16 +
+			       (rssi0 << 8) / 16;
+	dev->cal.avg_rssi[1] = (dev->cal.avg_rssi[1] * 15) / 16 +
+			       (rssi1 << 8) / 16;
 	dev->cal.avg_rssi_all = (dev->cal.avg_rssi[0] +
 				 dev->cal.avg_rssi[1]) / 512;
 
Signature · 1 line
2.14.3
#3 lore raw
In reply to Lorenzo Bianconi
Quoted 5 lines · Lorenzo Bianconi

Add leftover filter coefficients in IIR rssi estimation

Fixes 7bc04215a66b ("mt76: add driver code for MT76x2e")

Patch applied to wireless-drivers-next.git, thanks.

c990affd5abc mt76x2: fix avg_rssi estimation

Signature · 3 lines
https://patchwork.kernel.org/patch/10375267/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches