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: Fri, 9 Feb 2018 14:24:53 +0100	[thread overview]
Message-ID: <771a0c6e-c94c-7dc2-ffa0-06507aab077d@pengutronix.de> (raw)
In-Reply-To: <35989d02-3134-1a84-8bec-61a863fa0bf3@kvaser.com>


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

On 02/09/2018 12:21 PM, Jimmy Assarsson wrote:
>>> No, they are not identical. The EAN and serial number is stored on the
>>> device.
>>
>> How to read them?
> 
> It is part of the "kvaser_msg_cardinfo" command, see
> https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git/tree/drivers/net/can/usb/kvaser_usb.c#n198

ok

>>> Which makes a single device unique. It is possible to fetch these
>>> from the device. And same applies to all Kvaser CAN interfaces,
>>> regardless if they are connected via USB, PCI-express or ethernet.
>> What's the output of the udev when using the proper path to your device?
>>
>> "udevadm info --path=/devices/pci0000:00/0000:00:14.0/usb1/1-2/ -a"
> 
> All devices with the same EAN look identical, since we do not set serial
> number in the USB descriptor.

That should be done on the next FW revision.

Ok - I see two possibilities.

1) sysfs file
Add a file to sysfs that contains the serial number, see:
http://lxr.bootlin.com/linux/latest/source/drivers/net/can/softing/softing_main.c#L718

2) ethtool eeprom
You can export the serial number via ethtool's dump eeprom functionality.

Better try 1).

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 --]

  reply	other threads:[~2018-02-09 13:25 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
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 [this message]
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=771a0c6e-c94c-7dc2-ffa0-06507aab077d@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