aboutsummaryrefslogtreecommitdiff
path: root/sys/i386
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1998-07-03 14:34:28 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1998-07-03 14:34:28 +0000
commit24fa2d131ebc8cbac46c3707f5b0d494c6f64b9e (patch)
tree7fb36cd4f4c102f16a7763b6c22ad26df8415d3d /sys/i386
parenta23bbb9036fd9f71799cd8cbe40ca06f5cc4c45e (diff)
downloadsrc-24fa2d131ebc8cbac46c3707f5b0d494c6f64b9e.tar.gz
src-24fa2d131ebc8cbac46c3707f5b0d494c6f64b9e.zip
Check for missing keyboard.
PR: 7108 Submitted by: Hellmuth Michaelis <hm@hcs.de>
Notes
Notes: svn path=/head/; revision=37356
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/isa/pcvt/pcvt_drv.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/sys/i386/isa/pcvt/pcvt_drv.c b/sys/i386/isa/pcvt/pcvt_drv.c
index ff6566a8c76f..5faca4819dd6 100644
--- a/sys/i386/isa/pcvt/pcvt_drv.c
+++ b/sys/i386/isa/pcvt/pcvt_drv.c
@@ -153,6 +153,13 @@ pcprobe(struct isa_device *dev)
{
#ifdef _I386_ISA_KBDIO_H_
kbdc = kbdc_open(IO_KBD);
+
+ if(kbdc == NULL)
+ {
+ reset_keyboard = 0;
+ return 1;
+ }
+
reset_keyboard = 1; /* it's now safe to do kbd reset */
#endif /* _I386_ISA_KBDIO_H_ */
@@ -852,6 +859,25 @@ pcrint(int unit)
u_char *cp;
#endif /* PCVT_KBD_FIFO */
+ /*
+ * in case the keyboard was not plugged in while booting, kbdc
+ * was set to NULL at that time. When a keyboard IRQ occurs and
+ * kbdc is NULL, the keyboard was probably reconnected to the
+ * keyboard controller and we have to initialize the keyboard.
+ */
+
+ if(kbdc == NULL)
+ {
+ kbdc = kbdc_open(IO_KBD);
+ if(kbdc == NULL)
+ {
+ reset_keyboard = 0;
+ return;
+ }
+ reset_keyboard = 1;
+ kbd_code_init();
+ }
+
#if PCVT_SCREENSAVER
pcvt_scrnsv_reset();
#endif /* PCVT_SCREENSAVER */