Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 Mar 2009 21:17:07 -0600
From:      Robert Noland <rnoland@FreeBSD.org>
To:        Jose M Rodriguez <josemi@freebsd.jazztel.es>
Cc:        gnome@freebsd.org, FreeBSD-gnats-submit@freebsd.org
Subject:   Re: xorg-server can't load usb keyboards via config/hal
Message-ID:  <1236050227.1384.3.camel@widget.2hip.net>
In-Reply-To: <200903030039.n230dfYk083990@redesjm.local>
References:  <200903030039.n230dfYk083990@redesjm.local>

next in thread | previous in thread | raw e-mail | index | archive | help

--=-J1hog6M5UqvHqyp/EoaK
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Tue, 2009-03-03 at 01:39 +0100, Jose M Rodriguez wrote:
> >Submitter-Id:	current-users
> >Originator:	Jose M Rodriguez
> >Organization:	Redes JM
> >Confidential:	no
> >Synopsis:	xorg-server can't load usb keyboards via config/hal
> >Severity:	serious
> >Priority:	medium
> >Category:	ports
> >Class:		sw-bug
> >Release:	FreeBSD 7.1-RELEASE-p3 i386
> >Environment:
> System: FreeBSD hermes 7.1-RELEASE-p3 FreeBSD 7.1-RELEASE-p3 #0: Mon Mar =
2 03:34:41 CET 2009 root@hermes:/usr/obj/usr/src/sys/HERMES i386
>=20
> machine only with usb keyboard
> kernel build without atkbd / kbdmux devices
>=20
> >Description:
> 	xorg-server can't load usb keyboards via config/hal.
> 	It fails at device open, as hal have a device key.
>=20
> 	This is not noticeable in an stock system.
> 	The presence of an atkbd without a hal device key
> 	makes xorg-server load the module.
>=20
> 	Seems that xorg-server keyboard is not device oriented
> 	and hal must not have a device key for usb keyboard=20
>=20
> >How-To-Repeat:
> 	You can see this on the Xorg logs.
> 	In systems without kernel atkbd device, xorg-server
> 	can't get a functional keyboad
>=20
> >Fix:
> 	Don't add a device key for usb keyborads, as is done
> 	for at ones (PS/2)
>=20
> 	- hf_device_set_input(device, "keyboard", devname);
> 	+ hf_device_set_input(device, "keyboard", NULL);
>=20

This appears to be correct, though incomplete.  It doesn't address usb2,
but I fixed that up.

The keyboard driver does have the ability to open character devices, but
in our case syscons always takes control of the device nodes.  This will
likely also fix the cases where people set keyboard options in fdi files
on usb keyboards.

robert.

> --- pr.patch begins here ---
> --- sysutils/hal/files/patch-hald_freebsd_hf-usb.c.old	2009-03-02 15:34:5=
2.000000000 +0100
> +++ sysutils/hal/files/patch-hald_freebsd_hf-usb.c	2009-03-02 04:27:23.00=
0000000 +0100
> @@ -1,5 +1,5 @@
> ---- hald/freebsd/hf-usb.c.orig	2008-05-07 19:24:02.000000000 -0400
> -+++ hald/freebsd/hf-usb.c	2009-02-27 14:01:46.000000000 -0500
> +--- hald/freebsd/hf-usb.c.orig	2008-05-08 01:24:02.000000000 +0200
> ++++ hald/freebsd/hf-usb.c	2009-03-02 04:23:32.000000000 +0100
>  @@ -25,13 +25,18 @@
>   #  include <config.h>
>   #endif
> @@ -31,7 +31,7 @@
>  =20
>   typedef struct
>   {
> -@@ -231,7 +241,7 @@ hf_usb_get_full_config_descriptor (int f
> +@@ -231,7 +241,7 @@
>    * Adapted from usb_compute_udi() in linux2/physdev.c and
>    * usbclass_compute_udi() in linux2/classdev.c.
>    */
> @@ -40,7 +40,7 @@
>   hf_usb_device_compute_udi (HalDevice *device)
>   {
>     g_return_if_fail(HAL_IS_DEVICE(device));
> -@@ -250,12 +260,13 @@ hf_usb_device_compute_udi (HalDevice *de
> +@@ -250,12 +260,13 @@
>       hf_device_set_udi(device, "usb_device_%x_%x_%s",
>   		      hal_device_property_get_int(device, "usb_device.vendor_id"),
>   		      hal_device_property_get_int(device, "usb_device.product_id"),
> @@ -56,7 +56,16 @@
>   hf_usb_add_webcam_properties (HalDevice *device)
>   {
>     int unit;
> -@@ -575,6 +586,8 @@ hf_usb_probe_device (HalDevice *parent,
> +@@ -424,7 +435,7 @@
> +     hf_devtree_device_set_name(device, di->udi_devnames[0]);
> +=20
> +   if ((devname =3D hf_usb_get_devname(di, "ukbd")))	/* USB keyboard */
> +-    hf_device_set_input(device, "keyboard", devname);
> ++    hf_device_set_input(device, "keyboard", NULL);
> +   else if ((devname =3D hf_usb_get_devname(di, "ums")))	/* USB mouse */
> +     hf_device_set_input(device, "mouse", devname);
> +   else if ((devname =3D hf_usb_get_devname(di, "uhid")))	/* UHID device=
 */
> +@@ -575,6 +586,8 @@
>       {
>         if (hal_device_has_capability(device, "hiddev"))
>   	hf_runner_run_sync(device, 0, "hald-probe-hiddev", NULL);
> @@ -65,7 +74,7 @@
>  =20
>         hf_device_add(device);
>       }
> -@@ -633,9 +646,18 @@ hf_usb_privileged_init (void)
> +@@ -633,9 +646,18 @@
>   {
>     int i;
>  =20
> --- pr.patch ends here ---
>=20
>=20
> _______________________________________________
> freebsd-gnome@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-gnome
> To unsubscribe, send any mail to "freebsd-gnome-unsubscribe@freebsd.org"
--=20
Robert Noland <rnoland@FreeBSD.org>
FreeBSD

--=-J1hog6M5UqvHqyp/EoaK
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (FreeBSD)

iEYEABECAAYFAkmsoTMACgkQM4TrQ4qfROMrrwCeOIKQu5JL93pw2k9qUIAlpKub
TJYAnAsY2x+fZ2rmG1vjd6NQfhFTbf08
=8P6F
-----END PGP SIGNATURE-----

--=-J1hog6M5UqvHqyp/EoaK--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1236050227.1384.3.camel>