All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: RFC can-j1939
@ 2016-02-22 21:36 R U Local
  2016-02-23 10:06 ` Kurt Van Dijck
  0 siblings, 1 reply; 5+ messages in thread
From: R U Local @ 2016-02-22 21:36 UTC (permalink / raw)
  To: 'linux-can'

Dear Kurt,
Thanks for your great work.
I'm just bringing up the J1939 stack on a TI OMAP4 based system.
I'm locked to a custom kernel 3.19 due to media drivers and codecs.
I followed your guide and pulled code from 4.1 and 3.15 branches.
I also patched and built can-utils and iproute2.
I can't get the Transport Protocol to work send only sends the first packet and receive hangs on reception of the first packet.

It may be that mixing iproute2 and mixing branches has broken the TP.
Which branch should I use as a reference? I'll re-patch and re-test with unpatched iproute2.

As far as your RFC your implementation looks to be ideal for our applications.
For user space applications where should the headers (<linux/can/can.h> & <linux/can/j1939/j1939.h>) be taken from or provided by?

Cheers Mike.

-----Original Message-----
From: linux-can-owner@vger.kernel.org [mailto:linux-can-owner@vger.kernel.org] On Behalf Of Kurt Van Dijck
Sent: Monday, 22 February 2016 18:23
To: Yang Wang <wang701@purdue.edu>; Alex Layton <alex@layton.in>; David Jander <david@protonic.nl>; laurent vaudoit <laurent.vaudoit@gmail.com>; Oliver Hartkopp <socketcan@hartkopp.net>
Cc: linux-can <linux-can@vger.kernel.org>
Subject: RFC: can-j1939

Hey,

Last November, we had some discussion on how to improve the can-j1939 API in order to suit more users.
I had some delays for finding stupid bugs (@Laurent, I backporte to an iMX6 with v3.10 kernel with can-j1939 for finding some of them), now it's ready to share.

I had assembled a quick starter guide long time ago already in markdown.
I didn't feel like translating it to elinux.org's mediawiki, so I put it https://github.com/kurt-vd/test-can-j1939/blob/master/can-j1939-kickstart.md

During my development, I tested can-j1939 on 3 linux kernel versions:
v3.10, v3.15 and v4.3. I later found that the small changes for v4.3 actually were introduced in v4.1, so I backported j1939d-v4.3 to j1939d-v4.1.

On https://github.com/kurt-vd/linux, you will find 4 additional
branches: j1939d-v3.10, j1939d-v3.15, ...
The 'd' suffix as distinction, means 'direct', however that is less important.

I will in short highlight some aspects of the new stack, most of which were raised in past discussions on this list:

* it is stable, works with the latest kernels.
* does not need or use netlink. You don't need a modified iproute2 anymore
* when a can-j1939 socket binds to an interface, can-j1939 starts
  processing on this interface: address claim tracking + transport
  protocol assembly.
  when the last such socket closes, can-j1939 stops for that interface.
  This also means that a transport protocol session that _started_ before
  the first socket opens will not be seen by can-j1939. This conforms to
  datagram communication.
* when a socket binds to an address or name, the kernel starts treating
  that address/name as a local one.
* The new stack takes less measures to detect address collisions
  for static addresses, and keeps more responsibility to the user.
* non-root users can start can-j1939 on an interface, add addresses, ...
* a list of current local addresses is available in /proc
* add transport protocol parameter, to control outgoing inter-packet delays.
* add parameter to pad all packets to 8 bytes.

I hope you will find time to take a look at it.
We could possibly agree on the API?

Kind regards,
Kurt
--
To unsubscribe from this list: send the line "unsubscribe linux-can" in the body of a message to majordomo@vger.kernel.org More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 5+ messages in thread
* RFC: can-j1939
@ 2016-02-22  5:22 Kurt Van Dijck
  2016-02-22 18:24 ` Yang Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Kurt Van Dijck @ 2016-02-22  5:22 UTC (permalink / raw)
  To: Yang Wang, Alex Layton, David Jander, laurent vaudoit,
	Oliver Hartkopp
  Cc: linux-can

Hey,

Last November, we had some discussion on how to improve the can-j1939
API in order to suit more users.
I had some delays for finding stupid bugs (@Laurent, I backporte to an iMX6
with v3.10 kernel with can-j1939 for finding some of them), now it's
ready to share.

I had assembled a quick starter guide long time ago already in markdown.
I didn't feel like translating it to elinux.org's mediawiki, so I put it
https://github.com/kurt-vd/test-can-j1939/blob/master/can-j1939-kickstart.md

During my development, I tested can-j1939 on 3 linux kernel versions:
v3.10, v3.15 and v4.3. I later found that the small changes for v4.3
actually were introduced in v4.1, so I backported j1939d-v4.3 to
j1939d-v4.1.

On https://github.com/kurt-vd/linux, you will find 4 additional
branches: j1939d-v3.10, j1939d-v3.15, ...
The 'd' suffix as distinction, means 'direct', however that is less important.

I will in short highlight some aspects of the new stack, most of which
were raised in past discussions on this list:

* it is stable, works with the latest kernels.
* does not need or use netlink. You don't need a modified iproute2 anymore
* when a can-j1939 socket binds to an interface, can-j1939 starts
  processing on this interface: address claim tracking + transport
  protocol assembly.
  when the last such socket closes, can-j1939 stops for that interface.
  This also means that a transport protocol session that _started_ before
  the first socket opens will not be seen by can-j1939. This conforms to
  datagram communication.
* when a socket binds to an address or name, the kernel starts treating
  that address/name as a local one.
* The new stack takes less measures to detect address collisions
  for static addresses, and keeps more responsibility to the user.
* non-root users can start can-j1939 on an interface, add addresses, ...
* a list of current local addresses is available in /proc
* add transport protocol parameter, to control outgoing inter-packet delays.
* add parameter to pad all packets to 8 bytes.

I hope you will find time to take a look at it.
We could possibly agree on the API?

Kind regards,
Kurt

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-02-24  3:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-22 21:36 RFC can-j1939 R U Local
2016-02-23 10:06 ` Kurt Van Dijck
2016-02-24  3:05   ` R U Local
  -- strict thread matches above, loose matches on Subject: below --
2016-02-22  5:22 RFC: can-j1939 Kurt Van Dijck
2016-02-22 18:24 ` Yang Wang

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.