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. > My driver is setup exactly the same as the SJA1000 driver. The > bittiming_const and do_set_bittiming() functions are copied almost > exactly from the sja1000.c driver. > > Does anyone have any insight to offer about what I did wrong? See above. The clock setting is in the SJA1000 card/board drivers, e.g. ems_pci.c. > For completeness, my janz-ican3 driver is included below, just in case > anyone needs to look at the code. It has changed slightly, as I am > incorporating comments from the last RFCv2 posting. > > Also, is there some way to set the default bitrate of a device, so a > user doesn't have to specify the bitrate to bring the device up? This > card comes out of reset with a bitrate of 1000000, and is ready to run. No, that's by purpose. A default bitrate is error-prune. Wolfgang. _______________________________________________ Socketcan-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/socketcan-users
