diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-01-11 06:15:36 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-01-11 06:15:36 +0000 |
commit | 81f9b01b83346611e392a3e04e12817a625abd07 (patch) | |
tree | 184ed2c70ea5f2091b62dc136e57d748dc743852 /sys/arch/i386/isa/pcvt/pcvt_kbd.c | |
parent | 84b2450dac15edff5df46e927ba0034a60519f63 (diff) |
scanset probing like pccons does; vons@usa.net
Diffstat (limited to 'sys/arch/i386/isa/pcvt/pcvt_kbd.c')
-rw-r--r-- | sys/arch/i386/isa/pcvt/pcvt_kbd.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/sys/arch/i386/isa/pcvt/pcvt_kbd.c b/sys/arch/i386/isa/pcvt/pcvt_kbd.c index 0a067f69ace..fe955ed9067 100644 --- a/sys/arch/i386/isa/pcvt/pcvt_kbd.c +++ b/sys/arch/i386/isa/pcvt/pcvt_kbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcvt_kbd.c,v 1.11 1997/07/25 22:52:43 weingart Exp $ */ +/* $OpenBSD: pcvt_kbd.c,v 1.12 1998/01/11 06:15:35 deraadt Exp $ */ /* * Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch. @@ -492,6 +492,28 @@ void doreset(void) wait_retries++; } +#if PCVT_SCANSET == 1 + /* + * Pcvt has been compiled for scanset 1, which requires that + * the mainboard controller translates. If it is not able to, + * try to set the keyboard to XT mode so that pcvt will see AT + * scan codes after all. If it fails, we're out of luck. + */ + kbc_8042cmd(CONTR_READ); + response = kbd_response(); + + if (!(response & COMMAND_PCSCAN)) + { + if (kbd_cmd(KEYB_C_SCANSET) != 0) + printf("pcvt: doreset() - keyboard SCANSET command timeout\n"); + else if (kbd_cmd(1) != 0) + printf("pcvt: doreset() - keyboard SCANSET data timeout\n"); + else + printf("pcvt: doreset() - keyboard set to XT mode\n"); + } +#endif + + splx(opri); #if PCVT_KEYBDID @@ -533,6 +555,10 @@ r_entry: { keyboard_type = KB_MFII; } + else if(response == KEYB_R_MF2ID2TP2) + { + keyboard_type = KB_MFII; + } else { printf("\npcvt: doreset() - kbdid, response 2 = [%d]\n", |