diff options
author | Felix Fietkau <nbd@nbd.name> | 2020-02-22 10:02:21 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2020-03-17 17:13:59 +0100 |
commit | 633348f2ca7eb0e8ac285ece3332973978807485 (patch) | |
tree | a6c5798ebd0f6eff39c9664d6c0b99b49b344225 | |
parent | 1a7d3f47931ff721ac4459a6166db99e33fd28b7 (diff) |
mt76: mt7603: add upper limit for dynamic sensitivity minimum receive power
If the minimum power is raised too much, it can make it impossible for weaker
clients to connect, and there are some scenarios where the false detects will
not go down no matter how much the sensitivity is adjusted.
Fixes connectivity issues in some rare cases
Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt7603/debugfs.c index 47c85a9fac28..a84e801d4cf0 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/debugfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/debugfs.c @@ -121,4 +121,6 @@ void mt7603_init_debugfs(struct mt7603_dev *dev) mt7603_reset_read); debugfs_create_devm_seqfile(dev->mt76.dev, "radio", dir, mt7603_radio_read); + debugfs_create_u8("sensitivity_limit", 0600, dir, + &dev->sensitivity_limit); } diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/init.c b/drivers/net/wireless/mediatek/mt76/mt7603/init.c index 9e40e81bcc29..97ba5ddc44bb 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/init.c @@ -540,6 +540,7 @@ int mt7603_register_device(struct mt7603_dev *dev) dev->mphy.antenna_mask = 1; dev->slottime = 9; + dev->sensitivity_limit = 28; ret = mt7603_init_hardware(dev); if (ret) diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c index 8f5ca9283f7d..a3daae41f2f4 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c @@ -1750,7 +1750,8 @@ mt7603_false_cca_check(struct mt7603_dev *dev) min_signal -= 15; false_cca = dev->false_cca_ofdm + dev->false_cca_cck; - if (false_cca > 600) { + if (false_cca > 600 && + dev->sensitivity < -100 + dev->sensitivity_limit) { if (!dev->sensitivity) dev->sensitivity = -92; else diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h b/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h index ef374641fe80..831a269472b3 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h +++ b/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h @@ -143,6 +143,7 @@ struct mt7603_dev { u8 ed_strong_signal; s8 sensitivity; + u8 sensitivity_limit; u8 beacon_check; u8 tx_hang_check; |