Oliver Hartkopp | 28 May 2012 22:02
Favicon

[RFC v5] CAN FD support

Hi all,

since RFC v4 - see http://marc.info/?l=linux-can&m=133708871921901&w=2 from
2012-05-15 - i cleaned up some details and added the support of simultaneous
CAN and CANFD frame handling inside the networking code after some discussion
with Kurt. Sometimes code needs to be implemented to see that there is a more
elegant solution out there when removing that code again ;-)

If you also feel fine with this patch i would finally create a patchset of
four patches, like 

- adding new structures and constants
- adding CAN FD support in af_can.c
- adding CAN FD support in raw.c
- adding CAN FD support in vcan.c

for the upcoming net-next bound for Linux 3.6 .

Some words about the basic concepts of this CAN FD support for Linux CAN
networking. In general the new CAN FD controllers support two different
bitrates for the arbitration phase and the payload phase of the CAN FD frame
and up to 64 bytes of payload. This extended payload length breaks all the
kernel interfaces (ABI) which heavily rely on the CAN frame with fixed eight
bytes of payload (struct can_frame) like the CAN_RAW socket.

This patch enables the CAN network layer to handle CAN FD frames and 'legacy'
CAN frames following ISO 11898-1 and updates the virtual CAN driver (vcan) to
be able to develop and test userspace applications and CAN network drivers.

Main concepts:
(Continue reading)

Wolfgang Grandegger | 11 Jun 2012 16:26

Re: [RFC v5] CAN FD support

On 05/28/2012 10:02 PM, Oliver Hartkopp wrote:
> Hi all,
> 
> since RFC v4 - see http://marc.info/?l=linux-can&m=133708871921901&w=2 from
> 2012-05-15 - i cleaned up some details and added the support of simultaneous
> CAN and CANFD frame handling inside the networking code after some discussion
> with Kurt. Sometimes code needs to be implemented to see that there is a more
> elegant solution out there when removing that code again ;-)
> 
> If you also feel fine with this patch i would finally create a patchset of
> four patches, like 
> 
> - adding new structures and constants
> - adding CAN FD support in af_can.c
> - adding CAN FD support in raw.c
> - adding CAN FD support in vcan.c
> 
> for the upcoming net-next bound for Linux 3.6 .

Do you have already CAN FD hardware for testing? If not, do we really
want to have this patchset mainline.

More later...

Wolfgang.
--
To unsubscribe from this list: send the line "unsubscribe linux-can" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

(Continue reading)

Oliver Hartkopp | 11 Jun 2012 19:36
Favicon

Re: [RFC v5] CAN FD support

On 11.06.2012 16:26, Wolfgang Grandegger wrote:

> On 05/28/2012 10:02 PM, Oliver Hartkopp wrote:
>> Hi all,
>>
>> since RFC v4 - see http://marc.info/?l=linux-can&m=133708871921901&w=2 from
>> 2012-05-15 - i cleaned up some details and added the support of simultaneous
>> CAN and CANFD frame handling inside the networking code after some discussion
>> with Kurt. Sometimes code needs to be implemented to see that there is a more
>> elegant solution out there when removing that code again ;-)
>>
>> If you also feel fine with this patch i would finally create a patchset of
>> four patches, like 
>>
>> - adding new structures and constants
>> - adding CAN FD support in af_can.c
>> - adding CAN FD support in raw.c
>> - adding CAN FD support in vcan.c
>>
>> for the upcoming net-next bound for Linux 3.6 .
> 
> Do you have already CAN FD hardware for testing? If not, do we really
> want to have this patchset mainline.

Yes. There's a good reason for this patchset.

As you might remember from the old days ...

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=history;f=drivers/net/can/Kconfig

(Continue reading)

Wolfgang Grandegger | 11 Jun 2012 20:03

Re: [RFC v5] CAN FD support

On 06/11/2012 07:36 PM, Oliver Hartkopp wrote:
> On 11.06.2012 16:26, Wolfgang Grandegger wrote:
> 
>> On 05/28/2012 10:02 PM, Oliver Hartkopp wrote:
>>> Hi all,
>>>
>>> since RFC v4 - see http://marc.info/?l=linux-can&m=133708871921901&w=2 from
>>> 2012-05-15 - i cleaned up some details and added the support of simultaneous
>>> CAN and CANFD frame handling inside the networking code after some discussion
>>> with Kurt. Sometimes code needs to be implemented to see that there is a more
>>> elegant solution out there when removing that code again ;-)
>>>
>>> If you also feel fine with this patch i would finally create a patchset of
>>> four patches, like 
>>>
>>> - adding new structures and constants
>>> - adding CAN FD support in af_can.c
>>> - adding CAN FD support in raw.c
>>> - adding CAN FD support in vcan.c
>>>
>>> for the upcoming net-next bound for Linux 3.6 .
>>
>> Do you have already CAN FD hardware for testing? If not, do we really
>> want to have this patchset mainline.
> 
> 
> Yes. There's a good reason for this patchset.
> 
> As you might remember from the old days ...
> 
(Continue reading)

Oliver Hartkopp | 11 Jun 2012 20:15
Favicon

Re: [RFC v5] CAN FD support

On 11.06.2012 20:03, Wolfgang Grandegger wrote:

> On 06/11/2012 07:36 PM, Oliver Hartkopp wrote:

>> it was nearly 16 month the PF_CAN infrastructure was part of the mainline
>> kernel until the first 'real' CAN drivers have been added to the tree.
>> Meanwhile the driver development inside and outside the tree had a stable
>> environment for APIs and testing.
> 
> Ah, I forgot, the vcan driver allows to test the CAN FD interface as
> well, basically ==> the code is tested to some extend which calms me
> down ;).

Yes. After some development and also removal of new ugly code it looks pretty
simple and clear now. And it was also easy to test (using new applications
with the older kernel too).

Especially it allowed some simplifications in the kernel code and the adaption
of userspace applications was amazingly simple. See my commits in
hartkopps-can-utils ...

>>
>>> More later...
>>
>>
>> Reviews are welcome.
>> Please check the different postings and discussions up to v5 before.
> 
> Well, I'm just back from holiday...

(Continue reading)


Gmane