Commit 37ec6a03 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

mt76: mt76u: add queue id parameter to mt76u_submit_rx_buffers

Add queue_id parameter to mt76u_submit_rx_buffers in order to reuse it
adding mt7663u support
Co-developed-by: default avatarSean Wang <sean.wang@mediatek.com>
Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 2fe6a556
...@@ -583,15 +583,16 @@ static void mt76u_rx_tasklet(unsigned long data) ...@@ -583,15 +583,16 @@ static void mt76u_rx_tasklet(unsigned long data)
rcu_read_unlock(); rcu_read_unlock();
} }
static int mt76u_submit_rx_buffers(struct mt76_dev *dev) static int
mt76u_submit_rx_buffers(struct mt76_dev *dev, enum mt76_rxq_id qid)
{ {
struct mt76_queue *q = &dev->q_rx[MT_RXQ_MAIN]; struct mt76_queue *q = &dev->q_rx[qid];
unsigned long flags; unsigned long flags;
int i, err = 0; int i, err = 0;
spin_lock_irqsave(&q->lock, flags); spin_lock_irqsave(&q->lock, flags);
for (i = 0; i < q->ndesc; i++) { for (i = 0; i < q->ndesc; i++) {
err = mt76u_submit_rx_buf(dev, MT_RXQ_MAIN, q->entry[i].urb); err = mt76u_submit_rx_buf(dev, qid, q->entry[i].urb);
if (err < 0) if (err < 0)
break; break;
} }
...@@ -628,7 +629,7 @@ static int mt76u_alloc_rx(struct mt76_dev *dev) ...@@ -628,7 +629,7 @@ static int mt76u_alloc_rx(struct mt76_dev *dev)
return err; return err;
} }
return mt76u_submit_rx_buffers(dev); return mt76u_submit_rx_buffers(dev, MT_RXQ_MAIN);
} }
static void mt76u_free_rx(struct mt76_dev *dev) static void mt76u_free_rx(struct mt76_dev *dev)
...@@ -668,7 +669,7 @@ int mt76u_resume_rx(struct mt76_dev *dev) ...@@ -668,7 +669,7 @@ int mt76u_resume_rx(struct mt76_dev *dev)
for (i = 0; i < q->ndesc; i++) for (i = 0; i < q->ndesc; i++)
usb_unpoison_urb(q->entry[i].urb); usb_unpoison_urb(q->entry[i].urb);
return mt76u_submit_rx_buffers(dev); return mt76u_submit_rx_buffers(dev, MT_RXQ_MAIN);
} }
EXPORT_SYMBOL_GPL(mt76u_resume_rx); EXPORT_SYMBOL_GPL(mt76u_resume_rx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment