Commit 8e31f0d3 authored by Felix Fietkau's avatar Felix Fietkau Committed by Kalle Valo
Browse files

mt76: fix variable gain adjustment range



The range should only be limited to 4 for really weak signals, for all
other gain settings the range is 16.

Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent fa967b58
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -485,7 +485,7 @@ static void
mt76x2_phy_adjust_vga_gain(struct mt76x2_dev *dev)
{
	u32 false_cca;
	u8 limit = dev->cal.low_gain > 1 ? 4 : 16;
	u8 limit = dev->cal.low_gain > 0 ? 16 : 4;

	false_cca = FIELD_GET(MT_RX_STAT_1_CCA_ERRORS, mt76_rr(dev, MT_RX_STAT_1));
	if (false_cca > 800 && dev->cal.agc_gain_adjust < limit)