linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Kurt Van Dijck <kurt.van.dijck@eia.be>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>,
	"Christopher R. Baker" <cbaker@rec.ri.cmu.edu>,
	linux-can@vger.kernel.org
Subject: Re: Populating netdev::dev_id for udev discrimination
Date: Mon, 10 Mar 2014 13:15:01 +0100	[thread overview]
Message-ID: <531DACC5.8090804@hartkopp.net> (raw)
In-Reply-To: <20140310104650.GA456@vandijck-laurijssen.be>

Hey Kurt!

On 10.03.2014 11:46, Kurt Van Dijck wrote:

>> Do you have an idea how to proceed with USB or other devices that bring their
>> own identification (like a serial number / device id) ??
>>
>> E.g. the Softing Card provides some serial number through sysfs:
>>
>> http://lxr.free-electrons.com/source/drivers/net/can/softing/softing_main.c#L719
> 
> I still think this is the correct way.

Yes. You are right.

> udev identifies the device based on anyting device related (serial number, driver, ...)
> and identifies the channel of the device based on the netdev (now through dev_id).
> The netdev links to the device, so there is be no problem with identification.

Looking into your code IMO a similar thing has to be done for the other CAN
interfaces providing HW/SW versions and unique IDs like e.g. a serial number.

E.g. the PEAK USB adapters or the USB8DEV adapter, etc.

It already looks pretty good for a general usage.

Do you know what your attributes "frequency" and "tx_pending" have been used
for in the softing driver? Are they still needed?

> Putting somehing else into the MAC address field is not right.

Ack. It was just a suggestion. But after looking into your sysfs code you
convinced me :-)

> What problem do you try to solve here?

Just to have a unique ID to identify CAN USB adapters to set them to the right
bitrate and netdevice name via udev when they are attached.

Best regards,
Oliver


  parent reply	other threads:[~2014-03-10 12:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-08 16:00 Populating netdev::dev_id for udev discrimination Christopher R. Baker
2014-03-09 19:05 ` Marc Kleine-Budde
2014-03-09 23:32   ` Christopher R. Baker
2014-03-10  7:43   ` Oliver Hartkopp
2014-03-10 10:46     ` Kurt Van Dijck
2014-03-10 11:01       ` Marc Kleine-Budde
2014-03-10 12:18         ` Oliver Hartkopp
2014-03-11 19:08           ` Marc Kleine-Budde
2014-03-11 19:41             ` Oliver Hartkopp
2014-03-11 19:45               ` Marc Kleine-Budde
2014-03-10 12:18         ` Kurt Van Dijck
2014-03-10 12:15       ` Oliver Hartkopp [this message]
2014-03-10 12:52         ` 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=531DACC5.8090804@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=cbaker@rec.ri.cmu.edu \
    --cc=kurt.van.dijck@eia.be \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).