Subject: Re: Xorg (7.1) and keyboard
To: Michael Lorenz <macallan@netbsd.org>
From: Arto Huusko <arto.huusko@pp2.inet.fi>
List: port-sparc64
Date: 12/06/2006 15:26:35
>> Tried both wskbd and wskbd0 and they both fail
>> the same way: EBUSY (doesn't the mux claim wskbd0).
> 
> Hmm, it works here.

Using what server? NetBSD XFree or some Xorg?

Anyway, I finally figured out the problem, and this same
problem affects also pkgsrc Xorg and I think xsrc Xorg
(I tested on i386, and it does fail the same way).
The kbd device is opened twice if wskbd protocol is used:

First the device is opened during initial configuration
(at hw/xfree86/common/xf86Config.c:configInputKbd())
and the second time it is opened when the server
loads the keyboard driver
(at hw/xfree86/os-support/bsd/bsd_kbd.c:OpenKeyboard())
The second time fails with EBUSY.

Hmm, Xorg has this comment in front of configInputKbd():

/*
 * XXX This function is temporary, and will be removed when the keyboard
 * driver is converted into a regular input driver.
 */

I added code to close kbdFd in configInputKbd(), and now
the server starts, and at least in a quick test it didn't
hang during typing.


By the way, xsrc Xorg does not have all NetBSD fixes
that XFree has: at least, it fails if wskbd type is
unknown, while the XFree version does not.