Ira W. Snyder wrote: > On Thu, Feb 18, 2010 at 10:19:22PM +0100, Wolfgang Grandegger wrote: >> Ira W. Snyder wrote: >>> Hello all, >>> >>> I'm working on a driver for the Janz ICAN3 module. Now that I'm getting >>> good review feedback, I've found some errors in the driver. One of them >>> was that I was missing candev_open() and candev_close() in the netdevice >>> open() and close() routines. >> Ah, missed that. >> >>> So I added them, but I cannot bring up the the CAN devices anymore. I >>> get this message in the kernel log: >>> >>> janz-ican3 janz-ican3.0: bit-timing not yet defined >>> >>> Great, so I need to set the bit timing. Let's try that: >> Yes. >> >>> $ ip link set can0 up type can bitrate 1000000 >>> RTNETLINK answers: Numerical argument out of domain >>> >>> That doesn't work either! What, why? The kernel logs show: >>> janz-ican3 janz-ican3.0: bitrate error 100.0% too high >> Like a problem with your clock setting: >> >> priv->can.clock.freq = 8000000; /* if your osclillator clock is 16MHz */ >> >> Maybe this line is even mising. >> > > Yep, that was it. With this line added, everything works great. > > Perhaps adding a check to the can_calc_bittiming() function, right next > to the check for priv->bittiming_const would be helpful for other driver > authors. One of the following would have let me solve the problem, > rather than relying on the mailing list: > > BUG_ON(priv->clock.freq == 0); > WARN_ON(priv->clock.freq == 0);
Yes, you are not the first one who stumbled over this problem. Wolfgang. _______________________________________________ Socketcan-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/socketcan-users
