enable/disable in kbd drivers
Maksim Yevmenkin
maksim.yevmenkin at gmail.com
Fri Mar 30 19:02:10 UTC 2007
On 3/29/07, Timothy Bourke <timbob at 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.
>
>
>
More information about the freebsd-hackers
mailing list