diff options
| author | Kazutaka YOKOTA <yokota@FreeBSD.org> | 1997-06-29 15:11:40 +0000 |
|---|---|---|
| committer | Kazutaka YOKOTA <yokota@FreeBSD.org> | 1997-06-29 15:11:40 +0000 |
| commit | a2fc20d086d6e4ac7c54675d7cc5f9114483f974 (patch) | |
| tree | 9a9e4bac6ce3b0aa74cb1d4eae334e6badf909f7 /sys/dev/syscons/syscons.c | |
| parent | 76c5241d634b9691a2f84e8a7f42d474c493eee7 (diff) | |
Notes
Diffstat (limited to 'sys/dev/syscons/syscons.c')
| -rw-r--r-- | sys/dev/syscons/syscons.c | 56 |
1 files changed, 35 insertions, 21 deletions
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index 5df41907a37a..573d404e2546 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: syscons.c,v 1.216 1997/05/15 05:43:57 yokota Exp $ + * $Id: syscons.c,v 1.217 1997/06/22 12:04:36 yokota Exp $ */ #include "sc.h" @@ -491,26 +491,40 @@ sckbdprobe(int unit, int flags) printf("sc%d: keyboard scancode set %d\n", unit, codeset); #endif /* DETECT_XT_KEYBOARD */ - /* reset keyboard hardware */ - if (!reset_kbd(sc_kbdc)) { - /* KEYBOARD ERROR - * Keyboard reset may fail either because the keyboard doen't exist, - * or because the keyboard doesn't pass the self-test, or the keyboard - * controller on the motherboard and the keyboard somehow fail to - * shake hands. It is just possible, particularly in the last case, - * that the keyoard controller may be left in a hung state. - * test_controller() and test_kbd_port() appear to bring the keyboard - * controller back (I don't know why and how, though.) - */ - empty_both_buffers(sc_kbdc, 10); - test_controller(sc_kbdc); - test_kbd_port(sc_kbdc); - /* We could disable the keyboard port and interrupt... but, - * the keyboard may still exist (see above). - */ - if (bootverbose) - printf("sc%d: failed to reset the keyboard.\n", unit); - goto fail; + if (dev->id_flags & KBD_NORESET) { + write_kbd_command(sc_kbdc, KBDC_ECHO); + if (read_kbd_data(sc_kbdc) != KBD_ECHO) { + empty_both_buffers(sc_kbdc, 10); + test_controller(sc_kbdc); + test_kbd_port(sc_kbdc); + if (bootverbose) + printf("sc%d: failed to get response from the keyboard.\n", + unit); + goto fail; + } + } else { + /* reset keyboard hardware */ + if (!reset_kbd(sc_kbdc)) { + /* KEYBOARD ERROR + * Keyboard reset may fail either because the keyboard doen't + * exist, or because the keyboard doesn't pass the self-test, + * or the keyboard controller on the motherboard and the keyboard + * somehow fail to shake hands. It is just possible, particularly + * in the last case, that the keyoard controller may be left + * in a hung state. test_controller() and test_kbd_port() appear + * to bring the keyboard controller back (I don't know why and + * how, though.) + */ + empty_both_buffers(sc_kbdc, 10); + test_controller(sc_kbdc); + test_kbd_port(sc_kbdc); + /* We could disable the keyboard port and interrupt... but, + * the keyboard may still exist (see above). + */ + if (bootverbose) + printf("sc%d: failed to reset the keyboard.\n", unit); + goto fail; + } } /* |
