diff options
author | Lorenzo Bianconi <lorenzo.bianconi@redhat.com> | 2018-09-28 14:38:45 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2018-10-01 13:34:18 +0300 |
commit | 5f1fa4cdb7a466bb427e72728f6c3361e4b2d516 (patch) | |
tree | 8b548f6cd5a5d273fdf181d9befc5fbd66b32680 /drivers/net/wireless/mediatek/mt76/mt76x02_dma.h | |
parent | 5b394355927e6b633a7cd0307f0c8056a5db182b (diff) | |
download | linux-5f1fa4cdb7a466bb427e72728f6c3361e4b2d516.tar.xz |
mt76: move wait_for_wpdma in mt76x02_dma.h
Move wait_for_wpdma utility routine in mt76x02_dma.h
in order to be reused by mt76x0 driver. Moreover add
the possibility to specify the timeout value in
wait_for_wpdma signature
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76x02_dma.h')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76x02_dma.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_dma.h b/drivers/net/wireless/mediatek/mt76/mt76x02_dma.h index 32a323ebc6a7..2396d49a84dd 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_dma.h +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_dma.h @@ -18,6 +18,7 @@ #define __MT76x02_DMA_H #include "dma.h" +#include "mt76x02_regs.h" #define MT_TXD_INFO_LEN GENMASK(15, 0) #define MT_TXD_INFO_NEXT_VLD BIT(16) @@ -57,4 +58,13 @@ enum dma_msg_port { DISCARD, }; +static inline bool +mt76x02_wait_for_wpdma(struct mt76_dev *dev, int timeout) +{ + return __mt76_poll(dev, MT_WPDMA_GLO_CFG, + MT_WPDMA_GLO_CFG_TX_DMA_BUSY | + MT_WPDMA_GLO_CFG_RX_DMA_BUSY, + 0, timeout); +} + #endif /* __MT76x02_DMA_H */ |