summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/util.c
AgeCommit message (Collapse)Author
2020-09-24mt76: add utility functions for deferring work to a kernel threadFelix Fietkau
In order to avoid keeping work like tx scheduling pinned to the CPU it was scheduled from, it makes sense to switch from tasklets to kernel threads. Unlike a workqueue, this one only allows one fixed worker function to be executed by the worker thread. Because of that, there is less locking and less code for scheduling involved. This is important because the tx worker is scheduled often in a hot path Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-07-21mt76: rely on register macrosLorenzo Bianconi
For consistency with the rest of the code always rely on defined macros for register access Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-28mt76: fix wcid allocation issuesFelix Fietkau
mt76 core uses ffs() to find the next free bit. This works well for 32 bit architectures where BITS_PER_LONG is 32. ffs only checks 32 bit values, so allocation fails on 64 bit architectures. Additionally, the wcid mask array was too small in cases where the array was not a multiple of BITS_PER_LONG. Fix this by making the wcid mask array u32 instead and use DIV_ROUND_UP for the size, just in case we ever bump it to a value that's not a multiple of 32. Reported-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: fix max wtbl size for 7663Lorenzo Bianconi
Current mt7663 offload firmware can support up to 32 wtbl entries Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support") Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: add multiple wiphy support to mt76_get_min_avg_rssiFelix Fietkau
Allow tracking clients of both wiphys separately Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: switch to SPDX tag instead of verbose boilerplate textRyder Lee
No functional change intended. Add SPDX identifiers to all remaining files in /mt76. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-17mt76: fix rssi ewma trackingFelix Fietkau
The generic EWMA code cannot deal with negative numbers, so convert signal to a positive number before adding it Fixes mt76x2 AGC tuning Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-17mt76: move mt76x02_phy_get_min_avg_rssi to mt76 coreFelix Fietkau
This will be used by mt7603 as well Signed-off-by: Felix Fietkau <nbd@nbd.name>
2017-12-07mt76: add common code shared between multiple chipsetsFelix Fietkau
This will be used by drivers for MT76x2e, MT7603e and MT7628 Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>