Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322735
b: refs/heads/master
c: 85e8787
h: refs/heads/master
i:
  322733: 9f60a34
  322731: e4f968c
  322727: aa5308a
  322719: ee6aa8a
v: v3
  • Loading branch information
Bjørn Mork authored and David S. Miller committed Sep 3, 2012
1 parent 4d8eb9b commit e7be737
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4c3a5bdae293f75cdf729c6c00124e8489af2276
refs/heads/master: 85e87870fa18ec9f5df98e2d3b48f3699560a570
16 changes: 12 additions & 4 deletions trunk/drivers/net/usb/usbnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1201,19 +1201,26 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
}
EXPORT_SYMBOL_GPL(usbnet_start_xmit);

static void rx_alloc_submit(struct usbnet *dev, gfp_t flags)
static int rx_alloc_submit(struct usbnet *dev, gfp_t flags)
{
struct urb *urb;
int i;
int ret = 0;

/* don't refill the queue all at once */
for (i = 0; i < 10 && dev->rxq.qlen < RX_QLEN(dev); i++) {
urb = usb_alloc_urb(0, flags);
if (urb != NULL) {
if (rx_submit(dev, urb, flags) == -ENOLINK)
return;
ret = rx_submit(dev, urb, flags);
if (ret)
goto err;
} else {
ret = -ENOMEM;
goto err;
}
}
err:
return ret;
}

/*-------------------------------------------------------------------------*/
Expand Down Expand Up @@ -1257,7 +1264,8 @@ static void usbnet_bh (unsigned long param)
int temp = dev->rxq.qlen;

if (temp < RX_QLEN(dev)) {
rx_alloc_submit(dev, GFP_ATOMIC);
if (rx_alloc_submit(dev, GFP_ATOMIC) == -ENOLINK)
return;
if (temp != dev->rxq.qlen)
netif_dbg(dev, link, dev->net,
"rxqlen %d --> %d\n",
Expand Down

0 comments on commit e7be737

Please sign in to comment.