[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: USB peripherals are plugged in across time: how are /dev/ttyUSBx assignations done?



Merciadri Luca wrote:

> Because if I can know it by theory, it avoids me `practice.' :)
> 
> Lisi wrote:
>> On Sunday 04 July 2010 13:06:51 Merciadri Luca wrote:
>>   
>>> Let's say that you progressively plug in USB peripherals in(to) USB
>>> ports of one computer running Debian. How are the /dev/ttyUSB0,
>>> /dev/ttyUSB1, etc., assignations achieved? Is /dev/ttyUSB0 the first
>>> plugged device, or is it one in a specific port? Thanks.
>>>     
>>
>>  Why not just suck it and see?
>>   
> 
> 

did someone already mentioned udev?

to find out what you are talking about you should post your device ids (get
them from the logs after plugging the device or in the boot portion)

As someone wrote you get the device created by the driver usually, but not
really. you can use mknod or MAKEDEV to create device nodes. However they
will be used only if the appropriate driver is loaded.
Then there is udev, that will take over after specific event and recreate
device nodes if they don't exist (this is the default behavior in current
linux). So, if you don't have any specific configuration (in the driver or
in udev) you will get ttyUSB0 for the device that responds first to the
driver unless the driver is waiting to get a full list of supported
devices, which mostly is not the case. This can be prevented by
configuration when using the usb ids or using the driver documentation and
putting a configuration file in /etc/modprobe.d. This is what I do for dvb
and sound devices. My mobile always creates the same devices in the same
order. I didn't ask myself why ... I guess udev.


regards



Reply to: