summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek/mt76/mt76x02_phy.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2019-03-02 18:19:20 +0100
committerFelix Fietkau <nbd@nbd.name>2019-03-07 12:50:23 +0100
commita0ac806109277bd865b1048ec521f708b195670b (patch)
treee4b7911679fa82a927ee995077051c9be43e4504 /drivers/net/wireless/mediatek/mt76/mt76x02_phy.c
parent3fd0824a2f800a2870569d385917ae1102647055 (diff)
mt76: mt76x02: reduce false positives in ED/CCA tx blocking
Full tx blocking (as opposed to CCA blocking) should only happen if there is a continuous non-802.11 signal above the energy detect threshold. Unfortunately the ED/CCA counter can't detect that, as it also counts 802.11 signals as busy. Similar to the vendor code, implement a learning mode that waits until the AGC gain has already been adjusted to the lowest value (due to false CCA events), and the number of false CCA events still remains high, and the blocking threshold is exceeded for more than 5 seconds. Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76x02_phy.c')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt76x02_phy.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_phy.c b/drivers/net/wireless/mediatek/mt76/mt76x02_phy.c
index a020c757ba5c..a54b63a96eae 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_phy.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_phy.c
@@ -194,6 +194,8 @@ bool mt76x02_phy_adjust_vga_gain(struct mt76x02_dev *dev)
ret = true;
}
+ dev->cal.agc_lowest_gain = dev->cal.agc_gain_adjust >= limit;
+
return ret;
}
EXPORT_SYMBOL_GPL(mt76x02_phy_adjust_vga_gain);