linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* "user id" for can usb adapters
@ 2016-06-11 13:03 Hubert Denkmair
  2016-06-12 19:05 ` Oliver Hartkopp
  0 siblings, 1 reply; 4+ messages in thread
From: Hubert Denkmair @ 2016-06-11 13:03 UTC (permalink / raw)
  To: linux-can@vger.kernel.org

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-06-14  6:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-11 13:03 "user id" for can usb adapters Hubert Denkmair
2016-06-12 19:05 ` Oliver Hartkopp
2016-06-13 19:01   ` Hubert Denkmair
2016-06-14  6:39     ` Oliver Hartkopp

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).