diff options
author | David S. Miller <davem@davemloft.net> | 2008-07-09 02:00:25 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-09 02:00:25 -0400 |
commit | 3e745dd6950d72d19e4cb30dc44307e8d6671864 (patch) | |
tree | e5afcf2b77fec8565ff6b14d5cceb0cd7bd3b2af /include/net | |
parent | 5aa709954a32a646c0cf14fdf7c8834db4ff1c03 (diff) |
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')
-rw-r--r-- | include/net/irda/irda_device.h | 2 | ||||
-rw-r--r-- | include/net/sch_generic.h | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h index 16fbf672e0b2..3025ae17ddbe 100644 --- a/include/net/irda/irda_device.h +++ b/include/net/irda/irda_device.h | |||
@@ -223,7 +223,7 @@ int irda_device_is_receiving(struct net_device *dev); | |||
223 | /* Interface for internal use */ | 223 | /* Interface for internal use */ |
224 | static inline int irda_device_txqueue_empty(const struct net_device *dev) | 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 | int irda_device_set_raw_mode(struct net_device* self, int status); | 228 | int irda_device_set_raw_mode(struct net_device* self, int status); |
229 | struct net_device *alloc_irdadev(int sizeof_priv); | 229 | struct net_device *alloc_irdadev(int sizeof_priv); |
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) | |||
233 | qdisc_reset(dev->tx_queue.qdisc); | 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 | static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, | 245 | static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, |
237 | struct sk_buff_head *list) | 246 | struct sk_buff_head *list) |
238 | { | 247 | { |