clear_bit(EVENT_DEV_OPEN, &dev->flags);
netif_stop_queue (net);
+ netdev_reset_queue(net);
netif_info(dev, ifdown, dev->net,
"stop stats: rx/tx %lu/%lu, errs %lu/%lu\n",
}
set_bit(EVENT_DEV_OPEN, &dev->flags);
+ netdev_reset_queue(net);
netif_start_queue (net);
netif_info(dev, ifup, dev->net,
"open: enable queueing (rx %d, tx %d) mtu %d %s framing\n",
case 0:
netif_trans_update(net);
__usbnet_queue_skb(&dev->txq, skb, tx_start);
+ netdev_sent_queue(net, skb->len);
if (dev->txq.qlen >= TX_QLEN (dev))
netif_stop_queue (net);
}
static void usbnet_bh(struct timer_list *t)
{
struct usbnet *dev = timer_container_of(dev, t, delay);
+ unsigned int bytes_compl = 0, pkts_compl = 0;
struct sk_buff *skb;
struct skb_data *entry;
usb_free_skb(skb);
continue;
case tx_done:
+ bytes_compl += skb->len;
+ pkts_compl++;
kfree(entry->urb->sg);
fallthrough;
case rx_cleanup:
}
}
+ spin_lock_bh(&dev->bql_spinlock);
+ netdev_completed_queue(dev->net, pkts_compl, bytes_compl);
+ spin_unlock_bh(&dev->bql_spinlock);
+
/* restart RX again after disabling due to high error rate */
clear_bit(EVENT_RX_KILL, &dev->flags);
skb_queue_head_init (&dev->txq);
skb_queue_head_init (&dev->done);
skb_queue_head_init(&dev->rxq_pause);
+ spin_lock_init(&dev->bql_spinlock);
INIT_WORK(&dev->bh_work, usbnet_bh_work);
INIT_WORK (&dev->kevent, usbnet_deferred_kevent);
init_usb_anchor(&dev->deferred);
#include <linux/skbuff.h>
#include <linux/types.h>
#include <linux/usb.h>
+#include <linux/spinlock.h>
/* interface from usbnet core to each USB networking link we handle */
struct usbnet {
struct mutex interrupt_mutex;
struct usb_anchor deferred;
struct work_struct bh_work;
+ spinlock_t bql_spinlock;
struct work_struct kevent;
unsigned long flags;