提交 9d2da721 编写于 作者: J John Efstathiades 提交者: David S. Miller

lan78xx: Re-order rx_submit() to remove forward declaration

Move position of rx_submit() to remove forward declaration of
rx_complete() which is now no longer required.
Signed-off-by: NJohn Efstathiades <john.efstathiades@pebblebay.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c450a8eb
...@@ -3680,60 +3680,6 @@ static inline void rx_process(struct lan78xx_net *dev, struct sk_buff *skb) ...@@ -3680,60 +3680,6 @@ static inline void rx_process(struct lan78xx_net *dev, struct sk_buff *skb)
dev->net->stats.rx_errors++; dev->net->stats.rx_errors++;
} }
static void rx_complete(struct urb *urb);
static int rx_submit(struct lan78xx_net *dev, struct sk_buff *skb, gfp_t flags)
{
struct skb_data *entry = (struct skb_data *)skb->cb;
size_t size = dev->rx_urb_size;
struct urb *urb = entry->urb;
unsigned long lockflags;
int ret = 0;
usb_fill_bulk_urb(urb, dev->udev, dev->pipe_in,
skb->data, size, rx_complete, skb);
spin_lock_irqsave(&dev->rxq.lock, lockflags);
if (netif_device_present(dev->net) &&
netif_running(dev->net) &&
!test_bit(EVENT_RX_HALT, &dev->flags) &&
!test_bit(EVENT_DEV_ASLEEP, &dev->flags)) {
ret = usb_submit_urb(urb, flags);
switch (ret) {
case 0:
lan78xx_queue_skb(&dev->rxq, skb, rx_start);
break;
case -EPIPE:
lan78xx_defer_kevent(dev, EVENT_RX_HALT);
break;
case -ENODEV:
case -ENOENT:
netif_dbg(dev, ifdown, dev->net, "device gone\n");
netif_device_detach(dev->net);
break;
case -EHOSTUNREACH:
ret = -ENOLINK;
tasklet_schedule(&dev->bh);
break;
default:
netif_dbg(dev, rx_err, dev->net,
"rx submit, %d\n", ret);
tasklet_schedule(&dev->bh);
break;
}
} else {
netif_dbg(dev, ifdown, dev->net, "rx: stopped\n");
ret = -ENOLINK;
}
spin_unlock_irqrestore(&dev->rxq.lock, lockflags);
if (ret)
lan78xx_release_rx_buf(dev, skb);
return ret;
}
static void rx_complete(struct urb *urb) static void rx_complete(struct urb *urb)
{ {
struct sk_buff *skb = (struct sk_buff *)urb->context; struct sk_buff *skb = (struct sk_buff *)urb->context;
...@@ -3794,6 +3740,58 @@ static void rx_complete(struct urb *urb) ...@@ -3794,6 +3740,58 @@ static void rx_complete(struct urb *urb)
state = defer_bh(dev, skb, &dev->rxq, state); state = defer_bh(dev, skb, &dev->rxq, state);
} }
static int rx_submit(struct lan78xx_net *dev, struct sk_buff *skb, gfp_t flags)
{
struct skb_data *entry = (struct skb_data *)skb->cb;
size_t size = dev->rx_urb_size;
struct urb *urb = entry->urb;
unsigned long lockflags;
int ret = 0;
usb_fill_bulk_urb(urb, dev->udev, dev->pipe_in,
skb->data, size, rx_complete, skb);
spin_lock_irqsave(&dev->rxq.lock, lockflags);
if (netif_device_present(dev->net) &&
netif_running(dev->net) &&
!test_bit(EVENT_RX_HALT, &dev->flags) &&
!test_bit(EVENT_DEV_ASLEEP, &dev->flags)) {
ret = usb_submit_urb(urb, flags);
switch (ret) {
case 0:
lan78xx_queue_skb(&dev->rxq, skb, rx_start);
break;
case -EPIPE:
lan78xx_defer_kevent(dev, EVENT_RX_HALT);
break;
case -ENODEV:
case -ENOENT:
netif_dbg(dev, ifdown, dev->net, "device gone\n");
netif_device_detach(dev->net);
break;
case -EHOSTUNREACH:
ret = -ENOLINK;
tasklet_schedule(&dev->bh);
break;
default:
netif_dbg(dev, rx_err, dev->net,
"rx submit, %d\n", ret);
tasklet_schedule(&dev->bh);
break;
}
} else {
netif_dbg(dev, ifdown, dev->net, "rx: stopped\n");
ret = -ENOLINK;
}
spin_unlock_irqrestore(&dev->rxq.lock, lockflags);
if (ret)
lan78xx_release_rx_buf(dev, skb);
return ret;
}
static void lan78xx_rx_urb_submit_all(struct lan78xx_net *dev) static void lan78xx_rx_urb_submit_all(struct lan78xx_net *dev)
{ {
struct sk_buff *rx_buf; struct sk_buff *rx_buf;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册