All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
To: "Rémy DZIEMIASZKO" <remy.dziemiaszko@smile.fr>
Cc: Oleksij Rempel <o.rempel@pengutronix.de>, linux-can@vger.kernel.org
Subject: Re: How to statically set J1939 addresses and names
Date: Fri, 11 Jun 2021 08:57:08 +0200	[thread overview]
Message-ID: <20210611065708.GA2028@x1.vandijck-laurijssen.be> (raw)
In-Reply-To: <20210611041232.6avft7jhzsqcuuwc@pengutronix.de>

On Fri, 11 Jun 2021 06:12:32 +0200, Oleksij Rempel wrote:
> Hi Rémy,
> 
> On Tue, Jun 08, 2021 at 05:27:45PM +0200, Rémy DZIEMIASZKO wrote:
> > Hello,
> > 
> > I need that my applications do not care about J1939 node addresses but
> > directly bind / connect to socket based on node name only and the
> > kernel takes care of the conversion to addresses.
> > 
> > I know this is possible if addresses are dynamically assigned through
> > the Address Claiming protocol that is implemented in the kernel. The
> > kernel keeps track of its own address and name as well as the
> > addresses and names of other ECUs on the network and convert name to
> > adresse when requested by the applications.
> > 
> > But I don't want to use the Address Claiming protocol. I want to
> > statically set all addresses and names.

It is supported to not use Address Claiming.

> > 
> > Is there a way to assign J1939 addresses and names to a CAN interface
> > without using the J1939 address claim protocol?
> 
> Current version do not have this functionality.

If you bind() your socket with only sockaddr_can.j1939.sa set to your
SA, and sockaddr_can.j1939.name to 0, makes your socket use your SA as
static address.

> 
> > I found in old j1939 kernel documentation something like
> > ip addr add dev canX j1939 0xXX
> > ip addr add dev canX j1939 name 0xXX
> > See https://www.spinics.net/lists/netdev/msg162350.html
> > 
> > But in the latest j1939 kernel documentation I do not find any
> > reference to these commands.
> 
> Yes, it was pre mainline version. For mainlining we reduced UAPI to the
> minimum to simplify reviewing, mainlining and testing process.
> 

The strict addressing was rejected because it felt much heavier than
what most CAN users were used to. Moving to the current ad-hoc
implementation allowed to drop quite some kernel code too.

> IF you need this option, you are welcome to send patches :)
> Or you can contact us or other company to implement it.
> 
> Regards,
> Oleksij
> -- 
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  reply	other threads:[~2021-06-11  6:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08 15:27 How to statically set J1939 addresses and names Rémy DZIEMIASZKO
2021-06-11  4:12 ` Oleksij Rempel
2021-06-11  6:57   ` Kurt Van Dijck [this message]
2021-06-12 10:02     ` Patrick Menschel
2021-06-14  8:32     ` Rémy DZIEMIASZKO
2021-06-14  9:10       ` 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=20210611065708.GA2028@x1.vandijck-laurijssen.be \
    --to=dev.kurt@vandijck-laurijssen.be \
    --cc=linux-can@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=remy.dziemiaszko@smile.fr \
    /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.