This is a helper function, currently used by IRDA.
This is being added so that we can contain and isolate as many
explicit ->tx_queue references in the tree as possible.
Signed-off-by: David S. Miller <davem@davemloft.net>
/* Interface for internal use */
static inline int irda_device_txqueue_empty(const struct net_device *dev)
{
- return skb_queue_empty(&dev->tx_queue.qdisc->q);
+ return qdisc_all_tx_empty(dev);
}
int irda_device_set_raw_mode(struct net_device* self, int status);
struct net_device *alloc_irdadev(int sizeof_priv);
qdisc_reset(dev->tx_queue.qdisc);
}
+/* Are all TX queues of the device empty? */
+static inline bool qdisc_all_tx_empty(const struct net_device *dev)
+{
+ const struct netdev_queue *txq = &dev->tx_queue;
+ const struct Qdisc *q = txq->qdisc;
+
+ return (q->q.qlen == 0);
+}
+
static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch,
struct sk_buff_head *list)
{