summaryrefslogtreecommitdiffstats
path: root/include/net/sch_generic.h
diff options
context:
space:
mode:
authorDavid S. Miller2008-07-09 08:00:25 +0200
committerDavid S. Miller2008-07-09 08:00:25 +0200
commit3e745dd6950d72d19e4cb30dc44307e8d6671864 (patch)
treee5afcf2b77fec8565ff6b14d5cceb0cd7bd3b2af /include/net/sch_generic.h
parentpkt_sched: Add qdisc_reset_all_tx(). (diff)
downloadkernel-qcow2-linux-3e745dd6950d72d19e4cb30dc44307e8d6671864.tar.gz
kernel-qcow2-linux-3e745dd6950d72d19e4cb30dc44307e8d6671864.tar.xz
kernel-qcow2-linux-3e745dd6950d72d19e4cb30dc44307e8d6671864.zip
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>
Diffstat (limited to 'include/net/sch_generic.h')
-rw-r--r--include/net/sch_generic.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index ea33176616ff..8cfdaebbbab3 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -233,6 +233,15 @@ static inline void qdisc_reset_all_tx(struct net_device *dev)
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)
{