Module Name: src Committed By: martin Date: Sat Feb 17 16:19:14 UTC 2024
Modified Files: src/sys/dev/dec [netbsd-9]: dzkbd.c lk201_ws.c lk201var.h Log Message: Pull up following revision(s) (requested by tsutsui in ticket #1798): sys/dev/dec/dzkbd.c: revision 1.32 sys/dev/dec/lk201var.h: revision 1.8 sys/dev/dec/lk201_ws.c: revision 1.11 Fix a fatal typo that causes dzkbd_cngetc() to stall. Use proper macro for return values and remove #if 0'ed out block. Mostly from OpenBSD/vax. No binary changes. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.27.24.1 src/sys/dev/dec/dzkbd.c cvs rdiff -u -r1.10 -r1.10.24.1 src/sys/dev/dec/lk201_ws.c cvs rdiff -u -r1.7 -r1.7.24.1 src/sys/dev/dec/lk201var.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/dec/dzkbd.c diff -u src/sys/dev/dec/dzkbd.c:1.27 src/sys/dev/dec/dzkbd.c:1.27.24.1 --- src/sys/dev/dec/dzkbd.c:1.27 Fri Jan 2 21:32:26 2015 +++ src/sys/dev/dec/dzkbd.c Sat Feb 17 16:19:14 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: dzkbd.c,v 1.27 2015/01/02 21:32:26 jklos Exp $ */ +/* $NetBSD: dzkbd.c,v 1.27.24.1 2024/02/17 16:19:14 martin Exp $ */ /* * Copyright (c) 1992, 1993 @@ -45,7 +45,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: dzkbd.c,v 1.27 2015/01/02 21:32:26 jklos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dzkbd.c,v 1.27.24.1 2024/02/17 16:19:14 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -237,7 +237,7 @@ dzkbd_cngetc(void *v, u_int *type, int * do { c = dzgetc(dzi->dzi_ls); - } while (!lk201_decode(&dzi->dzi_ks, 0, c, type, data) == LKD_NODATA); + } while (lk201_decode(&dzi->dzi_ks, 0, c, type, data) == LKD_NODATA); } static void Index: src/sys/dev/dec/lk201_ws.c diff -u src/sys/dev/dec/lk201_ws.c:1.10 src/sys/dev/dec/lk201_ws.c:1.10.24.1 --- src/sys/dev/dec/lk201_ws.c:1.10 Mon Jul 11 10:55:35 2016 +++ src/sys/dev/dec/lk201_ws.c Sat Feb 17 16:19:14 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: lk201_ws.c,v 1.10 2016/07/11 10:55:35 skrll Exp $ */ +/* $NetBSD: lk201_ws.c,v 1.10.24.1 2024/02/17 16:19:14 martin Exp $ */ /* * Copyright (c) 1998 @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: lk201_ws.c,v 1.10 2016/07/11 10:55:35 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lk201_ws.c,v 1.10.24.1 2024/02/17 16:19:14 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -133,17 +133,10 @@ lk201_decode(struct lk201_state *lks, in } switch (datain) { -#if 0 - case LK_KEY_UP: - for (i = 0; i < LK_KLL; i++) - lks->down_keys_list[i] = -1; - *type = WSCONS_EVENT_ALL_KEYS_UP; - return (1); -#endif case LK_POWER_UP: printf("lk201_decode: powerup detected\n"); lk201_init(lks); - return (0); + return LKD_NODATA; case LK_KDOWN_ERROR: case LK_POWER_ERROR: case LK_OUTPUT_ERROR: @@ -152,7 +145,7 @@ lk201_decode(struct lk201_state *lks, in /* FALLTHRU */ case LK_KEY_REPEAT: /* autorepeat handled by wskbd */ case LK_MODE_CHANGE: /* ignore silently */ - return (0); + return LKD_NODATA; } @@ -164,18 +157,18 @@ lk201_decode(struct lk201_state *lks, in *dataout = lks->down_keys_list[i] - MIN_LK201_KEY; lks->down_keys_list[i] = -1; - return (LKD_MORE); + return LKD_MORE; } - return (LKD_NODATA); + return LKD_NODATA; } else { for (i = 0; i < LK_KLL; i++) lks->down_keys_list[i] = -1; *type = WSCONS_EVENT_ALL_KEYS_UP; - return (LKD_COMPLETE); + return LKD_COMPLETE; } } else if (datain < MIN_LK201_KEY || datain > MAX_LK201_KEY) { printf("lk201_decode: %x\n", datain); - return (0); + return LKD_NODATA; } *dataout = datain - MIN_LK201_KEY; @@ -185,7 +178,7 @@ lk201_decode(struct lk201_state *lks, in if (lks->down_keys_list[i] == datain) { *type = WSCONS_EVENT_KEY_UP; lks->down_keys_list[i] = -1; - return (1); + return LKD_COMPLETE; } if (lks->down_keys_list[i] == -1 && freeslot == -1) freeslot = i; @@ -193,12 +186,12 @@ lk201_decode(struct lk201_state *lks, in if (freeslot == -1) { printf("lk201_decode: down(%d) no free slot\n", datain); - return (0); + return LKD_NODATA; } *type = WSCONS_EVENT_KEY_DOWN; lks->down_keys_list[freeslot] = datain; - return (1); + return LKD_COMPLETE; } void Index: src/sys/dev/dec/lk201var.h diff -u src/sys/dev/dec/lk201var.h:1.7 src/sys/dev/dec/lk201var.h:1.7.24.1 --- src/sys/dev/dec/lk201var.h:1.7 Fri Jan 2 21:32:26 2015 +++ src/sys/dev/dec/lk201var.h Sat Feb 17 16:19:14 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: lk201var.h,v 1.7 2015/01/02 21:32:26 jklos Exp $ */ +/* $NetBSD: lk201var.h,v 1.7.24.1 2024/02/17 16:19:14 martin Exp $ */ /* * Copyright (c) 1998 @@ -54,7 +54,7 @@ void lk201_bell(struct lk201_state *, st void lk201_set_leds(struct lk201_state *, int); void lk201_set_keyclick(struct lk201_state *, int); +/* Values returned by lk201_decode */ #define LKD_NODATA 0x00 #define LKD_COMPLETE 0x01 #define LKD_MORE 0x02 -