Hello Heinz,

On 15.11.2011 15:13, Heinz-Jürgen Oertel wrote:

> I tried
>  ip link set can0 type can bitrate 125000
> and I tried socketcanlib
> can_set_bitrate("can0", 125000);
> but everytime got the error 
> RTNETLINK answers: Operation not permitted.
> Reading the "PCAN driver for Linux - User Manual" v7.1
> I could not find instructions to set the bit rate for netdev.

>

> Who knows the best and/or correct way?


Me :-)

The netdev support inside the PEAK driver is a bit like an add-on to the
original character device driver.

Since PCAN Linux driver 6.0 you can compile the PEAK driver with netdev
support which means that for each detected CAN device an 'additional'
netdevice is being created.

Unfortunately these netdevices only support the sending and receiving of CAN
frames BUT no configuration of the CAN devices. This is still to be done via
the chardev inodes in /dev/pcanXX ..

See "PCAN driver for Linux - User Manual" v7.1, page 22

---

The 'ndev' column shows the network device assignment. For
assignment of bitrates to network devices you can either set the
desired bit rate as module load parameter or you can assign the bit
rate after loading the driver with a simple command line invocation
like:

    echo "i 0x4914 e" > /dev/pcan0

For this reason it is important to create the chardev-device-entries,
too. If your target does no create the device files automatically with
UDEV you have to run with the script

    ./pcan_make_devices 2

even if only the netdev driver is used.

---

Indeed i was already thinking about the integration of the netlink-based
configuration interface (of the mainline kernel) into the PCAN driver.

But finally this would be another add-on ... IMHO the better approach would be
to support the PEAK hardware in the form of mainline drivers, like we already
have for the PCAN PCI and PCAN ISA hardware. A future PCAN USB driver could be
created on the basis of the existing USB CAN adapter from ESD and EMS.

Best regards,
Oliver
_______________________________________________
Socketcan-users mailing list
Socketcan-users@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/socketcan-users

Reply via email to