summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/mt7915/init.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2020-07-26 20:45:58 +0200
committerFelix Fietkau <nbd@nbd.name>2020-09-24 18:10:14 +0200
commit1daf2522fa160466899cdcb87698daaa5f86fd55 (patch)
treea7b92df7576ff5e6716e6c70d699bf4fcfb90aa1 /drivers/net/wireless/mediatek/mt76/mt7915/init.c
parent38b04398c532e9bb9aa90fc07846ad0b0845fe94 (diff)
mt76: mt7915: clean up station stats polling and rate control update
Queueing a per-sta work item from the tx free path can become very expensive under load. This work is only supposed to pull rate control stats every second and deal with rate control changes. Additionally, the rate control update code was wrong, because it was confusing bit masks and bit numbers in test_bit. Fix this by introducing a dedicated device work item for rate control updates, and by polling station stats from the phy mac work. Stations requiring polling or rate control updates are added to lists protected by dev->sta_poll_lock. Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7915/init.c')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7915/init.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
index e90d0087e377..8431fda39108 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
@@ -612,6 +612,7 @@ int mt7915_register_ext_phy(struct mt7915_dev *dev)
mphy->antenna_mask = BIT(hweight8(phy->chainmask)) - 1;
mt7915_init_wiphy(mphy->hw);
+ INIT_LIST_HEAD(&phy->stats_list);
INIT_DELAYED_WORK(&phy->mac_work, mt7915_mac_work);
/*
@@ -652,7 +653,10 @@ int mt7915_register_device(struct mt7915_dev *dev)
dev->phy.dev = dev;
dev->phy.mt76 = &dev->mt76.phy;
dev->mt76.phy.priv = &dev->phy;
+ INIT_LIST_HEAD(&dev->phy.stats_list);
+ INIT_WORK(&dev->rc_work, mt7915_mac_sta_rc_work);
INIT_DELAYED_WORK(&dev->phy.mac_work, mt7915_mac_work);
+ INIT_LIST_HEAD(&dev->sta_rc_list);
INIT_LIST_HEAD(&dev->sta_poll_list);
spin_lock_init(&dev->sta_poll_lock);