Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Oct 2006 18:32:57 +0400
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        stable@FreeBSD.org
Subject:   Please test keyboard-related fixes to be MFCed
Message-ID:  <20061025143257.GC853@rambler-co.ru>

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

--W5WqUoFLvi1M7tJE
Content-Type: multipart/mixed; boundary="XWOWbaMNXpFDWE00"
Content-Disposition: inline


--XWOWbaMNXpFDWE00
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi,

I'm going to ask re@'s approval to MFC the attached patches to
RELENG_6 in 3 days.  I'd appreciate it if some of you who have
issues listed below could test it and report back if it got
better with these patches.  What has been fixed:

- If PS/2 keyboard is attached *after* the system has booted,
  the keyboard LEDs now work as expected, with or without
  kbdmux(4).

- CAPS LED now works on USB keyboards under X.

- It's now possible to build a release with -P in installation
  /boot.config, similar to how this was possible for a long
  time on i386.  (amd64 only.)

- It's now possible to plug a PS/2 keyboard after boot, and
  have it working during the initial installation.  Previously
  it's been disabled by a hint.atkbd.0.flags=3D"0x1" in the
  installation /boot/device.hints.  It doesn't break USB
  keyboard installations which this was a workaround for
  before we had kbdmux(4).  (amd64 and i386.)

- Related to the previous change; if /boot/device.hints is
  updated with a fresh copy of GENERIC.hints, the PS/2
  keyboard can be plugged after the system has already booted,
  and will work.  (amd64 only.)


Cheers,
--=20
Ruslan Ermilov
ru@FreeBSD.org
FreeBSD committer

--XWOWbaMNXpFDWE00
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=p
Content-Transfer-Encoding: quoted-printable

Index: sys/amd64/conf/GENERIC.hints
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sys/amd64/conf/GENERIC.hints,v
retrieving revision 1.15
diff -u -p -r1.15 GENERIC.hints
--- sys/amd64/conf/GENERIC.hints	22 Jul 2004 22:28:34 -0000	1.15
+++ sys/amd64/conf/GENERIC.hints	25 Oct 2006 13:56:37 -0000
@@ -11,7 +11,6 @@ hint.atkbdc.0.at=3D"isa"
 hint.atkbdc.0.port=3D"0x060"
 hint.atkbd.0.at=3D"atkbdc"
 hint.atkbd.0.irq=3D"1"
-hint.atkbd.0.flags=3D"0x1"
 hint.psm.0.at=3D"atkbdc"
 hint.psm.0.irq=3D"12"
 hint.vga.0.at=3D"isa"
Index: sys/dev/atkbdc/atkbd.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sys/dev/atkbdc/atkbd.c,v
retrieving revision 1.47.2.2
diff -u -p -r1.47.2.2 atkbd.c
--- sys/dev/atkbdc/atkbd.c	4 Oct 2006 06:09:08 -0000	1.47.2.2
+++ sys/dev/atkbdc/atkbd.c	25 Oct 2006 13:08:08 -0000
@@ -482,6 +482,22 @@ atkbd_intr(keyboard_t *kbd, void *arg)
 	int delay[2];
 	int c;
=20
+	if (!KBD_HAS_DEVICE(kbd)) {
+		/*
+		 * The keyboard was not detected before;
+		 * it must have been reconnected!
+		 */
+		state =3D (atkbd_state_t *)kbd->kb_data;
+		init_keyboard(state->kbdc, &kbd->kb_type,
+			      kbd->kb_config);
+		KBD_FOUND_DEVICE(kbd);
+		atkbd_ioctl(kbd, KDSETLED, (caddr_t)&state->ks_state);
+		get_typematic(kbd);
+		delay[0] =3D kbd->kb_delay1;
+		delay[1] =3D kbd->kb_delay2;
+		atkbd_ioctl(kbd, KDSETREPEAT, (caddr_t)delay);
+	}
+
 	if (KBD_IS_ACTIVE(kbd) && KBD_IS_BUSY(kbd)) {
 		/* let the callback function to process the input */
 		(*kbd->kb_callback.kc_func)(kbd, KBDIO_KEYINPUT,
@@ -491,22 +507,6 @@ atkbd_intr(keyboard_t *kbd, void *arg)
 		do {
 			c =3D atkbd_read_char(kbd, FALSE);
 		} while (c !=3D NOKEY);
-
-		if (!KBD_HAS_DEVICE(kbd)) {
-			/*
-			 * The keyboard was not detected before;
-			 * it must have been reconnected!
-			 */
-			state =3D (atkbd_state_t *)kbd->kb_data;
-			init_keyboard(state->kbdc, &kbd->kb_type,
-				      kbd->kb_config);
-			atkbd_ioctl(kbd, KDSETLED, (caddr_t)&state->ks_state);
-			get_typematic(kbd);
-			delay[0] =3D kbd->kb_delay1;
-			delay[1] =3D kbd->kb_delay2;
-			atkbd_ioctl(kbd, KDSETREPEAT, (caddr_t)delay);
-			KBD_FOUND_DEVICE(kbd);
-		}
 	}
 	return 0;
 }
