Commit 633348f2 authored by Felix Fietkau's avatar Felix Fietkau

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: default avatarFelix Fietkau <nbd@nbd.name>
parent 1a7d3f47
...@@ -121,4 +121,6 @@ void mt7603_init_debugfs(struct mt7603_dev *dev) ...@@ -121,4 +121,6 @@ void mt7603_init_debugfs(struct mt7603_dev *dev)
mt7603_reset_read); mt7603_reset_read);
debugfs_create_devm_seqfile(dev->mt76.dev, "radio", dir, debugfs_create_devm_seqfile(dev->mt76.dev, "radio", dir,
mt7603_radio_read); mt7603_radio_read);
debugfs_create_u8("sensitivity_limit", 0600, dir,
&dev->sensitivity_limit);
} }
...@@ -540,6 +540,7 @@ int mt7603_register_device(struct mt7603_dev *dev) ...@@ -540,6 +540,7 @@ int mt7603_register_device(struct mt7603_dev *dev)
dev->mphy.antenna_mask = 1; dev->mphy.antenna_mask = 1;
dev->slottime = 9; dev->slottime = 9;
dev->sensitivity_limit = 28;
ret = mt7603_init_hardware(dev); ret = mt7603_init_hardware(dev);
if (ret) if (ret)
......
...@@ -1750,7 +1750,8 @@ mt7603_false_cca_check(struct mt7603_dev *dev) ...@@ -1750,7 +1750,8 @@ mt7603_false_cca_check(struct mt7603_dev *dev)
min_signal -= 15; min_signal -= 15;
false_cca = dev->false_cca_ofdm + dev->false_cca_cck; 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) if (!dev->sensitivity)
dev->sensitivity = -92; dev->sensitivity = -92;
else else
......
...@@ -143,6 +143,7 @@ struct mt7603_dev { ...@@ -143,6 +143,7 @@ struct mt7603_dev {
u8 ed_strong_signal; u8 ed_strong_signal;
s8 sensitivity; s8 sensitivity;
u8 sensitivity_limit;
u8 beacon_check; u8 beacon_check;
u8 tx_hang_check; u8 tx_hang_check;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment