aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfgang Grandegger <wg@grandegger.com>2009-07-20 00:06:41 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-20 15:28:30 -0400
commit1b0d92244ff2434a98272f6d2525da32fc230f19 (patch)
tree71ab998e48c94b1d67729da22051b8e24cc59258
parentb3d0df7ca35018ebbc24fd102ed7021cf593ba74 (diff)
can: switch carrier on if device was stopped while in bus-off state
This patch fixes a problem when a device is stopped while in the bus-off state. Then the carrier remains off forever. Signed-off-by: Kurt Van Dijck <kurt.van.dijck@skynet.be> Signed-off-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/can/dev.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index 06083c32869a..9e4283aff828 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -473,6 +473,10 @@ int open_candev(struct net_device *dev)
473 return -EINVAL; 473 return -EINVAL;
474 } 474 }
475 475
476 /* Switch carrier on if device was stopped while in bus-off state */
477 if (!netif_carrier_ok(dev))
478 netif_carrier_on(dev);
479
476 setup_timer(&priv->restart_timer, can_restart, (unsigned long)dev); 480 setup_timer(&priv->restart_timer, can_restart, (unsigned long)dev);
477 481
478 return 0; 482 return 0;