diff options
author | Jorge Boncompte [DTI2] <jorge@dti2.net> | 2011-11-21 05:25:57 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-22 16:15:42 -0500 |
commit | 4e55f5785825f18b1eb6c5cc5a9717e276925805 (patch) | |
tree | 31a7c44400e598e82e1de0a7326952d00b28767d /net/atm/common.c | |
parent | 3b829366cc6d0adeb4df2c2d917926f6b41c573d (diff) |
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) | |||
214 | } | 214 | } |
215 | EXPORT_SYMBOL(vcc_release_async); | 215 | EXPORT_SYMBOL(vcc_release_async); |
216 | 216 | ||
217 | void vcc_process_recv_queue(struct atm_vcc *vcc) | ||
218 | { | ||
219 | struct sk_buff_head queue, *rq; | ||
220 | struct sk_buff *skb, *tmp; | ||
221 | unsigned long flags; | ||
222 | |||
223 | __skb_queue_head_init(&queue); | ||
224 | rq = &sk_atm(vcc)->sk_receive_queue; | ||
225 | |||
226 | spin_lock_irqsave(&rq->lock, flags); | ||
227 | skb_queue_splice_init(rq, &queue); | ||
228 | spin_unlock_irqrestore(&rq->lock, flags); | ||
229 | |||
230 | skb_queue_walk_safe(&queue, skb, tmp) { | ||
231 | __skb_unlink(skb, &queue); | ||
232 | vcc->push(vcc, skb); | ||
233 | } | ||
234 | } | ||
235 | EXPORT_SYMBOL(vcc_process_recv_queue); | ||
236 | |||
217 | void atm_dev_signal_change(struct atm_dev *dev, char signal) | 237 | void atm_dev_signal_change(struct atm_dev *dev, char signal) |
218 | { | 238 | { |
219 | pr_debug("%s signal=%d dev=%p number=%d dev->signal=%d\n", | 239 | pr_debug("%s signal=%d dev=%p number=%d dev->signal=%d\n", |