On 03/14/2011 11:42 AM, Jorge Fernandez Monteagudo wrote: > Hi, > > I'm trying to implement my can infrastructure with socketcan. I would like to > know where to find > information about the values from sja1000_priv struct, the can.clock.freq, > ocr and cdr.
Not sure what you are looking for. The meaning of theses values is described in the SJA1000 datasheet. > I'm following the plx_pci.c code but in my driver I setup these register in a > different way. > First, I set the CDR <- 0xC0, then I set the clock using the BTR0 and BTR1 > registers to set the 1Mbps > baudrate, BTR0 <- 0x01, BTR1 <- 0x10 and finally the OCR register is > initialized with OCR <- 0x1A. The input clock frequency, cdr and ocr must be defined by the SJA1000 driver, e.g.: http://lxr.linux.no/#linux+v2.6.37.3/drivers/net/can/sja1000/plx_pci.c#L526 Some drivers allow to set these values via module parameter. So, depending on the driver appropriate for your CAN hardware, you need to adjust them. The bit-timing have to be defined via netlink interface as described here: http://lxr.linux.no/#linux+v2.6.37.3/Documentation/networking/can.txt#L635 What CAN hardware are you using? Wolfgang. _______________________________________________ Socketcan-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/socketcan-users
