RE: [PATCH] Enabling rcar_can changelink support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Marc,

> On 04/29/2017 09:48 PM, Bogdan Mirea wrote:
> > Added rcar_can_set_bittiming as can.do_set_bittiming callback that
> > will be called from can_changelink generic callback when link state
> > is 
> > changed.
> > 
> > This enables set bittiming support:
> >     ip link set can0 type can bitrate 500000 triple-sampling on
> 
> Why is this needed? rcar_can_set_bittiming() is called during
> rcar_can_open().

I know that rcar_can_set_bittiming() is called during rcar_can_open()
and setting bittiming works fine when setting can up with a command
like:
(1st approah)
    $ip link set can0 up type can bitrate 500000

But most of tutorials online[1] are presenting as a TODO the following
pair of commands:
(2nd approah)
    $ip link set can0 type can bitrate 500000
    $ip link set up can0

And in this 2nd approah, the first command will fail since it will call
can_changelink which on its turn will try calling .do_set_bittiming
callback and the former callback is not defined for rcar_can.

I don't say this is a must-have feature, since calling iproute2 with
"set bitrate" and "set can up"  as in 1st approach will work just fine,
will work just fine, but it is a nice to have feature for the second
approach of setting bitrate.
Also peak_usb pcan[2] uses this second approach (the changelink one) and
this patch updates rcar_can for it.

Best Regards,
Bogdan

[1] http://elinux.org/Bringing_CAN_interface_up
[2]
http://lxr.free-electrons.com/source/drivers/net/can/usb/peak_usb/pcan_usb.c#L900




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux