Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/sys/dev Revert changes that were presumably intended for ...
details: https://anonhg.NetBSD.org/src/rev/63d25ea3568d
branches: netbsd-7
changeset: 798766:63d25ea3568d
user: snj <snj%NetBSD.org@localhost>
date: Fri Jan 02 19:00:17 2015 +0000
description:
Revert changes that were presumably intended for HEAD. Hi jklos!
diffstat:
sys/dev/dec/dzkbd.c | 17 +++-----
sys/dev/dec/lk201_ws.c | 97 ++-----------------------------------------------
sys/dev/dec/lk201var.h | 17 +-------
sys/dev/tc/zskbd.c | 17 +++-----
4 files changed, 20 insertions(+), 128 deletions(-)
diffs (285 lines):
diff -r cf5ba97e17ff -r 63d25ea3568d sys/dev/dec/dzkbd.c
--- a/sys/dev/dec/dzkbd.c Fri Jan 02 08:09:51 2015 +0000
+++ b/sys/dev/dec/dzkbd.c Fri Jan 02 19:00:17 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dzkbd.c,v 1.26.12.1 2015/01/02 08:09:51 jklos Exp $ */
+/* $NetBSD: dzkbd.c,v 1.26.12.2 2015/01/02 19:00:17 snj Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dzkbd.c,v 1.26.12.1 2015/01/02 08:09:51 jklos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dzkbd.c,v 1.26.12.2 2015/01/02 19:00:17 snj Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -237,7 +237,7 @@
do {
c = dzgetc(dzi->dzi_ls);
- } while (!lk201_decode(&dzi->dzi_ks, 0, c, type, data) == LKD_NODATA);
+ } while (!lk201_decode(&dzi->dzi_ks, c, type, data));
}
static void
@@ -294,15 +294,12 @@
struct dzkbd_softc *sc = (struct dzkbd_softc *)v;
u_int type;
int val;
- int decode;
- do {
- decode = lk201_decode(&sc->sc_itl->dzi_ks, 1,
- data, &type, &val);
- if (decode != LKD_NODATA)
- wskbd_input(sc->sc_wskbddev, type, val);
- } while (decode == LKD_MORE);
+ if (sc->sc_enabled == 0)
+ return(0);
+ if (lk201_decode(&sc->sc_itl->dzi_ks, data, &type, &val))
+ wskbd_input(sc->sc_wskbddev, type, val);
return(1);
}
diff -r cf5ba97e17ff -r 63d25ea3568d sys/dev/dec/lk201_ws.c
--- a/sys/dev/dec/lk201_ws.c Fri Jan 02 08:09:51 2015 +0000
+++ b/sys/dev/dec/lk201_ws.c Fri Jan 02 19:00:17 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lk201_ws.c,v 1.8.38.1 2015/01/02 08:09:51 jklos Exp $ */
+/* $NetBSD: lk201_ws.c,v 1.8.38.2 2015/01/02 19:00:17 snj Exp $ */
/*
* Copyright (c) 1998
@@ -27,11 +27,10 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lk201_ws.c,v 1.8.38.1 2015/01/02 08:09:51 jklos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lk201_ws.c,v 1.8.38.2 2015/01/02 19:00:17 snj Exp $");
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/callout.h>
#include <dev/wscons/wsconsio.h>
@@ -41,23 +40,11 @@
#define send(lks, c) ((*((lks)->attmt.sendchar))((lks)->attmt.cookie, c))
-void lk201_identify(void *);
-
-static callout_t lkkbd_id;
-
-static const char *lkkbd_descr[] = {
- "no keyboard",
- "LK-201 keyboard",
- "LK-401 keyboard",
-};
-
int
lk201_init(struct lk201_state *lks)
{
int i;
- lks->waitack = 0;
-
send(lks, LK_LED_ENABLE);
send(lks, LK_LED_ALL);
@@ -82,78 +69,20 @@
send(lks, LK_LED_ALL);
lks->leds_state = 0;
- callout_init(&lkkbd_id, 0);
- callout_setfunc(&lkkbd_id, lk201_identify, lks);
- callout_schedule(&lkkbd_id, 0);
-
return (0);
}
-void
-lk201_identify(void *v)
-{
- struct lk201_state *lks = v;
- int i;
-
- callout_destroy(&lkkbd_id);
- /*
- * Swallow all the keyboard acknowledges from lk201_init().
- * There should be 14 of them - one per LK_CMD_MODE command.
- */
- for(;;) {
- lks->waitack = 1;
- for (i = 100; i != 0; i--) {
- DELAY(1000);
- if (lks->waitack == 0)
- break;
- }
- if (i == 0)
- break;
- }
-
- /*
- * Try to set the keyboard in LK-401 mode.
- * If we receive an error, this is an LK-201 keyboard.
- */
- lks->waitack = 1;
- send(lks, LK_ENABLE_401);
- for (i = 100; i != 0; i--) {
- DELAY(1000);
- if (lks->waitack == 0)
- break;
- }
- if (lks->waitack != 0)
- lks->kbdtype = KBD_NONE;
- else {
- if (lks->ackdata == LK_INPUT_ERROR)
- lks->kbdtype = KBD_LK201;
- else
- lks->kbdtype = KBD_LK401;
- }
- lks->waitack = 0;
-
- printf("lkkbd0: %s\n", lkkbd_descr[lks->kbdtype]);
-}
-
int
-lk201_decode(struct lk201_state *lks, int wantmulti, int datain, u_int *type, int *dataout)
+lk201_decode(struct lk201_state *lks, int datain, u_int *type, int *dataout)
{
int i, freeslot;
- if (lks->waitack != 0) {
- lks->ackdata = datain;
- lks->waitack = 0;
- return LKD_NODATA;
- }
-
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);
@@ -169,25 +98,7 @@
return (0);
}
-
- if (datain == LK_KEY_UP) {
- if (wantmulti) {
- for (i = 0; i < LK_KLL; i++)
- if (lks->down_keys_list[i] != -1) {
- *type = WSCONS_EVENT_KEY_UP;
- *dataout = lks->down_keys_list[i] -
- MIN_LK201_KEY;
- lks->down_keys_list[i] = -1;
- return (LKD_MORE);
- }
- 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);
- }
- } else if (datain < MIN_LK201_KEY || datain > MAX_LK201_KEY) {
+ if (datain < MIN_LK201_KEY || datain > MAX_LK201_KEY) {
printf("lk201_decode: %x\n", datain);
return (0);
}
diff -r cf5ba97e17ff -r 63d25ea3568d sys/dev/dec/lk201var.h
--- a/sys/dev/dec/lk201var.h Fri Jan 02 08:09:51 2015 +0000
+++ b/sys/dev/dec/lk201var.h Fri Jan 02 19:00:17 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lk201var.h,v 1.6.138.1 2015/01/02 08:09:51 jklos Exp $ */
+/* $NetBSD: lk201var.h,v 1.6.138.2 2015/01/02 19:00:17 snj Exp $ */
/*
* Copyright (c) 1998
@@ -33,14 +33,6 @@
struct lk201_state {
struct lk201_attachment attmt;
-
- volatile int waitack;
- int ackdata;
-
- int kbdtype;
-#define KBD_NONE 0x00
-#define KBD_LK201 0x01
-#define KBD_LK401 0x02
#define LK_KLL 8
int down_keys_list[LK_KLL];
int bellvol;
@@ -49,12 +41,7 @@
};
int lk201_init(struct lk201_state *);
-int lk201_decode(struct lk201_state *, int, int, u_int *, int *);
+int lk201_decode(struct lk201_state *, int, u_int *, int *);
void lk201_bell(struct lk201_state *, struct wskbd_bell_data *);
void lk201_set_leds(struct lk201_state *, int);
void lk201_set_keyclick(struct lk201_state *, int);
-
-#define LKD_NODATA 0x00
-#define LKD_COMPLETE 0x01
-#define LKD_MORE 0x02
-
diff -r cf5ba97e17ff -r 63d25ea3568d sys/dev/tc/zskbd.c
--- a/sys/dev/tc/zskbd.c Fri Jan 02 08:09:51 2015 +0000
+++ b/sys/dev/tc/zskbd.c Fri Jan 02 19:00:17 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zskbd.c,v 1.17.38.1 2015/01/02 08:09:51 jklos Exp $ */
+/* $NetBSD: zskbd.c,v 1.17.38.2 2015/01/02 19:00:17 snj Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: zskbd.c,v 1.17.38.1 2015/01/02 08:09:51 jklos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zskbd.c,v 1.17.38.2 2015/01/02 19:00:17 snj Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -281,7 +281,7 @@
do {
c = zs_getc(zsi->zsi_cs);
- } while (!lk201_decode(&zsi->zsi_ks, 0, c, type, data) == LKD_NODATA);
+ } while (!lk201_decode(&zsi->zsi_ks, c, type, data));
}
static void
@@ -336,15 +336,12 @@
{
u_int type;
int val;
- int decode;
- do {
- decode = lk201_decode(&sc->sc_itl->zsi_ks, 1,
- data, &type, &val);
- if (decode != LKD_NODATA)
- wskbd_input(sc->sc_wskbddev, type, val);
- } while (decode == LKD_MORE);
+ if (sc->sc_enabled == 0)
+ return;
+ if (lk201_decode(&sc->sc_itl->zsi_ks, data, &type, &val))
+ wskbd_input(sc->sc_wskbddev, type, val);
}
/****************************************************************
Home |
Main Index |
Thread Index |
Old Index