diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2021-04-18 18:45:32 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2021-04-21 20:55:52 +0200 |
commit | cb8ed33d4b3f4ef8cbff2d164bffeca678427f5a (patch) | |
tree | 334c770c0d437731184542d9eb253ad8a767a02c /drivers/net/wireless/mediatek/mt76/dma.c | |
parent | 335e97ace24ade90aa5d5e8713bc448d2c276322 (diff) | |
download | linux-cb8ed33d4b3f4ef8cbff2d164bffeca678427f5a.tar.gz |
mt76: dma: add the capability to define a custom rx napi poll routine
Add the capability to define a custom rx napi callback for each driver.
This is a preliminary patch to properly support runtime-pm on rx side
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/dma.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/dma.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c index 6ea58aecca41..72b1cc0ecfda 100644 --- a/drivers/net/wireless/mediatek/mt76/dma.c +++ b/drivers/net/wireless/mediatek/mt76/dma.c @@ -602,8 +602,7 @@ mt76_dma_rx_process(struct mt76_dev *dev, struct mt76_queue *q, int budget) return done; } -static int -mt76_dma_rx_poll(struct napi_struct *napi, int budget) +int mt76_dma_rx_poll(struct napi_struct *napi, int budget) { struct mt76_dev *dev; int qid, done = 0, cur; @@ -626,9 +625,11 @@ mt76_dma_rx_poll(struct napi_struct *napi, int budget) return done; } +EXPORT_SYMBOL_GPL(mt76_dma_rx_poll); static int -mt76_dma_init(struct mt76_dev *dev) +mt76_dma_init(struct mt76_dev *dev, + int (*poll)(struct napi_struct *napi, int budget)) { int i; @@ -639,8 +640,7 @@ mt76_dma_init(struct mt76_dev *dev) dev->napi_dev.threaded = 1; mt76_for_each_q_rx(dev, i) { - netif_napi_add(&dev->napi_dev, &dev->napi[i], mt76_dma_rx_poll, - 64); + netif_napi_add(&dev->napi_dev, &dev->napi[i], poll, 64); mt76_dma_rx_fill(dev, &dev->q_rx[i]); napi_enable(&dev->napi[i]); } |