1 /* net/atm/ipcommon.c - Common items for all ways of doing IP over ATM */
3 /* Written 1996-2000 by Werner Almesberger, EPFL LRC/ICA */
6 #include <linux/module.h>
7 #include <linux/string.h>
8 #include <linux/skbuff.h>
9 #include <linux/netdevice.h>
11 #include <linux/atmdev.h>
12 #include <linux/atmclip.h>
19 #define DPRINTK(format,args...) printk(KERN_DEBUG format,##args)
21 #define DPRINTK(format,args...)
26 * skb_migrate appends the list at "from" to "to", emptying "from" in the
27 * process. skb_migrate is atomic with respect to all other skb operations on
28 * "from" and "to". Note that it locks both lists at the same time, so beware
29 * of potential deadlocks.
31 * This function should live in skbuff.c or skbuff.h.
35 void skb_migrate(struct sk_buff_head *from,struct sk_buff_head *to)
38 struct sk_buff *skb_from = (struct sk_buff *) from;
39 struct sk_buff *skb_to = (struct sk_buff *) to;
42 spin_lock_irqsave(&from->lock,flags);
45 from->next->prev = to->prev;
47 to->prev->next = from->next;
48 to->prev = from->prev;
49 to->qlen += from->qlen;
50 spin_unlock(&to->lock);
51 from->prev = skb_from;
52 from->next = skb_from;
54 spin_unlock_irqrestore(&from->lock,flags);
58 EXPORT_SYMBOL(skb_migrate);