diff options
Diffstat (limited to 'include/linux/netpoll.h')
-rw-r--r-- | include/linux/netpoll.h | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index 66d5379c305e..9d7d8c64f7c8 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
@@ -12,28 +12,38 @@ | |||
12 | #include <linux/rcupdate.h> | 12 | #include <linux/rcupdate.h> |
13 | #include <linux/list.h> | 13 | #include <linux/list.h> |
14 | 14 | ||
15 | union inet_addr { | ||
16 | __u32 all[4]; | ||
17 | __be32 ip; | ||
18 | __be32 ip6[4]; | ||
19 | struct in_addr in; | ||
20 | struct in6_addr in6; | ||
21 | }; | ||
22 | |||
15 | struct netpoll { | 23 | struct netpoll { |
16 | struct net_device *dev; | 24 | struct net_device *dev; |
17 | char dev_name[IFNAMSIZ]; | 25 | char dev_name[IFNAMSIZ]; |
18 | const char *name; | 26 | const char *name; |
19 | void (*rx_hook)(struct netpoll *, int, char *, int); | 27 | void (*rx_hook)(struct netpoll *, int, char *, int); |
20 | 28 | ||
21 | __be32 local_ip, remote_ip; | 29 | union inet_addr local_ip, remote_ip; |
30 | bool ipv6; | ||
22 | u16 local_port, remote_port; | 31 | u16 local_port, remote_port; |
23 | u8 remote_mac[ETH_ALEN]; | 32 | u8 remote_mac[ETH_ALEN]; |
24 | 33 | ||
25 | struct list_head rx; /* rx_np list element */ | 34 | struct list_head rx; /* rx_np list element */ |
26 | struct rcu_head rcu; | 35 | struct work_struct cleanup_work; |
27 | }; | 36 | }; |
28 | 37 | ||
29 | struct netpoll_info { | 38 | struct netpoll_info { |
30 | atomic_t refcnt; | 39 | atomic_t refcnt; |
31 | 40 | ||
32 | int rx_flags; | 41 | unsigned long rx_flags; |
33 | spinlock_t rx_lock; | 42 | spinlock_t rx_lock; |
43 | struct mutex dev_lock; | ||
34 | struct list_head rx_np; /* netpolls that registered an rx_hook */ | 44 | struct list_head rx_np; /* netpolls that registered an rx_hook */ |
35 | 45 | ||
36 | struct sk_buff_head arp_tx; /* list of arp requests to reply to */ | 46 | struct sk_buff_head neigh_tx; /* list of neigh requests to reply to */ |
37 | struct sk_buff_head txq; | 47 | struct sk_buff_head txq; |
38 | 48 | ||
39 | struct delayed_work tx_work; | 49 | struct delayed_work tx_work; |
@@ -42,6 +52,14 @@ struct netpoll_info { | |||
42 | struct rcu_head rcu; | 52 | struct rcu_head rcu; |
43 | }; | 53 | }; |
44 | 54 | ||
55 | #ifdef CONFIG_NETPOLL | ||
56 | extern int netpoll_rx_disable(struct net_device *dev); | ||
57 | extern void netpoll_rx_enable(struct net_device *dev); | ||
58 | #else | ||
59 | static inline int netpoll_rx_disable(struct net_device *dev) { return 0; } | ||
60 | static inline void netpoll_rx_enable(struct net_device *dev) { return; } | ||
61 | #endif | ||
62 | |||
45 | void netpoll_send_udp(struct netpoll *np, const char *msg, int len); | 63 | void netpoll_send_udp(struct netpoll *np, const char *msg, int len); |
46 | void netpoll_print_options(struct netpoll *np); | 64 | void netpoll_print_options(struct netpoll *np); |
47 | int netpoll_parse_options(struct netpoll *np, char *opt); | 65 | int netpoll_parse_options(struct netpoll *np, char *opt); |
@@ -50,7 +68,7 @@ int netpoll_setup(struct netpoll *np); | |||
50 | int netpoll_trap(void); | 68 | int netpoll_trap(void); |
51 | void netpoll_set_trap(int trap); | 69 | void netpoll_set_trap(int trap); |
52 | void __netpoll_cleanup(struct netpoll *np); | 70 | void __netpoll_cleanup(struct netpoll *np); |
53 | void __netpoll_free_rcu(struct netpoll *np); | 71 | void __netpoll_free_async(struct netpoll *np); |
54 | void netpoll_cleanup(struct netpoll *np); | 72 | void netpoll_cleanup(struct netpoll *np); |
55 | int __netpoll_rx(struct sk_buff *skb, struct netpoll_info *npinfo); | 73 | int __netpoll_rx(struct sk_buff *skb, struct netpoll_info *npinfo); |
56 | void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb, | 74 | void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb, |