From: Vojtech P. <vo...@su...> - 2001-06-27 21:06:00
|
On Wed, Jun 27, 2001 at 09:52:46AM -0700, James Simmons wrote: > > > > Howdy. > > > > > > I notice that, at present, several of the handlers (such as evdev) > > > assign device numbers independantly. Hence, /dev/input/event2 and > > > /dev/input/mouse2 may not refer to the same device, and (similarly) > > > may not refer to the device dubbed input2 on initialization. > > > > > > Might it not make for a somewhat more user-friendly world to have > > > handlers use dev->number for determining the minor number for each > > > connected device? > > > > > > This would also make a table of connected input devices somewhat more > > > useful. > > > > Sounds reasonable to start searching for free numbers at the dev->number > > position. What others think? > > Is it possible to match them up like that? I was thinking about it and > to me it seems like a huge task. Unless I miss understood what he > suggested. We can't match them completely, but we should be able to make a good approximation if the user doesn't do too nasty things to the system. > One thing I like to bring up about numbering is when you plug and > unplug devices. At present when you unplug a device and plug it back in > the device becomes /dev/input/event[n+1]. Where /dev/input/event[n] now > has no device attached. Only if it is open. If it is not, it'll become /dev/input/event[n] > There is a limit to 256 event devices. Now you > say that is a good number but given 5 input devices it whould take 15 > times unplugging and plugging them back in before you run out of numbers. > So I like to suggest that we keep track of the "free" numbers and grab the > lowest one. We do this, at least in evdev. > Say you have 5 devices and you unplug device 3 and then plug > it back it then it should be device 3 again. Not device 6. -- Vojtech Pavlik SuSE Labs |