mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: move mt76_mmio_wed_offload_{enable,disable} in common code
mt76_mmio_wed_offload_enable and mt76_mmio_wed_offload_disable routines will be reused by mt7996 driver for wed support. Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
ea28142891
commit
9fb0277d7e
@@ -157,6 +157,28 @@ unmap:
|
||||
return -ENOMEM;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_mmio_wed_init_rx_buf);
|
||||
|
||||
int mt76_mmio_wed_offload_enable(struct mtk_wed_device *wed)
|
||||
{
|
||||
struct mt76_dev *dev = container_of(wed, struct mt76_dev, mmio.wed);
|
||||
|
||||
spin_lock_bh(&dev->token_lock);
|
||||
dev->token_size = wed->wlan.token_start;
|
||||
spin_unlock_bh(&dev->token_lock);
|
||||
|
||||
return !wait_event_timeout(dev->tx_wait, !dev->wed_token_count, HZ);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_mmio_wed_offload_enable);
|
||||
|
||||
void mt76_mmio_wed_offload_disable(struct mtk_wed_device *wed)
|
||||
{
|
||||
struct mt76_dev *dev = container_of(wed, struct mt76_dev, mmio.wed);
|
||||
|
||||
spin_lock_bh(&dev->token_lock);
|
||||
dev->token_size = dev->drv->token_size;
|
||||
spin_unlock_bh(&dev->token_lock);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_mmio_wed_offload_disable);
|
||||
#endif /*CONFIG_NET_MEDIATEK_SOC_WED */
|
||||
|
||||
void mt76_mmio_init(struct mt76_dev *dev, void __iomem *regs)
|
||||
|
||||
Reference in New Issue
Block a user