Blame view

arch/um/include/shared/net_kern.h 1.84 KB
4ea21cd91   Jeff Dike   [PATCH] uml: netw...
1
  /*
b53f35a80   Jeff Dike   uml: network driv...
2
   * Copyright (C) 2002 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
3
4
5
6
7
   * Licensed under the GPL
   */
  
  #ifndef __UM_NET_KERN_H
  #define __UM_NET_KERN_H
bbc5b2128   Al Viro   [PATCH] missing p...
8
9
10
11
12
  #include <linux/netdevice.h>
  #include <linux/platform_device.h>
  #include <linux/skbuff.h>
  #include <linux/socket.h>
  #include <linux/list.h>
eff3b634d   Peter Zijlstra   [PATCH] uml: fix ...
13
  #include <linux/workqueue.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
14
15
16
17
18
19
20
  
  struct uml_net {
  	struct list_head list;
  	struct net_device *dev;
  	struct platform_device pdev;
  	int index;
  	unsigned char mac[ETH_ALEN];
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
21
22
23
24
25
26
27
  };
  
  struct uml_net_private {
  	struct list_head list;
  	spinlock_t lock;
  	struct net_device *dev;
  	struct timer_list tl;
cfa8707aa   Stephen Hemminger   uml: convert netw...
28

eff3b634d   Peter Zijlstra   [PATCH] uml: fix ...
29
  	struct work_struct work;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
30
31
  	int fd;
  	unsigned char mac[ETH_ALEN];
b53f35a80   Jeff Dike   uml: network driv...
32
  	int max_packet;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
33
34
35
36
  	unsigned short (*protocol)(struct sk_buff *);
  	int (*open)(void *);
  	void (*close)(int, void *);
  	void (*remove)(void *);
b53f35a80   Jeff Dike   uml: network driv...
37
38
  	int (*read)(int, struct sk_buff *skb, struct uml_net_private *);
  	int (*write)(int, struct sk_buff *skb, struct uml_net_private *);
4ea21cd91   Jeff Dike   [PATCH] uml: netw...
39

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
40
41
  	void (*add_address)(unsigned char *, unsigned char *, void *);
  	void (*delete_address)(unsigned char *, unsigned char *, void *);
c74c69b44   Paolo 'Blaisorblade' Giarrusso   uml: Replace one-...
42
  	char user[0];
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
43
44
45
46
47
  };
  
  struct net_kern_info {
  	void (*init)(struct net_device *, void *);
  	unsigned short (*protocol)(struct sk_buff *);
b53f35a80   Jeff Dike   uml: network driv...
48
49
  	int (*read)(int, struct sk_buff *skb, struct uml_net_private *);
  	int (*write)(int, struct sk_buff *skb, struct uml_net_private *);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
50
51
52
53
  };
  
  struct transport {
  	struct list_head list;
d3b7f69de   Jeff Dike   [PATCH] uml: add ...
54
55
  	const char *name;
  	int (* const setup)(char *, char **, void *);
5e7672ec3   Jeff Dike   [PATCH] uml: cons...
56
57
  	const struct net_user_info *user;
  	const struct net_kern_info *kern;
d3b7f69de   Jeff Dike   [PATCH] uml: add ...
58
59
  	const int private_size;
  	const int setup_size;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
60
61
62
63
  };
  
  extern struct net_device *ether_init(int);
  extern unsigned short ether_protocol(struct sk_buff *);
4ea21cd91   Jeff Dike   [PATCH] uml: netw...
64
  extern int tap_setup_common(char *str, char *type, char **dev_name,
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
65
66
67
68
69
  			    char **mac_out, char **gate_addr);
  extern void register_transport(struct transport *new);
  extern unsigned short eth_protocol(struct sk_buff *skb);
  
  #endif