diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2010-06-10 12:12:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-15 13:58:40 -0400 |
commit | c18370f5b2949d9cca519355f33690b75e1e7c8b (patch) | |
tree | 8e3a2e741bacf9121d2f2b4351d3e8efb640c818 /include/linux/netpoll.h | |
parent | 8fdd95ec162a8fbac7f41d6f54f90402fe3e8cb1 (diff) |
netpoll: Add netpoll_tx_running
This patch adds the helper netpoll_tx_running for use within
ndo_start_xmit. It returns non-zero if ndo_start_xmit is being
invoked by netpoll, and zero otherwise.
This is currently implemented by simply looking at the hardirq
count. This is because for all non-netpoll uses of ndo_start_xmit,
IRQs must be enabled while netpoll always disables IRQs before
calling ndo_start_xmit.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netpoll.h')
-rw-r--r-- | include/linux/netpoll.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index f3ad74af7e1f..4c77fe78ceff 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
@@ -116,6 +116,11 @@ static inline void netpoll_poll_unlock(void *have) | |||
116 | } | 116 | } |
117 | } | 117 | } |
118 | 118 | ||
119 | static inline int netpoll_tx_running(struct net_device *dev) | ||
120 | { | ||
121 | return irqs_disabled(); | ||
122 | } | ||
123 | |||
119 | #else | 124 | #else |
120 | static inline int netpoll_rx(struct sk_buff *skb) | 125 | static inline int netpoll_rx(struct sk_buff *skb) |
121 | { | 126 | { |
@@ -139,6 +144,10 @@ static inline void netpoll_poll_unlock(void *have) | |||
139 | static inline void netpoll_netdev_init(struct net_device *dev) | 144 | static inline void netpoll_netdev_init(struct net_device *dev) |
140 | { | 145 | { |
141 | } | 146 | } |
147 | static inline int netpoll_tx_running(struct net_device *dev) | ||
148 | { | ||
149 | return 0; | ||
150 | } | ||
142 | #endif | 151 | #endif |
143 | 152 | ||
144 | #endif | 153 | #endif |