Wolfgang Grandegger wrote:

> 
> The rule is one value per file. If it's an id string, like in the
> modalias, it's fine.
> 
>>> A canhwid is something unique that can only be built by the driver, as 
>>> *only*
>>> the driver knows, how to build a unique string out of it's configuration
>>> (regarding serial numbers, ioports, whatever).
>> I like both ways. But the canhwid is definetly what applications may need.
>>> Providing vendor names and product information in a string format in the 
>>> sysfs
>>> is _not_ usual. And 'scanning' for CAN specific values in sysfs to find
>>> something unique will lead to a udev scripting hell.
>>>
>>> Maybe after all this discussion and after coming back to sysfs the idea 
>>> behind
>>> a driver generated unique canhwid has become clearer.
>>>
>>> IMO we could define a common specification, how the canhwid has to be built 
>>> by
>>> the driver, e.g.
>> yes, and this does not forbit anyone to create other sysfs entries for 
>> special cases :-)
>>> <drvname>#<vendor>#<product>#<serialnumber>#<ioport>#<channel>#
>>>
>>> cpc-pcmcia#EMS Wuensche#CPC-Card#12345678#0x1000#0#
>>> sja1000-isa###0x320##
> 
> This looks like a modalias string. How is it related?

Yes. That's pretty much the idea i had - thanks for pointing at modalias :-)

I looked at the modalias stuff in

http://wiki.archlinux.org/index.php/ModaliasPrimer

and AFAICS in /sys the elements inside this modalias string are not restricted
to pci or usb.

But i'm unsure in which directory a useful CAN modalias should be located.

When the modalias is located in /sys/class/net/can0/device/modalias (as Kurt
suggested) i wonder how we can deal with multiple CAN controllers on a single
PCI card.

Additionally the modalias has to be build at runtime to allow unique ISA
devices as described above with the sja1000-isa ...

Any ideas out there?


>>> For the "+5V on Pin1" use-case i would tend to a vendor specific
>>>
>>> /sys/class/net/can0/enable_5v_on_pin1
> 
> I can understand that /sys/class/net/can*/ is a convenient location,
> but please check what is found in /sys/class/net/*/ and judge yourself
> if the directory is appropriate for hardware related device properties.

E.g. wlan0 has an additional 'wireless' directory and pan0 has a 'bridge'
directory and 'brif' and 'brforward' sysfs entries.

>From my perspective /sys/class/net/can0/* is a good place to specify vendor
specific things for a given CAN interface.

Regards,
Oliver

_______________________________________________
Socketcan-core mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-core

Reply via email to