Wolfgang Grandegger schrieb:
> Sebastian Haas wrote:
>   
>>
>> Imagine a GUI application which displays all available CAN channels. How
>> does the user differ between 2 or 3 connected devices or just think
>> about the 4 channel CPC-PCI board. How does the user know which can*
>> device is which channel?
>>     
>
> This could be done using the device renaming mechanism.
>  
>   

Which would need a proper information exposure via sysfs to make udev happy.

>> In our proprietary products we have a similiar situation as in Socket
>> CAN. In Socket CAN you have abstract can* network interface to access
>> the actual physical channel. In our library CPC-LIB you have CHAN*,
>> these logical channels (CHAN*) must be configured using device
>> information (e.g. CHAN00 is CPC-PCI board #1, channel #2, CHAN02 is
>> CPC-USB with serial #1923).
>>
>> If the candev system would provide a common to get this information, a
>> GUI display or even a terminal application can display additional
>> information about each channel, so the user can decide which channel he
>> wants to actually use.
>>     
>
> Then it would make sense to add this to the device properties you can
> get via the CAN netlink interface. Most likely you are interested in
> other parameters like CAN statistics or bit-timinig as well. That's not
> a big deal. They would then show up here:
>
>
> $ ip -details -statistics link show can0
>     2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP qlen 10
>       link/can
>       can <TRIPLE-SAMPLING> state ERROR-ACTIVE restart-ms 100
>       bitrate 125000 sample_point 0.875
>       tq 125 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
>       sja1000: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..64 brp-inc 1
>       clock 8000000
>       board cpc-pci channel 2 serial# 123456 
>   

Indeed this is a good step. IMO we we some kind of unique identifier for 
a CAN hardware.

In the above example the serial number is a unique ID to identify the 
board. If you have a sja1000-isa (or mscan) setup with several 
controllers, the I/O port address would be the unique item.

This could look like

"board sja1000-isa port 0x320"

in the last line of your given example.

Additionally to the possibility to get this kind of 'unique hardware ID' 
from netlink via 'ip link' probably the same unique ID could be provided 
in /sys/class/net/can0/canhwid or something like that ?!?

E.g.
$ cat /sys/class/net/can0/canhwid
board cpc-pci channel 2 serial# 123456

Any thoughts?

Regards,
Oliver

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

Reply via email to