diff options
| author | Kazutaka YOKOTA <yokota@FreeBSD.org> | 2000-02-11 01:22:30 +0000 |
|---|---|---|
| committer | Kazutaka YOKOTA <yokota@FreeBSD.org> | 2000-02-11 01:22:30 +0000 |
| commit | aec1fa1ca35a4ee67d1abeee35c095e7c769ed03 (patch) | |
| tree | 83ea79b1977662cf32b9b6b0be79197522f02360 /sys | |
| parent | 40de16e3c317b50a89f7cc097516ed622455e773 (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/dev/atkbdc/atkbd.c | 13 | ||||
| -rw-r--r-- | sys/dev/kbd/atkbd.c | 13 |
2 files changed, 18 insertions, 8 deletions
diff --git a/sys/dev/atkbdc/atkbd.c b/sys/dev/atkbdc/atkbd.c index 5a72ecbe310d1..2dc98779e5aec 100644 --- a/sys/dev/atkbdc/atkbd.c +++ b/sys/dev/atkbdc/atkbd.c @@ -1081,8 +1081,11 @@ probe_keyboard(KBDC kbdc, int flags) return ENXIO; } + /* temporarily block data transmission from the keyboard */ + write_controller_command(kbdc, KBDC_DISABLE_KBD_PORT); + /* flush any noise in the buffer */ - empty_both_buffers(kbdc, 10); + empty_both_buffers(kbdc, 100); /* save the current keyboard controller command byte */ m = kbdc_get_device_mask(kbdc) & ~KBD_KBD_CONTROL_BITS; @@ -1108,9 +1111,8 @@ probe_keyboard(KBDC kbdc, int flags) if (err == 0) { kbdc_set_device_mask(kbdc, m | KBD_KBD_CONTROL_BITS); } else { - if (c != -1) - /* try to restore the command byte as before */ - set_controller_command_byte(kbdc, 0xff, c); + /* try to restore the command byte as before */ + set_controller_command_byte(kbdc, 0xff, c); kbdc_set_device_mask(kbdc, m); } @@ -1130,6 +1132,9 @@ init_keyboard(KBDC kbdc, int *type, int flags) return EIO; } + /* temporarily block data transmission from the keyboard */ + write_controller_command(kbdc, KBDC_DISABLE_KBD_PORT); + /* save the current controller command byte */ empty_both_buffers(kbdc, 200); c = get_controller_command_byte(kbdc); diff --git a/sys/dev/kbd/atkbd.c b/sys/dev/kbd/atkbd.c index 5a72ecbe310d1..2dc98779e5aec 100644 --- a/sys/dev/kbd/atkbd.c +++ b/sys/dev/kbd/atkbd.c @@ -1081,8 +1081,11 @@ probe_keyboard(KBDC kbdc, int flags) return ENXIO; } + /* temporarily block data transmission from the keyboard */ + write_controller_command(kbdc, KBDC_DISABLE_KBD_PORT); + /* flush any noise in the buffer */ - empty_both_buffers(kbdc, 10); + empty_both_buffers(kbdc, 100); /* save the current keyboard controller command byte */ m = kbdc_get_device_mask(kbdc) & ~KBD_KBD_CONTROL_BITS; @@ -1108,9 +1111,8 @@ probe_keyboard(KBDC kbdc, int flags) if (err == 0) { kbdc_set_device_mask(kbdc, m | KBD_KBD_CONTROL_BITS); } else { - if (c != -1) - /* try to restore the command byte as before */ - set_controller_command_byte(kbdc, 0xff, c); + /* try to restore the command byte as before */ + set_controller_command_byte(kbdc, 0xff, c); kbdc_set_device_mask(kbdc, m); } @@ -1130,6 +1132,9 @@ init_keyboard(KBDC kbdc, int *type, int flags) return EIO; } + /* temporarily block data transmission from the keyboard */ + write_controller_command(kbdc, KBDC_DISABLE_KBD_PORT); + /* save the current controller command byte */ empty_both_buffers(kbdc, 200); c = get_controller_command_byte(kbdc); |
