| Linux kernel & device driver programming |
| [ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] |
1 /* net/atm/ipcommon.c - Common items for all w 1
2
3 /* Written 1996-2000 by Werner Almesberger, EP
4
5
6 #include <linux/module.h>
7 #include <linux/string.h>
8 #include <linux/skbuff.h>
9 #include <linux/netdevice.h>
10 #include <linux/in.h>
11 #include <linux/atmdev.h>
12 #include <linux/atmclip.h>
13
14 #include "common.h"
15 #include "ipcommon.h"
16
17
18 #if 0
19 #define DPRINTK(format,args...) printk(KERN_DE
20 #else
21 #define DPRINTK(format,args...)
22 #endif
23
24
25 /*
26 * skb_migrate appends the list at "from" to "
27 * process. skb_migrate is atomic with respect
28 * "from" and "to". Note that it locks both li
29 * of potential deadlocks.
30 *
31 * This function should live in skbuff.c or sk
32 */
33
34
35 void skb_migrate(struct sk_buff_head *from,str
36 {
37 struct sk_buff *skb;
38 unsigned long flags;
39 struct sk_buff *skb_from = (struct sk_
40 struct sk_buff *skb_to = (struct sk_bu
41 struct sk_buff *prev;
42
43 spin_lock_irqsave(&from->lock,flags);
44 spin_lock(&to->lock);
45 prev = from->prev;
46 from->next->prev = to->prev;
47 prev->next = skb_to;
48 to->prev->next = from->next;
49 to->prev = from->prev;
50 for (skb = from->next; skb != skb_to;
51 skb->list = to;
52 to->qlen += from->qlen;
53 spin_unlock(&to->lock);
54 from->prev = skb_from;
55 from->next = skb_from;
56 from->qlen = 0;
57 spin_unlock_irqrestore(&from->lock,fla
58 }
59
60
61 EXPORT_SYMBOL(skb_migrate);
62
| This page was automatically generated by the LXR engine. |