Linux 2.6.26-rc5
[linux-2.6/openmoko-kernel/knife-kernel.git] / arch / um / include / net_kern.h
blobd843c7924a7cf2568a1ce88ff9182a52f4ccc322
1 /*
2 * Copyright (C) 2002 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL
4 */
6 #ifndef __UM_NET_KERN_H
7 #define __UM_NET_KERN_H
9 #include <linux/netdevice.h>
10 #include <linux/platform_device.h>
11 #include <linux/skbuff.h>
12 #include <linux/socket.h>
13 #include <linux/list.h>
14 #include <linux/workqueue.h>
16 struct uml_net {
17 struct list_head list;
18 struct net_device *dev;
19 struct platform_device pdev;
20 int index;
21 unsigned char mac[ETH_ALEN];
24 struct uml_net_private {
25 struct list_head list;
26 spinlock_t lock;
27 struct net_device *dev;
28 struct timer_list tl;
29 struct net_device_stats stats;
30 struct work_struct work;
31 int fd;
32 unsigned char mac[ETH_ALEN];
33 int max_packet;
34 unsigned short (*protocol)(struct sk_buff *);
35 int (*open)(void *);
36 void (*close)(int, void *);
37 void (*remove)(void *);
38 int (*read)(int, struct sk_buff *skb, struct uml_net_private *);
39 int (*write)(int, struct sk_buff *skb, struct uml_net_private *);
41 void (*add_address)(unsigned char *, unsigned char *, void *);
42 void (*delete_address)(unsigned char *, unsigned char *, void *);
43 char user[0];
46 struct net_kern_info {
47 void (*init)(struct net_device *, void *);
48 unsigned short (*protocol)(struct sk_buff *);
49 int (*read)(int, struct sk_buff *skb, struct uml_net_private *);
50 int (*write)(int, struct sk_buff *skb, struct uml_net_private *);
53 struct transport {
54 struct list_head list;
55 const char *name;
56 int (* const setup)(char *, char **, void *);
57 const struct net_user_info *user;
58 const struct net_kern_info *kern;
59 const int private_size;
60 const int setup_size;
63 extern struct net_device *ether_init(int);
64 extern unsigned short ether_protocol(struct sk_buff *);
65 extern int tap_setup_common(char *str, char *type, char **dev_name,
66 char **mac_out, char **gate_addr);
67 extern void register_transport(struct transport *new);
68 extern unsigned short eth_protocol(struct sk_buff *skb);
70 #endif