From: Patrick Menschel <menschel.p@posteo.de>
To: linux-can <linux-can@vger.kernel.org>
Subject: Re: can-j1939 API
Date: Fri, 16 Oct 2015 21:36:52 +0200 [thread overview]
Message-ID: <562151D4.3060902@posteo.de> (raw)
In-Reply-To: <CAFUozzFQTOASSR94vKQnMGajUSvHGgL7BMuJSvuXKd3=n6aiog@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 4153 bytes --]
Hi,
1. concerning J1939, I think it would be best to implement it is a
"view" on can0 without changing can0 itself.
As it's already been mentioned, j1939 may share the physical layer with
other protocols, i.e. CanOpen on diesel powered railway equipment or
proprietary protocols of some OEMs for construction machinery.
If there is tester or application equipment installed, CCP is usually
also present.
2. concerning address claiming and address collision handling via the
NAME property, I think it should be handled in user space, not within
the module as you may have multiple source addresses on the same device.
For example Engine ECU SA 0x00 and Emission Controller SA 0x3D usually
are one and the same physical device.
Regards,
Patrick
Am 16.10.2015 um 00:04 schrieb Alex Layton:
> On Tue, Sep 29, 2015 at 3:49 PM, Kurt Van Dijck
> <dev.kurt@vandijck-laurijssen.be> wrote:
>> I would like to challenge other j1939 (not necessarily socketcan+can-j1939)
>> users to share their opinions.
>
> Hello, I am the author of https://github.com/ISOBlue/isoblue-software,
> finally getting around to participating in this list.
>
>>>> If you look at http://elinux.org/J1939
>>
>>>> $ modprobe can-j1939
>>
>> This is a systemwide action, as opposed to
>>
>>>> $ ip link set can0 j1939 on
>>
>> which is an interface-wide action.
>>
>> Due to the nature of CAN, the kernel should not/cannot decide if CAN
>> traffic is J1939 or not.
>> Unlike other CAN protocols (RAW, BCM, ISOTP), J1939 allocates the whole
>> CAN id range for its use, and using CAN ids incompatible with j1939
>> is regarded illegal.
>>
>> So this must become a switch.
>
> I disagree with this, like Austin Schuh did. In my experience there is
> almost always other non-J1939 CAN traffic present and it must be
> possible to use both. The module should just ignore any CAN that does
> not look right to it, and there needs to still be a way to get at the
> other CAN on the bus through a CAN_RAW socket or something.
>
>>>> and if you think about this kind of assignment, it should be implemented
>>>> inside the j1939 stuff and not in af_can.c. The can-gw routing netlink
>>
>> j1939 touches af_can because address configuration via netlink is
>> absent in af_can. j1939 adds (with seperate patches) the ability to add
>> addressess for CAN sockets, but only for those CAN protocols that
>> support it.
>> I see no decent way to bypass af_can, except for creating af_j1939.
>
> Sorry if this is a stupid question, but what is the point of adding
> addresses to a CAN interface with ip? Doesn't the code creating the
> socket set what its address and/or NAME is? My implementation does not
> modify af_can, though it is admittedly much more simplistic than
> Kurt's.
>
>>>> I remember our discussion about the address claiming but I wonder if we
>>>> really follow the requirement to only put functionality into the kernel
>>>> that really has to be implemented there.
>>
>> The kernel tracks and validates J1939 traffic. Any userspace application
>> can track, but none can validate & reject without duplicating effort.
>
> I too think at least part of the address handling needs to be in the
> kernel module.
>
>>>> Did you take a look at https://github.com/ISOBlue/isoblue-software -
>>>> which is far simpler - whether it can fulfill the basic functionalities
>>>> (segmentation, etc.) to enable j1939 for Linux?
>>
>> I took a quick look. It appears that they only put the address claiming
>> in the kernel. I understand that this is exactly your concern in my
>> implementation :-).
>
> Yes, my implementation does address claiming in the module. From what
> I understand, mine does even more of the process than Kurt's does (my
> module actually sends the address claim messages). However, my module
> does not deal with NAMEs, only the addresses.
>
>
> Alex
> --
> 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
>
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 3709 bytes --]
next prev parent reply other threads:[~2015-10-16 19:36 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <linux-can/can-utils/pull/7@github.com>
2015-09-28 6:53 ` [can-utils] J1939 v6 (#7) Marc Kleine-Budde
2015-09-29 12:15 ` Kurt Van Dijck
2015-09-30 15:26 ` Aaron Clarke
2015-09-30 23:38 ` Kurt Van Dijck
[not found] ` <linux-can/can-utils/pull/7/c144149208@github.com>
2015-09-29 18:46 ` Marc Kleine-Budde
2015-09-29 19:49 ` can-j1939 API Kurt Van Dijck
2015-09-29 20:10 ` Austin Schuh
2015-10-15 22:04 ` Alex Layton
2015-10-16 19:36 ` Patrick Menschel [this message]
2015-10-18 2:42 ` Kurt Van Dijck
2015-10-19 3:41 ` Patrick Menschel
2015-10-19 6:07 ` Oliver Hartkopp
2015-10-19 9:52 ` Kurt Van Dijck
2015-10-19 16:53 ` Alex Layton
2015-10-19 20:57 ` Kurt Van Dijck
2015-10-19 21:31 ` Kurt Van Dijck
2015-10-22 16:39 ` Alex Layton
2015-10-18 2:32 ` Kurt Van Dijck
2015-10-19 16:53 ` Alex Layton
2015-10-19 20:44 ` Kurt Van Dijck
2015-10-22 16:39 ` Alex Layton
2015-10-23 11:14 ` Kurt Van Dijck
2015-10-29 19:33 ` Oliver Hartkopp
2015-10-29 23:38 ` Kurt Van Dijck
2015-11-02 12:14 ` Oliver Hartkopp
2015-11-02 12:29 ` Kurt Van Dijck
2015-11-02 13:18 ` Oliver Hartkopp
2015-11-11 19:48 ` Kurt Van Dijck
2015-11-10 21:58 ` Yang
2015-11-11 18:49 ` Kurt Van Dijck
2015-11-17 6:01 ` Yang Wang
2015-11-17 8:43 ` Kurt Van Dijck
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=562151D4.3060902@posteo.de \
--to=menschel.p@posteo.de \
--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.