Module Name:    src
Committed By:   macallan
Date:           Fri Jun  4 06:04:15 UTC 2010

Modified Files:
        src/sys/arch/sparc/dev: zs.c

Log Message:
make sure we pass a valid consdev pointer to the console keyboard so kbd
knows it's console and passes the right flags to wskbd, now the wskbd will
not drop off the mux when leaving event mode.
Symptoms: now the keyboard should no longer be dead when leaving X and there
          should be no more panics caused by it
I tested this on an SS5 and an SS20, may need some more attention and zs.c
sure could use some cleanup - there are a few differences to sparc64 that
really don't make much sense to me, like not passing console flags to zstty
which sparc64 does but sparc avoids, which caused this problem in the first
place.


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/sys/arch/sparc/dev/zs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc/dev/zs.c
diff -u src/sys/arch/sparc/dev/zs.c:1.117 src/sys/arch/sparc/dev/zs.c:1.118
--- src/sys/arch/sparc/dev/zs.c:1.117	Sun Jan 17 16:23:43 2010
+++ src/sys/arch/sparc/dev/zs.c	Fri Jun  4 06:04:15 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: zs.c,v 1.117 2010/01/17 16:23:43 tsutsui Exp $	*/
+/*	$NetBSD: zs.c,v 1.118 2010/06/04 06:04:15 macallan Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.117 2010/01/17 16:23:43 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.118 2010/06/04 06:04:15 macallan Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -454,6 +454,9 @@
 		 * mouse line disciplines for SUN4 machines below.
 		 * Also, don't set the console flags, otherwise we
 		 * tell zstty_attach() to attach as console.
+		 * XXX
+		 * is this still necessary? sparc64 passes the console flags to
+		 * zstty etc. 
 		 */
 		if (zsc->zsc_promunit == 1) {
 			if ((hwflags & ZS_HWFLAG_CONSOLE_INPUT) != 0 &&
@@ -535,8 +538,16 @@
 			struct tty *tp = zstty_get_tty_from_dev(child);
 			kma.kmta_tp = tp;
 			kma.kmta_dev = tp->t_dev;
-			kma.kmta_consdev = zsc_args.consdev;
 
+			/*
+			 * we need to pass a consdev since that's how kbd knows
+			 * it's the console keyboard
+			 */
+			if (hwflags & ZS_HWFLAG_CONSOLE_INPUT) {
+				kma.kmta_consdev = &zs_consdev;
+			} else
+				kma.kmta_consdev = zsc_args.consdev;
+			
 			/* Attach 'em if we got 'em. */
 #if (NKBD > 0)
 			if (channel == 0) {

Reply via email to