diff options
author | jkh <jkh@FreeBSD.org> | 1998-07-03 14:34:28 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1998-07-03 14:34:28 +0000 |
commit | a13582e5d0cde31cd940b3fe2ee2f3af3f33f570 (patch) | |
tree | c9bf3e4ed19c94d21ad0e0d6cfd84c720c130721 /sys | |
parent | d5c31bd690829207e6081cd5a99582deae9ae00e (diff) | |
download | FreeBSD-src-a13582e5d0cde31cd940b3fe2ee2f3af3f33f570.zip FreeBSD-src-a13582e5d0cde31cd940b3fe2ee2f3af3f33f570.tar.gz |
Check for missing keyboard.
PR: 7108
Submitted by: Hellmuth Michaelis <hm@hcs.de>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/i386/isa/pcvt/pcvt_drv.c | 26 |
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 ff6566a..5faca48 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 */ |