OSDN Git Service

can: c_can: C_CAN: add bus recovery events
authorJeroen Hofstee <jhofstee@victronenergy.com>
Tue, 1 Oct 2019 21:01:24 +0000 (21:01 +0000)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 4 Nov 2019 20:47:21 +0000 (21:47 +0100)
commit6f12001ad5e79d0a0b08c599731d45c34cafd376
tree7c523a66dec1d3e0fa3ae7e1fd8e202c745c4c63
parent23c5a9488f076bab336177cd1d1a366bd8ddf087
can: c_can: C_CAN: add bus recovery events

While the state is updated when the error counters increase and
decrease, there is no event when the bus recovers and the error counters
decrease again. So add that event as well.

Change the state going downward to be ERROR_PASSIVE -> ERROR_WARNING ->
ERROR_ACTIVE instead of directly to ERROR_ACTIVE again.

Signed-off-by: Jeroen Hofstee <jhofstee@victronenergy.com>
Acked-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Tested-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/c_can/c_can.c