linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hubert Denkmair <xor@xor.wtf>
To: "linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: "user id" for can usb adapters
Date: Sat, 11 Jun 2016 15:03:06 +0200	[thread overview]
Message-ID: <575C0C0A.60903@xor.wtf> (raw)

Hi all,

for my candleLight adapter (gs_usb driver), I would like to implement a feature which is afaik currently not used in linux / socketcan:

A device ID that the user can assign and store permanently on CAN interfaces, e.g. a USB CAN interface.
This is not new - e.g. Peak System implements this in their Windows API.

One use case would be to build multiple measurement setups, each with more than one CAN adapter.

For example, at my company, we build test racks with several CAN interfaces.
Each test rack should run with the same (unmodified) software image.
To be able to build a stable environment, devices shall have a predictable name in each rack.

One way to achieve this would be to
- assign "user IDs" to the CAN interfaces (e.g. CAN A = 0, CAN B = 1, ...)
- have this id exported, e.g. as a sysfs attribute
- use udev to assign defined names for can interfaces with a certain id

Implementing a sysfs attribute for one driver is easy - and I did that for testing purposes.
But since this is (imho) a feature which could be useful for the whole socketcan infrastructure,
I would like to see a standardized method for the functionality.
We should also implement this in the pcan_usb linux driver.

I am aware that there is a file /sys/class/net/<device>/dev_id - but no idea if that would be the right place.
Seems to me as if adding a new sysfs attribute like /sys/class/net/<device>/user_id would be a better way to go.

So - any opinions on this?

Greetings,

Hubert

             reply	other threads:[~2016-06-11 13:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-11 13:03 Hubert Denkmair [this message]
2016-06-12 19:05 ` "user id" for can usb adapters Oliver Hartkopp
2016-06-13 19:01   ` Hubert Denkmair
2016-06-14  6:39     ` Oliver Hartkopp

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=575C0C0A.60903@xor.wtf \
    --to=xor@xor.wtf \
    --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;
as well as URLs for NNTP newsgroup(s).