diff options
author | Jorge Boncompte [DTI2] <jorge@dti2.net> | 2011-11-21 11:25:57 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-22 22:15:42 +0100 |
commit | 4e55f5785825f18b1eb6c5cc5a9717e276925805 (patch) | |
tree | 31a7c44400e598e82e1de0a7326952d00b28767d /net/atm/common.c | |
parent | atm: clip: move clip_devs check to clip_push (diff) | |
download | linux-4e55f5785825f18b1eb6c5cc5a9717e276925805.tar.xz linux-4e55f5785825f18b1eb6c5cc5a9717e276925805.zip |
atm: Introduce vcc_process_recv_queue
This function moves the implementation found in the clip and br2684
modules to common code, correctly unlinks the skb from the queue
before pushing it and makes pppoatm use it.
Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/atm/common.c')
-rw-r--r-- | net/atm/common.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/net/atm/common.c b/net/atm/common.c index 14ff9fe39989..0b4c58fe3919 100644 --- a/net/atm/common.c +++ b/net/atm/common.c @@ -214,6 +214,26 @@ void vcc_release_async(struct atm_vcc *vcc, int reply) } EXPORT_SYMBOL(vcc_release_async); +void vcc_process_recv_queue(struct atm_vcc *vcc) +{ + struct sk_buff_head queue, *rq; + struct sk_buff *skb, *tmp; + unsigned long flags; + + __skb_queue_head_init(&queue); + rq = &sk_atm(vcc)->sk_receive_queue; + + spin_lock_irqsave(&rq->lock, flags); + skb_queue_splice_init(rq, &queue); + spin_unlock_irqrestore(&rq->lock, flags); + + skb_queue_walk_safe(&queue, skb, tmp) { + __skb_unlink(skb, &queue); + vcc->push(vcc, skb); + } +} +EXPORT_SYMBOL(vcc_process_recv_queue); + void atm_dev_signal_change(struct atm_dev *dev, char signal) { pr_debug("%s signal=%d dev=%p number=%d dev->signal=%d\n", |