diff options
Diffstat (limited to 'arch/um/os-Linux/drivers/tuntap_kern.c')
-rw-r--r-- | arch/um/os-Linux/drivers/tuntap_kern.c | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/arch/um/os-Linux/drivers/tuntap_kern.c b/arch/um/os-Linux/drivers/tuntap_kern.c index f1714e7fb1d0..9d384807b077 100644 --- a/arch/um/os-Linux/drivers/tuntap_kern.c +++ b/arch/um/os-Linux/drivers/tuntap_kern.c | |||
@@ -1,16 +1,13 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2001 Jeff Dike (jdike@karaya.com) | 2 | * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) |
3 | * Licensed under the GPL | 3 | * Licensed under the GPL |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #include "linux/stddef.h" | 6 | #include <linux/netdevice.h> |
7 | #include "linux/netdevice.h" | 7 | #include <linux/init.h> |
8 | #include "linux/etherdevice.h" | 8 | #include <linux/skbuff.h> |
9 | #include "linux/skbuff.h" | 9 | #include <asm/errno.h> |
10 | #include "linux/init.h" | ||
11 | #include "asm/errno.h" | ||
12 | #include "net_kern.h" | 10 | #include "net_kern.h" |
13 | #include "net_user.h" | ||
14 | #include "tuntap.h" | 11 | #include "tuntap.h" |
15 | 12 | ||
16 | struct tuntap_init { | 13 | struct tuntap_init { |
@@ -38,19 +35,15 @@ static void tuntap_init(struct net_device *dev, void *data) | |||
38 | printk("\n"); | 35 | printk("\n"); |
39 | } | 36 | } |
40 | 37 | ||
41 | static int tuntap_read(int fd, struct sk_buff **skb, | 38 | static int tuntap_read(int fd, struct sk_buff *skb, struct uml_net_private *lp) |
42 | struct uml_net_private *lp) | ||
43 | { | 39 | { |
44 | *skb = ether_adjust_skb(*skb, ETH_HEADER_OTHER); | 40 | return net_read(fd, skb_mac_header(skb), |
45 | if(*skb == NULL) return(-ENOMEM); | 41 | skb->dev->mtu + ETH_HEADER_OTHER); |
46 | return(net_read(fd, skb_mac_header(*skb), | ||
47 | (*skb)->dev->mtu + ETH_HEADER_OTHER)); | ||
48 | } | 42 | } |
49 | 43 | ||
50 | static int tuntap_write(int fd, struct sk_buff **skb, | 44 | static int tuntap_write(int fd, struct sk_buff *skb, struct uml_net_private *lp) |
51 | struct uml_net_private *lp) | ||
52 | { | 45 | { |
53 | return(net_write(fd, (*skb)->data, (*skb)->len)); | 46 | return net_write(fd, skb->data, skb->len); |
54 | } | 47 | } |
55 | 48 | ||
56 | const struct net_kern_info tuntap_kern_info = { | 49 | const struct net_kern_info tuntap_kern_info = { |
@@ -67,11 +60,11 @@ int tuntap_setup(char *str, char **mac_out, void *data) | |||
67 | *init = ((struct tuntap_init) | 60 | *init = ((struct tuntap_init) |
68 | { .dev_name = NULL, | 61 | { .dev_name = NULL, |
69 | .gate_addr = NULL }); | 62 | .gate_addr = NULL }); |
70 | if(tap_setup_common(str, "tuntap", &init->dev_name, mac_out, | 63 | if (tap_setup_common(str, "tuntap", &init->dev_name, mac_out, |
71 | &init->gate_addr)) | 64 | &init->gate_addr)) |
72 | return(0); | 65 | return 0; |
73 | 66 | ||
74 | return(1); | 67 | return 1; |
75 | } | 68 | } |
76 | 69 | ||
77 | static struct transport tuntap_transport = { | 70 | static struct transport tuntap_transport = { |