All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Kurt Van Dijck <kurt.van.dijck@eia.be>
Cc: "linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: [RFC v4] CAN FD support
Date: Tue, 15 May 2012 22:33:06 +0200	[thread overview]
Message-ID: <4FB2BD82.2060105@hartkopp.net> (raw)
In-Reply-To: <20120515184832.GA414@vandijck-laurijssen.be>

On 15.05.2012 20:48, Kurt Van Dijck wrote:

> On Tue, May 15, 2012 at 05:51:20PM +0200, Oliver Hartkopp wrote:
>> On 15.05.2012 15:54, Kurt Van Dijck wrote:
>>
>>> [...]
>>>> @@ -119,6 +120,14 @@ static void raw_rcv(struct sk_buff *oskb, void *data)
>>>>  	if (!ro->recv_own_msgs && oskb->sk == sk)
>>>>  		return;
>>>>  
>>>> +	/* do not pass frames with DLC > 8 to a legacy socket */
>>>> +	if (!ro->fd_frames) {
>>>> +		struct canfd_frame *cfd = (struct canfd_frame *)oskb->data;
>>>> +
>>>> +		if (unlikely(cfd->len > CAN_MAX_DLEN))
>>> idea:
>>> 			cfd->len = CAN_MAX_LEN;
>>>
>>> but this modification must then be done _after_ the skb_clone below.
>>
>>
>> I dislike cutting payload data, because people would not be able to detect
>> that.
> Yep, that true as well.
> Better leave it the way it is now.
> 


Yep.

I pushed three commits to my can-utils git clone:

https://gitorious.org/linux-can/hartkopps-can-utils/commit/5d2964c5ffbf2a4a319893ac46f26276e4121c92/diffs/3698d3201c86d57eb6828fa3ed40db1d1d5fea51

If you look at the (not beautified) changes in cansend ... it looks like an
award-winning simple upgrade for CAN FD support, doesn't it?

:-)

So far i can send CAN FD frames after setting my device to CANFD_MTU:

# ifconfig vcan0 mtu 72
SIOCSIFMTU: Device or resource busy
# ifconfig vcan0 down
# ifconfig vcan0 mtu 72
# ifconfig vcan0 up  


# ip -statistics link show vcan0
4: vcan0: <NOARP,UP,LOWER_UP> mtu 72 qdisc noqueue state UNKNOWN mode DEFAULT 
    link/can 
    RX: bytes  packets  errors  dropped overrun mcast   
    46         8        0       0       0       0      
    TX: bytes  packets  errors  dropped carrier collsns 
    46         8        0       0       0       0      
# ./cansend vcan0 123#001122334455667788
# ip -statistics link show vcan0
4: vcan0: <NOARP,UP,LOWER_UP> mtu 72 qdisc noqueue state UNKNOWN mode DEFAULT 
    link/can 
    RX: bytes  packets  errors  dropped overrun mcast   
    55         9        0       0       0       0      
    TX: bytes  packets  errors  dropped carrier collsns 
    55         9        0       0       0       0 

length = 9 !!

Let's see how easy candump can be converted ... tomorrow.

Regards,
Oliver

  reply	other threads:[~2012-05-15 20:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-15 13:29 [RFC v4] CAN FD support Oliver Hartkopp
2012-05-15 13:54 ` Kurt Van Dijck
2012-05-15 15:51   ` Oliver Hartkopp
2012-05-15 18:48     ` Kurt Van Dijck
2012-05-15 20:33       ` Oliver Hartkopp [this message]
2012-05-15 21:16         ` vcan name Kurt Van Dijck
2012-05-16 12:38           ` Oliver Hartkopp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FB2BD82.2060105@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=kurt.van.dijck@eia.be \
    --cc=linux-can@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.