diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/hppa/gsc/gsckbc.c | 9 | ||||
-rw-r--r-- | sys/arch/sgi/dev/iockbc.c | 6 | ||||
-rw-r--r-- | sys/arch/sgi/dev/mkbc.c | 6 | ||||
-rw-r--r-- | sys/dev/ic/pckbc.c | 34 | ||||
-rw-r--r-- | sys/dev/ic/pckbcvar.h | 4 | ||||
-rw-r--r-- | sys/dev/pckbc/pckbd.c | 10 |
6 files changed, 28 insertions, 41 deletions
diff --git a/sys/arch/hppa/gsc/gsckbc.c b/sys/arch/hppa/gsc/gsckbc.c index 52e3ac27455..3a450c53118 100644 --- a/sys/arch/hppa/gsc/gsckbc.c +++ b/sys/arch/hppa/gsc/gsckbc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gsckbc.c,v 1.13 2010/12/03 18:29:56 shadchin Exp $ */ +/* $OpenBSD: gsckbc.c,v 1.14 2012/08/10 17:49:31 shadchin Exp $ */ /* * Copyright (c) 2003, Miodrag Vallat. * All rights reserved. @@ -591,12 +591,11 @@ pckbc_poll_data(self, slot) } int -pckbc_xt_translation(self, slot, on) +pckbc_xt_translation(self) pckbc_tag_t self; - pckbc_slot_t slot; - int on; { - return (0); + /* Translation isn't supported... */ + return (-1); } void diff --git a/sys/arch/sgi/dev/iockbc.c b/sys/arch/sgi/dev/iockbc.c index 59d334cf98a..adc4f9627e2 100644 --- a/sys/arch/sgi/dev/iockbc.c +++ b/sys/arch/sgi/dev/iockbc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iockbc.c,v 1.7 2010/12/03 18:29:56 shadchin Exp $ */ +/* $OpenBSD: iockbc.c,v 1.8 2012/08/10 17:49:31 shadchin Exp $ */ /* * Copyright (c) 2006, 2007, 2009 Joel Sing <jsing@openbsd.org> * @@ -785,10 +785,10 @@ restart: */ int -pckbc_xt_translation(pckbc_tag_t self, pckbc_slot_t slot, int on) +pckbc_xt_translation(pckbc_tag_t self) { /* Translation isn't supported... */ - return 0; + return (-1); } /* For use in autoconfiguration. */ diff --git a/sys/arch/sgi/dev/mkbc.c b/sys/arch/sgi/dev/mkbc.c index 71576b9ca53..751477ec2fd 100644 --- a/sys/arch/sgi/dev/mkbc.c +++ b/sys/arch/sgi/dev/mkbc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mkbc.c,v 1.11 2011/04/07 15:30:16 miod Exp $ */ +/* $OpenBSD: mkbc.c,v 1.12 2012/08/10 17:49:31 shadchin Exp $ */ /* * Copyright (c) 2006, 2007, Joel Sing @@ -659,10 +659,10 @@ restart: */ int -pckbc_xt_translation(pckbc_tag_t self, pckbc_slot_t slot, int on) +pckbc_xt_translation(pckbc_tag_t self) { /* Translation isn't supported... */ - return 0; + return (-1); } /* For use in autoconfiguration. */ diff --git a/sys/dev/ic/pckbc.c b/sys/dev/ic/pckbc.c index 5f388e42b01..49d01d6b4b1 100644 --- a/sys/dev/ic/pckbc.c +++ b/sys/dev/ic/pckbc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pckbc.c,v 1.29 2012/02/02 21:40:20 deraadt Exp $ */ +/* $OpenBSD: pckbc.c,v 1.30 2012/08/10 17:49:31 shadchin Exp $ */ /* $NetBSD: pckbc.c,v 1.5 2000/06/09 04:58:35 soda Exp $ */ /* @@ -482,40 +482,28 @@ pckbc_poll_data(pckbc_tag_t self, pckbc_slot_t slot) } /* - * switch scancode translation on / off - * return nonzero on success + * set scancode translation on */ int -pckbc_xt_translation(pckbc_tag_t self, pckbc_slot_t slot, int on) +pckbc_xt_translation(pckbc_tag_t self) { struct pckbc_internal *t = self; - int ison; - if (ISSET(t->t_flags, PCKBC_CANT_TRANSLATE) || - slot != PCKBC_KBD_SLOT) { - /* translation only for kbd slot */ - if (on) - return (0); - else - return (1); - } + if (ISSET(t->t_flags, PCKBC_CANT_TRANSLATE)) + return (-1); - ison = t->t_cmdbyte & KC8_TRANS; - if ((on && ison) || (!on && !ison)) - return (1); + if (t->t_cmdbyte & KC8_TRANS) + return (0); - t->t_cmdbyte ^= KC8_TRANS; + t->t_cmdbyte |= KC8_TRANS; if (!pckbc_put8042cmd(t)) - return (0); + return (-1); /* read back to be sure */ if (!pckbc_get8042cmd(t)) - return (0); + return (-1); - ison = t->t_cmdbyte & KC8_TRANS; - if ((on && ison) || (!on && !ison)) - return (1); - return (0); + return (t->t_cmdbyte & KC8_TRANS) ? (0) : (-1); } static struct pckbc_portcmd { diff --git a/sys/dev/ic/pckbcvar.h b/sys/dev/ic/pckbcvar.h index 612e1432edf..cfb06718875 100644 --- a/sys/dev/ic/pckbcvar.h +++ b/sys/dev/ic/pckbcvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pckbcvar.h,v 1.11 2012/02/02 21:40:20 deraadt Exp $ */ +/* $OpenBSD: pckbcvar.h,v 1.12 2012/08/10 17:49:31 shadchin Exp $ */ /* $NetBSD: pckbcvar.h,v 1.4 2000/06/09 04:58:35 soda Exp $ */ /* @@ -102,7 +102,7 @@ int pckbc_poll_data(pckbc_tag_t, pckbc_slot_t); int pckbc_poll_data1(bus_space_tag_t, bus_space_handle_t, bus_space_handle_t, pckbc_slot_t, int); void pckbc_set_poll(pckbc_tag_t, pckbc_slot_t, int); -int pckbc_xt_translation(pckbc_tag_t, pckbc_slot_t, int); +int pckbc_xt_translation(pckbc_tag_t); void pckbc_slot_enable(pckbc_tag_t, pckbc_slot_t, int); void pckbc_attach(struct pckbc_softc *, int); diff --git a/sys/dev/pckbc/pckbd.c b/sys/dev/pckbc/pckbd.c index 44a1cb0cb91..bf9370d324d 100644 --- a/sys/dev/pckbc/pckbd.c +++ b/sys/dev/pckbc/pckbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pckbd.c,v 1.31 2011/03/17 15:42:05 shadchin Exp $ */ +/* $OpenBSD: pckbd.c,v 1.32 2012/08/10 17:49:31 shadchin Exp $ */ /* $NetBSD: pckbd.c,v 1.24 2000/06/05 22:20:57 sommerfeld Exp $ */ /*- @@ -189,10 +189,7 @@ pckbd_set_xtscancode(pckbc_tag_t kbctag, pckbc_slot_t kbcslot, /* default to have the 8042 translate the keyboard with table 3. */ int table = 3; - if (pckbc_xt_translation(kbctag, kbcslot, 1)) { - if (id != NULL) - id->t_translating = 1; - } else { + if (pckbc_xt_translation(kbctag)) { #ifdef DEBUG printf("pckbd: enabling of translation failed\n"); #endif @@ -208,6 +205,9 @@ pckbd_set_xtscancode(pckbc_tag_t kbctag, pckbc_slot_t kbcslot, table = 2; if (id != NULL) id->t_translating = 0; + } else { + if (id != NULL) + id->t_translating = 1; } /* keep falling back until we hit a table that looks usable. */ |