Commit a5ba16eb authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by Felix Fietkau

mt76usb: change mt76u_submit_buf

Remove unnecessery arguments and change the function name since is
now used only for RX.
Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 02d49a2e
...@@ -394,18 +394,6 @@ mt76u_fill_bulk_urb(struct mt76_dev *dev, int dir, int index, ...@@ -394,18 +394,6 @@ mt76u_fill_bulk_urb(struct mt76_dev *dev, int dir, int index,
complete_fn, context); complete_fn, context);
} }
static int
mt76u_submit_buf(struct mt76_dev *dev, int dir, int index,
struct mt76u_buf *buf, gfp_t gfp,
usb_complete_t complete_fn, void *context)
{
mt76u_fill_bulk_urb(dev, dir, index, buf, complete_fn,
context);
trace_submit_urb(dev, buf->urb);
return usb_submit_urb(buf->urb, gfp);
}
static inline struct mt76u_buf static inline struct mt76u_buf
*mt76u_get_next_rx_entry(struct mt76_queue *q) *mt76u_get_next_rx_entry(struct mt76_queue *q)
{ {
...@@ -513,6 +501,16 @@ static void mt76u_complete_rx(struct urb *urb) ...@@ -513,6 +501,16 @@ static void mt76u_complete_rx(struct urb *urb)
spin_unlock_irqrestore(&q->lock, flags); spin_unlock_irqrestore(&q->lock, flags);
} }
static int
mt76u_submit_rx_buf(struct mt76_dev *dev, struct mt76u_buf *buf)
{
mt76u_fill_bulk_urb(dev, USB_DIR_IN, MT_EP_IN_PKT_RX, buf,
mt76u_complete_rx, dev);
trace_submit_urb(dev, buf->urb);
return usb_submit_urb(buf->urb, GFP_ATOMIC);
}
static void mt76u_rx_tasklet(unsigned long data) static void mt76u_rx_tasklet(unsigned long data)
{ {
struct mt76_dev *dev = (struct mt76_dev *)data; struct mt76_dev *dev = (struct mt76_dev *)data;
...@@ -534,9 +532,7 @@ static void mt76u_rx_tasklet(unsigned long data) ...@@ -534,9 +532,7 @@ static void mt76u_rx_tasklet(unsigned long data)
if (err < 0) if (err < 0)
break; break;
} }
mt76u_submit_buf(dev, USB_DIR_IN, MT_EP_IN_PKT_RX, mt76u_submit_rx_buf(dev, buf);
buf, GFP_ATOMIC,
mt76u_complete_rx, dev);
} }
mt76_rx_poll_complete(dev, MT_RXQ_MAIN, NULL); mt76_rx_poll_complete(dev, MT_RXQ_MAIN, NULL);
...@@ -551,9 +547,7 @@ int mt76u_submit_rx_buffers(struct mt76_dev *dev) ...@@ -551,9 +547,7 @@ int mt76u_submit_rx_buffers(struct mt76_dev *dev)
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_buf(dev, USB_DIR_IN, MT_EP_IN_PKT_RX, err = mt76u_submit_rx_buf(dev, &q->entry[i].ubuf);
&q->entry[i].ubuf, GFP_ATOMIC,
mt76u_complete_rx, dev);
if (err < 0) if (err < 0)
break; break;
} }
......
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