From: Jimmy Assarsson <extja@kvaser.com>
To: Marc Kleine-Budde <mkl@pengutronix.de>,
"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: Associate physical device with device name
Date: Fri, 9 Feb 2018 12:21:30 +0100 [thread overview]
Message-ID: <35989d02-3134-1a84-8bec-61a863fa0bf3@kvaser.com> (raw)
In-Reply-To: <464f89e6-82c8-a2fd-25e2-f847508b41a3@pengutronix.de>
On 2018-02-09 11:47, Marc Kleine-Budde wrote:
> On 02/08/2018 02:04 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
>> 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.
The output from "udevadm info
--path=/sys/devices/pci0000:00/0000:00:02.1/usb1/1-4/1-4.1/1-4.1:1.0 -a"
looking at device
'/devices/pci0000:00/0000:00:02.1/usb1/1-4/1-4.1/1-4.1:1.0':
KERNEL=="1-4.1:1.0"
SUBSYSTEM=="usb"
DRIVER=="kvaser_usb"
ATTR{authorized}=="1"
ATTR{bAlternateSetting}==" 0"
ATTR{bInterfaceClass}=="00"
ATTR{bInterfaceNumber}=="00"
ATTR{bInterfaceProtocol}=="00"
ATTR{bInterfaceSubClass}=="00"
ATTR{bNumEndpoints}=="02"
ATTR{supports_autosuspend}=="0"
looking at parent device
'/devices/pci0000:00/0000:00:02.1/usb1/1-4/1-4.1':
KERNELS=="1-4.1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{authorized}=="1"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{bConfigurationValue}=="1"
ATTRS{bDeviceClass}=="ff"
ATTRS{bDeviceProtocol}=="00"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{bMaxPower}=="132mA"
ATTRS{bNumConfigurations}=="1"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bcdDevice}=="0001"
ATTRS{bmAttributes}=="c0"
ATTRS{busnum}=="1"
ATTRS{configuration}==""
ATTRS{devnum}=="26"
ATTRS{devpath}=="4.1"
ATTRS{idProduct}=="0123"
ATTRS{idVendor}=="0bfd"
ATTRS{ltm_capable}=="no"
ATTRS{manufacturer}=="Kvaser AB"
ATTRS{maxchild}=="0"
ATTRS{product}=="Kvaser USBcan Light"
ATTRS{quirks}=="0x0"
ATTRS{removable}=="unknown"
ATTRS{speed}=="480"
ATTRS{urbnum}=="17"
ATTRS{version}==" 2.00"
next prev parent reply other threads:[~2018-02-09 11:21 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 [this message]
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=35989d02-3134-1a84-8bec-61a863fa0bf3@kvaser.com \
--to=extja@kvaser.com \
--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