christian pellegrin wrote: > I'm afraid that this patch isn't going to work: normally the mcp251x > is kept in sleep mode to reduce power consumption. In a comment to my > patch you said that mcp251x_do_set_bittiming is called only from > open_candev. This is important to make sure that mcp2515 is in setup
No, mcp251x_do_set_bittiming is called when you configure the device, actually before it's started when you call: "ip link set can0 type can bitrate 50000". open_candev(net) just checks it the bit-timing is defined and should be called first in the open function. See: http://lxr.linux.no/#linux+v2.6.31/drivers/net/can/dev.c#L467 > mode. For this reason mcp251x_setup is always called after > mcp251x_hw_reset and before mcp251x_set_normal_mode. The code is > mcp251x_do_set_bittiming can be made more context-free with the patch > I'm attaching that explicitly puts the mcp251x in configuration mode > for setting bit timings and then restores the old mode. If you don't want that, don't set the bit-timing callback and call the mcp251x's bit-timing function in mcp251x_setup. Wolfgang. _______________________________________________ Socketcan-core mailing list [email protected] https://lists.berlios.de/mailman/listinfo/socketcan-core
