Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pkt_sched: Add qdisc_all_tx_empty()

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>

+10 -1
+1 -1
include/net/irda/irda_device.h
··· 223 223 /* Interface for internal use */ 224 224 static inline int irda_device_txqueue_empty(const struct net_device *dev) 225 225 { 226 - return skb_queue_empty(&dev->tx_queue.qdisc->q); 226 + return qdisc_all_tx_empty(dev); 227 227 } 228 228 int irda_device_set_raw_mode(struct net_device* self, int status); 229 229 struct net_device *alloc_irdadev(int sizeof_priv);
+9
include/net/sch_generic.h
··· 233 233 qdisc_reset(dev->tx_queue.qdisc); 234 234 } 235 235 236 + /* Are all TX queues of the device empty? */ 237 + static inline bool qdisc_all_tx_empty(const struct net_device *dev) 238 + { 239 + const struct netdev_queue *txq = &dev->tx_queue; 240 + const struct Qdisc *q = txq->qdisc; 241 + 242 + return (q->q.qlen == 0); 243 + } 244 + 236 245 static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, 237 246 struct sk_buff_head *list) 238 247 {