Index: sys/dev/usb/ukbd.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sys/dev/usb/ukbd.c,v
retrieving revision 1.52.2.2
diff -u -p -r1.52.2.2 ukbd.c
--- sys/dev/usb/ukbd.c	4 Oct 2006 06:09:10 -0000	1.52.2.2
+++ sys/dev/usb/ukbd.c	25 Oct 2006 12:17:27 -0000
@@ -1208,7 +1208,8 @@ ukbd_ioctl(keyboard_t *kbd, u_long cmd,=20
 		}
 		i =3D *(int *)arg;
 		/* replace CAPS LED with ALTGR LED for ALTGR keyboards */
-		if (kbd->kb_keymap->n_keys > ALTGR_OFFSET) {
+		if (state->ks_mode =3D=3D K_XLATE &&
+		    kbd->kb_keymap->n_keys > ALTGR_OFFSET) {
 			if (i & ALKED)
 				i |=3D CLKED;
 			else
Index: release/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/release/Makefile,v
retrieving revision 1.887.2.17
diff -u -p -r1.887.2.17 Makefile
--- release/Makefile	15 Sep 2006 19:27:40 -0000	1.887.2.17
+++ release/Makefile	25 Oct 2006 13:58:35 -0000
@@ -953,9 +953,6 @@ cdrom.1:
 	# Break the link to device.hints so we can modify it
 	@rm -f ${CD_LIVEFS}/boot/device.hints
 	@cp ${RD}/trees/base/boot/device.hints ${CD_LIVEFS}/boot/device.hints
-.if ${TARGET} =3D=3D "i386" || ${TARGET_ARCH} =3D=3D "amd64"
-	@echo 'hint.atkbd.0.flags=3D"0x1"' >> ${CD_LIVEFS}/boot/device.hints
-.endif
 .endif
 	@echo "CD_VERSION =3D ${BUILDNAME}" > ${CD_LIVEFS}/cdrom.inf
 	touch ${.TARGET}
@@ -1262,9 +1259,6 @@ buildBootFloppy:
 	    ${BOOTDIR}/loader.rc ${IMAGEDIR}/boot
 .if exists(${HINTSFILE})
 	@cp ${HINTSFILE} ${IMAGEDIR}/boot/device.hints
-.if ${TARGET} =3D=3D "i386" || ${TARGET_ARCH} =3D=3D "amd64"
-	@echo 'hint.atkbd.0.flags=3D"0x1"' >> ${IMAGEDIR}/boot/device.hints
-.endif
 	@gzip -9n ${IMAGEDIR}/boot/device.hints
 .endif
 	@gzip -9n ${IMAGEDIR}/boot/*.4th ${IMAGEDIR}/boot/loader.help \
@@ -1285,9 +1279,11 @@ buildBootFloppy:
 .if defined(SPLIT_MFSROOT)
 	@echo 'mfsroot_after=3D"read -p \"Insert boot floppy and press Enter\""' =
>> ${IMAGEDIR}/boot/loader.conf
 .endif
-.if ${TARGET_ARCH} =3D=3D "i386" && ${AUTO_KEYBOARD_DETECT}
+.if ${TARGET_ARCH} =3D=3D "i386" || ${TARGET_ARCH} =3D=3D "amd64"
+.if ${AUTO_KEYBOARD_DETECT}
 	@echo "-P" >> ${IMAGEDIR}/boot.config
 .endif
+.endif
 	@rm -f ${IMAGEFILE}
 	@cp ${KERNFILE} ${MFSROOTFILE} ${IMAGEDIR}
 	sh -e ${DOFS_SH} ${IMAGEFILE} ${RD} ${MNT} ${FLPSIZE} ${IMAGEDIR} \

--XWOWbaMNXpFDWE00--

--W5WqUoFLvi1M7tJE
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (FreeBSD)

iD8DBQFFP3WZqRfpzJluFF4RAp5yAJwPziiexHeR7EHOWHvInsRi+bUwsgCdGdDB
UhoB+h3OTrTqi1xdUcV0Gx8=
=mlr6
-----END PGP SIGNATURE-----

--W5WqUoFLvi1M7tJE--



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