Subject: [PATCH 3/3] can: switch carrier on if device was stopped while in bus-off state

From: Wolfgang Grandegger <[email-masked]>
Date: Mon, 20 Jul 2009 16:06:41 +0200

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 <[email-masked]>
Signed-off-by: Wolfgang Grandegger <[email-masked]>
---
 drivers/net/can/dev.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: net-next-2.6/drivers/net/can/dev.c
===================================================================
--- net-next-2.6.orig/drivers/net/can/dev.c	2009-07-20 16:03:35.083997416 +0200
+++ net-next-2.6/drivers/net/can/dev.c	2009-07-20 16:03:35.100998431 +0200
@@ -473,6 +473,10 @@
 		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);
 
 	return 0;