diff options
Diffstat (limited to 'include/linux/netpoll.h')
-rw-r--r-- | include/linux/netpoll.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index a765ea898549..e9e231215865 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | struct netpoll { | 15 | struct netpoll { |
16 | struct net_device *dev; | 16 | struct net_device *dev; |
17 | struct net_device *real_dev; | ||
17 | char dev_name[IFNAMSIZ]; | 18 | char dev_name[IFNAMSIZ]; |
18 | const char *name; | 19 | const char *name; |
19 | void (*rx_hook)(struct netpoll *, int, char *, int); | 20 | void (*rx_hook)(struct netpoll *, int, char *, int); |
@@ -36,8 +37,11 @@ struct netpoll_info { | |||
36 | struct sk_buff_head txq; | 37 | struct sk_buff_head txq; |
37 | 38 | ||
38 | struct delayed_work tx_work; | 39 | struct delayed_work tx_work; |
40 | |||
41 | struct netpoll *netpoll; | ||
39 | }; | 42 | }; |
40 | 43 | ||
44 | void netpoll_poll_dev(struct net_device *dev); | ||
41 | void netpoll_poll(struct netpoll *np); | 45 | void netpoll_poll(struct netpoll *np); |
42 | void netpoll_send_udp(struct netpoll *np, const char *msg, int len); | 46 | void netpoll_send_udp(struct netpoll *np, const char *msg, int len); |
43 | void netpoll_print_options(struct netpoll *np); | 47 | void netpoll_print_options(struct netpoll *np); |
@@ -47,22 +51,23 @@ int netpoll_trap(void); | |||
47 | void netpoll_set_trap(int trap); | 51 | void netpoll_set_trap(int trap); |
48 | void netpoll_cleanup(struct netpoll *np); | 52 | void netpoll_cleanup(struct netpoll *np); |
49 | int __netpoll_rx(struct sk_buff *skb); | 53 | int __netpoll_rx(struct sk_buff *skb); |
54 | void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb); | ||
50 | 55 | ||
51 | 56 | ||
52 | #ifdef CONFIG_NETPOLL | 57 | #ifdef CONFIG_NETPOLL |
53 | static inline int netpoll_rx(struct sk_buff *skb) | 58 | static inline bool netpoll_rx(struct sk_buff *skb) |
54 | { | 59 | { |
55 | struct netpoll_info *npinfo = skb->dev->npinfo; | 60 | struct netpoll_info *npinfo = skb->dev->npinfo; |
56 | unsigned long flags; | 61 | unsigned long flags; |
57 | int ret = 0; | 62 | bool ret = false; |
58 | 63 | ||
59 | if (!npinfo || (list_empty(&npinfo->rx_np) && !npinfo->rx_flags)) | 64 | if (!npinfo || (list_empty(&npinfo->rx_np) && !npinfo->rx_flags)) |
60 | return 0; | 65 | return false; |
61 | 66 | ||
62 | spin_lock_irqsave(&npinfo->rx_lock, flags); | 67 | spin_lock_irqsave(&npinfo->rx_lock, flags); |
63 | /* check rx_flags again with the lock held */ | 68 | /* check rx_flags again with the lock held */ |
64 | if (npinfo->rx_flags && __netpoll_rx(skb)) | 69 | if (npinfo->rx_flags && __netpoll_rx(skb)) |
65 | ret = 1; | 70 | ret = true; |
66 | spin_unlock_irqrestore(&npinfo->rx_lock, flags); | 71 | spin_unlock_irqrestore(&npinfo->rx_lock, flags); |
67 | 72 | ||
68 | return ret; | 73 | return ret; |