summaryrefslogtreecommitdiff
path: root/sys/arch/i386/isa/pcvt
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/i386/isa/pcvt')
-rw-r--r--sys/arch/i386/isa/pcvt/pcvt_hdr.h4
-rw-r--r--sys/arch/i386/isa/pcvt/pcvt_kbd.c28
2 files changed, 30 insertions, 2 deletions
diff --git a/sys/arch/i386/isa/pcvt/pcvt_hdr.h b/sys/arch/i386/isa/pcvt/pcvt_hdr.h
index 0f616c3c04d..005318131c3 100644
--- a/sys/arch/i386/isa/pcvt/pcvt_hdr.h
+++ b/sys/arch/i386/isa/pcvt/pcvt_hdr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcvt_hdr.h,v 1.16 1997/11/06 02:26:47 deraadt Exp $ */
+/* $OpenBSD: pcvt_hdr.h,v 1.17 1998/01/11 06:15:34 deraadt Exp $ */
/*
* Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
@@ -258,6 +258,7 @@ in the config file"
#define KEYB_C_RESEND 0xfe /* resend last byte in case of error */
#define KEYB_C_TYPEM 0xf3 /* set keyboard typematic rate/delay */
#define KEYB_C_ID 0xf2 /* return keyboard id */
+#define KEYB_C_SCANSET 0xf0 /* get/set keyboard scancode set */
#define KEYB_C_ECHO 0xee /* diagnostic, echo 0xee */
#define KEYB_C_LEDS 0xed /* set/reset numlock,capslock & scroll lock */
@@ -280,6 +281,7 @@ in the config file"
#define KEYB_R_MF2ID2 0x41 /* MF II Keyboard id-byte #2 */
#define KEYB_R_MF2ID2HP 0x83 /* MF II Keyboard id-byte #2 from HP keybd's */
#define KEYB_R_MF2ID2TP 0x54 /* MF II Keyboard id-byte #2 from IBM ThinkPad */
+#define KEYB_R_MF2ID2TP2 0x84 /* MF II Keyboard id-byte #2 from IBM ThinkPad (340M) */
/* internal Keyboard Type */
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",