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>
This commit is contained in:
Wolfgang Grandegger 2009-07-20 04:06:41 +00:00 committed by David S. Miller
parent b3d0df7ca3
commit 1b0d92244f

View File

@ -473,6 +473,10 @@ int open_candev(struct net_device *dev)
return -EINVAL; return -EINVAL;
} }
/* Switch carrier on if device was stopped while in bus-off state */
if (!netif_carrier_ok(dev))
netif_carrier_on(dev);
setup_timer(&priv->restart_timer, can_restart, (unsigned long)dev); setup_timer(&priv->restart_timer, can_restart, (unsigned long)dev);
return 0; return 0;