Wolfgang Grandegger wrote:
> Wolfram Sang wrote:
>>> This works as well:
>>>
>>>                     /*
>>>                      * The MSCAN on the MPC5200 does recover from bus-off
>>>                      * automatically. To avoid that we stop the chip.
>>>                      */
>>>   #if 0
>>>                     mscan_stop(dev);
>>>                     priv->can.state = CAN_STATE_BUS_OFF;
>>>   #else
>>>                     /* Light way stop */
>>>                     out_8(&regs->cantier, 0);
>>>                     out_8(&regs->canrier, 0);
>>>                     out_8(&regs->canctl0, in_8(&regs->canctl0) |
>> Don't we need CAN_STATE_BUS_OFF here, too?
> 
> No, it's just needed after mscan_stop() as that call sets the state to
> "STOPPED". We may call "mscan_stop()", though, when the device is
> restarted to avoid starting the device when it's not yet completely
> stopped. But that's a minor issue.

That's already the case (check mscan_do_set_mode). Sorry for the noise.

Wolfgang.
_______________________________________________
Socketcan-core mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-core

Reply via email to