From: Vojtech P. <vo...@su...> - 2001-07-30 20:20:02
|
On Mon, Jul 30, 2001 at 11:33:24AM -0700, Charles Duffy wrote: > On Mon, Jul 30, 2001 at 09:19:53AM +0200, Vojtech Pavlik wrote: > > On Sun, Jul 29, 2001 at 06:20:55PM -0700, Charles Duffy wrote: > > > This will be less acute when a single interface is available which > > > provides applications with all available information (such as > > > James's suggestion of an evdev mixer which adds a field giving the > > > minor number of the evdev device correspending with the source). > > > > Do we really need an evdev mixer? Isn't it easier to just try to > > open and read all the evdev devices? > > No, it isn't. > > There's quite a bit of software written (Qt/E, for one; Microwindows, > for another) which already has a mouse-handling architecture which > allows the mouse driver to open() a file, which is then returned by > the driver; the framework select()s on that file (among other things), > and calls the mouse event handler when select returns with the > appropriate fd. Unfortunately this probably won't help us with hotplugging. > Writing evdev drivers for this software would mean not only writing a > new driver module (a trivial task) but rearchitecting the framework to > allow drivers to own (and pass to the core) multiple fds, and > attempting to get these patches accepted by each of the projects in > question. Only if you want to use more than one mouse at a time. > Furthermore, there's no means of detecting disconnection/reconnection > -- another thing that an extended evdev mixer could (and, IMHO, > /should/) report. Disconnection is signalled by evdev by returning -ENODEV on read(). The process will be woken up on disconnect. > Assuming that all evdev devices support USB is > faulty -- I personally have some that aren't (including some > non-hot-pluggable devices which may be rmmod'd on entry to powersaving > mode and re-insmod'd on restart; it's quite unuseful if applications > can't detect new minor numbers and such as a result of such things). How would you propose detecting new minor numbers? I'd suggest doing it the same way as USB does with new devices - read /proc/input/devices for an uptodate list, select() on the very same file to get notified of its changes. -- Vojtech Pavlik SuSE Labs |