Date: Fri, 30 Mar 2007 12:02:08 -0700 From: "Maksim Yevmenkin" <maksim.yevmenkin@gmail.com> To: "Timothy Bourke" <timbob@bigpond.com>, hackers@freebsd.org Subject: Re: enable/disable in kbd drivers Message-ID: <bb4a86c70703301202j34b2db88y90052bc7ec518388@mail.gmail.com> In-Reply-To: <20070329224205.GA819@triptrop.cse.unsw.EDU.AU> References: <20070325015717.GA797@triptrop> <bb4a86c70703291008n4a82e627l3f45b1ff8e5ac571@mail.gmail.com> <20070329224205.GA819@triptrop.cse.unsw.EDU.AU>
next in thread | previous in thread | raw e-mail | index | archive | help
On 3/29/07, Timothy Bourke <timbob@bigpond.com> wrote: [...] > > >Does the attached patch seem reasonable? It would fix my immediate > > >problem. > > > > sorry for the delay. i'm not sure about this patch. basically, i do > > not think that keyboard should be disabled if it is released from > > kbdmux. it is perfectly fine, imo, to have two (or more) active > > keyboards attached to the system as long as only one of them is > > primary. it is possible to use /dev/kbdX interface to talk to > > non-primary keyboard(s) directly. > > It seems that, for the extant drivers: > * enable only increments kb_active, > * disable only decrements kb_active. well, yes, if all kbdmux did was call KBD_ACTIVATE/_DEACTIVATE directly, i would not have any problem with it. however, kbdmux calls enable() method and other drivers (such as the one you wrote) may do other things in enable/disable() methods. perhaps the right thing to do to is to have kbdmux check is keyboard is "enabled" and if not - call enable()? thanks, max > With the printf suggested above, one can see that repeating the > commands: > kbdcontrol -A usb0 < /dev/console > kbdcontrol -a usb0 < /dev/console > continually increases kb_active. > > Even with the patch, detaching any of the current kbd drivers will not > deactivate them (reduce kb_active to zero) because they all call > enable (increment kb_active) when initialized. Which answers one of > the other questions. > > Alternative (not serious) suggestion: since the disable hook seems > never to be called, it might as well be removed from the > keyboard_switch... > > Tim. > > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bb4a86c70703301202j34b2db88y90052bc7ec518388>