Subject: wscons patch
To: None <tech-kern@netbsd.org>
From: Emmanuel Dreyfus <manu@netbsd.org>
List: tech-kern
Date: 10/17/2003 16:28:22
--EVF5PPMfhYS0aIcm
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi

I recently experienced problems with an i386 laptop on which the 
keyboard was not functionnal. I finnally tracked down the problem to 
sys/dev/pckbc/pckbd.c

It seems that normal keyboards are enabled after a reset. This keyboard
is disabled after a reset. The following patch explicitely enable the 
keyboard.

Is it okay to commit it?

-- 
Emmanuel Dreyfus
manu@netbsd.org

--EVF5PPMfhYS0aIcm
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="kbd.patch"

Index: pckbd.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pckbc/pckbd.c,v
retrieving revision 1.36
diff -U4 -r1.36 pckbd.c
--- pckbd.c	2003/09/13 12:31:35	1.36
+++ pckbd.c	2003/10/17 16:19:30
@@ -316,19 +316,26 @@
 	struct pckbd_softc *sc = (void *)self;
 	struct pckbc_attach_args *pa = aux;
 	int isconsole;
 	struct wskbddev_attach_args a;
+	u_char cmd[1];
 
 	printf("\n");
 
 	isconsole = pckbd_is_console(pa->pa_tag, pa->pa_slot);
 
 	if (isconsole) {
 		sc->id = &pckbd_consdata;
 		sc->sc_enabled = 1;
-	} else {
-		u_char cmd[1];
 
+		/* 
+		 * Some keyboards are not enabled after a reset, 
+		 * so let's make sure it is enabled now.
+		 */
+		cmd[0] = KBC_ENABLE;
+		(void) pckbc_poll_cmd(sc->id->t_kbctag, sc->id->t_kbcslot,
+				      cmd, 1, 0, 0, 0);
+	} else {
 		sc->id = malloc(sizeof(struct pckbd_internal),
 				M_DEVBUF, M_WAITOK);
 		(void) pckbd_init(sc->id, pa->pa_tag, pa->pa_slot, 0);
 

--EVF5PPMfhYS0aIcm--