diff options
author | stephen hemminger <shemminger@vyatta.com> | 2010-05-10 05:31:08 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-16 02:10:01 -0400 |
commit | cfb478da70f2213520866c84cb0aea0d7c0e1148 (patch) | |
tree | bc1a1ea16bbb2be0481d3231a2fbe5611437da55 /net/bridge/br_device.c | |
parent | c17b274dc2aa538b68c1f02b01a3c4e124b435ba (diff) |
bridge: netpoll cleanup
Move code around so that the ifdef for NETPOLL_CONTROLLER don't have to
show up in main code path. The control functions should be in helpers
that are only compiled if needed.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_device.c')
-rw-r--r-- | net/bridge/br_device.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c index f15f9c4a0dd2..22b97ba7dc52 100644 --- a/net/bridge/br_device.c +++ b/net/bridge/br_device.c | |||
@@ -199,7 +199,7 @@ static int br_set_tx_csum(struct net_device *dev, u32 data) | |||
199 | } | 199 | } |
200 | 200 | ||
201 | #ifdef CONFIG_NET_POLL_CONTROLLER | 201 | #ifdef CONFIG_NET_POLL_CONTROLLER |
202 | bool br_devices_support_netpoll(struct net_bridge *br) | 202 | static bool br_devices_support_netpoll(struct net_bridge *br) |
203 | { | 203 | { |
204 | struct net_bridge_port *p; | 204 | struct net_bridge_port *p; |
205 | bool ret = true; | 205 | bool ret = true; |
@@ -225,9 +225,9 @@ static void br_poll_controller(struct net_device *br_dev) | |||
225 | netpoll_poll_dev(np->real_dev); | 225 | netpoll_poll_dev(np->real_dev); |
226 | } | 226 | } |
227 | 227 | ||
228 | void br_netpoll_cleanup(struct net_device *br_dev) | 228 | void br_netpoll_cleanup(struct net_device *dev) |
229 | { | 229 | { |
230 | struct net_bridge *br = netdev_priv(br_dev); | 230 | struct net_bridge *br = netdev_priv(dev); |
231 | struct net_bridge_port *p, *n; | 231 | struct net_bridge_port *p, *n; |
232 | const struct net_device_ops *ops; | 232 | const struct net_device_ops *ops; |
233 | 233 | ||
@@ -243,10 +243,30 @@ void br_netpoll_cleanup(struct net_device *br_dev) | |||
243 | } | 243 | } |
244 | } | 244 | } |
245 | 245 | ||
246 | #else | 246 | void br_netpoll_disable(struct net_bridge *br, |
247 | struct net_device *dev) | ||
248 | { | ||
249 | if (br_devices_support_netpoll(br)) | ||
250 | br->dev->priv_flags &= ~IFF_DISABLE_NETPOLL; | ||
251 | if (dev->netdev_ops->ndo_netpoll_cleanup) | ||
252 | dev->netdev_ops->ndo_netpoll_cleanup(dev); | ||
253 | else | ||
254 | dev->npinfo = NULL; | ||
255 | } | ||
247 | 256 | ||
248 | void br_netpoll_cleanup(struct net_device *br_dev) | 257 | void br_netpoll_enable(struct net_bridge *br, |
258 | struct net_device *dev) | ||
249 | { | 259 | { |
260 | if (br_devices_support_netpoll(br)) { | ||
261 | br->dev->priv_flags &= ~IFF_DISABLE_NETPOLL; | ||
262 | if (br->dev->npinfo) | ||
263 | dev->npinfo = br->dev->npinfo; | ||
264 | } else if (!(br->dev->priv_flags & IFF_DISABLE_NETPOLL)) { | ||
265 | br->dev->priv_flags |= IFF_DISABLE_NETPOLL; | ||
266 | printk(KERN_INFO "%s:new device %s" | ||
267 | " does not support netpoll (disabling)", | ||
268 | br->dev->name, dev->name); | ||
269 | } | ||
250 | } | 270 | } |
251 | 271 | ||
252 | #endif | 272 | #endif |