Linux CAN drivers development
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Jimmy Assarsson <extja@kvaser.com>,
	"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: Associate physical device with device name
Date: Thu, 8 Feb 2018 13:45:42 +0100	[thread overview]
Message-ID: <87ddf56f-c829-6aad-5b86-474359d282d4@pengutronix.de> (raw)
In-Reply-To: <e8998556-5e13-1cec-f404-70c4679ca9c3@kvaser.com>


[-- Attachment #1.1: Type: text/plain, Size: 1297 bytes --]

On 01/26/2018 03:38 PM, Jimmy Assarsson wrote:
> We would like to be able to associate physical (Kvaser) USB devices with
> their device names (can0 etc.).
> The interface's EAN (article number) combined with serial number, form a
> unique identifier.
> 
> It is not possible to do this from the USB descriptor. Since the serial
> number is not provided in the USB descriptor. And the same PID is reused
> for multiple EAN numbers. It is preferable with a solution that is
> independent of interface type (USB etc.), since we may support other
> devices in the future.
> 
> This is somewhat similar to '"user id" for can usb adapters',
> https://marc.info/?l=linux-can&m=146565019622100
> 
> What is the preferable way of solving this kind of problem? Is sysfs
> suitable?

Are your adaptors 100% idential? Then there is no way to tell them apart
in software. However you should be possible to write a custom udev rule
to rename the adapter depending on the physical USB-Port you are using.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2018-02-08 12:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-26 14:38 Associate physical device with device name Jimmy Assarsson
2018-02-08 12:05 ` Jimmy Assarsson
2018-02-08 12:45 ` Marc Kleine-Budde [this message]
2018-02-08 13:04   ` Jimmy Assarsson
2018-02-09  7:50     ` Jimmy Assarsson
2018-02-09 10:47     ` Marc Kleine-Budde
2018-02-09 11:21       ` Jimmy Assarsson
2018-02-09 13:24         ` Marc Kleine-Budde
2018-02-09 15:35           ` Jimmy Assarsson
2018-02-09 17:09             ` Oliver Hartkopp
2018-02-10  9:58               ` Kurt Van Dijck
2018-02-10 11:01               ` André Hartmann

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=87ddf56f-c829-6aad-5b86-474359d282d4@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=extja@kvaser.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox