dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0443-grub-core-term-at_keyboard.c-Retry-probing-keyboard-.patch

110f85
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
110f85
From: Vladimir Serbinenko <phcoder@gmail.com>
110f85
Date: Wed, 13 Aug 2014 23:04:01 +0200
110f85
Subject: [PATCH] 	* grub-core/term/at_keyboard.c: Retry probing keyboard
110f85
 if 	scancode setup failed.
110f85
110f85
---
110f85
 grub-core/term/at_keyboard.c | 11 +++++------
110f85
 ChangeLog                    |  5 +++++
110f85
 2 files changed, 10 insertions(+), 6 deletions(-)
110f85
110f85
diff --git a/grub-core/term/at_keyboard.c b/grub-core/term/at_keyboard.c
110f85
index b4257e84a04..c234e92f246 100644
110f85
--- a/grub-core/term/at_keyboard.c
110f85
+++ b/grub-core/term/at_keyboard.c
110f85
@@ -226,7 +226,7 @@ static const struct
110f85
     {0x7d, GRUB_KEYBOARD_KEY_PPAGE},
110f85
   };
110f85
 
110f85
-static int alive = 0, ping_sent;
110f85
+static int ping_sent;
110f85
 
110f85
 static void
110f85
 keyboard_controller_wait_until_ready (void)
110f85
@@ -373,7 +373,7 @@ set_scancodes (void)
110f85
   grub_dprintf ("atkeyb", "returned set %d\n", current_set);
110f85
   if (current_set == 1)
110f85
     return;
110f85
-  grub_printf ("No supported scancode set found\n");
110f85
+  grub_dprintf ("atkeyb", "no supported scancode set found\n");
110f85
 #endif
110f85
 }
110f85
 
110f85
@@ -543,7 +543,7 @@ grub_keyboard_getkey (void)
110f85
 int
110f85
 grub_at_keyboard_is_alive (void)
110f85
 {
110f85
-  if (alive)
110f85
+  if (current_set != 0)
110f85
     return 1;
110f85
   if (ping_sent
110f85
       && KEYBOARD_COMMAND_ISREADY (grub_inb (KEYBOARD_REG_STATUS))
110f85
@@ -611,7 +611,6 @@ static void
110f85
 grub_keyboard_controller_init (void)
110f85
 {
110f85
   at_keyboard_status = 0;
110f85
-  alive = 1;
110f85
   /* Drain input buffer. */
110f85
   while (1)
110f85
     {
110f85
@@ -639,7 +638,7 @@ grub_keyboard_controller_init (void)
110f85
 static grub_err_t
110f85
 grub_keyboard_controller_fini (struct grub_term_input *term __attribute__ ((unused)))
110f85
 {
110f85
-  if (!alive)
110f85
+  if (current_set == 0)
110f85
     return GRUB_ERR_NONE;
110f85
   if (grub_keyboard_orig_set)
110f85
     write_mode (grub_keyboard_orig_set);
110f85
@@ -656,7 +655,7 @@ grub_at_fini_hw (int noreturn __attribute__ ((unused)))
110f85
 static grub_err_t
110f85
 grub_at_restore_hw (void)
110f85
 {
110f85
-  if (!alive)
110f85
+  if (current_set == 0)
110f85
     return GRUB_ERR_NONE;
110f85
 
110f85
   /* Drain input buffer. */
110f85
diff --git a/ChangeLog b/ChangeLog
110f85
index d3f26cf2f0d..f3afd5cad8d 100644
110f85
--- a/ChangeLog
110f85
+++ b/ChangeLog
110f85
@@ -2,6 +2,11 @@
110f85
 	* grub-core/kern/emu/hostfs.c: use _DEFAULT_SOURCE in addition to
110f85
 	_BSD_SOURCE to avoid warnings under glibc 2.20+.
110f85
 
110f85
+2014-08-13  Vladimir Serbinenko  <phcoder@gmail.com>
110f85
+
110f85
+	* grub-core/term/at_keyboard.c: Retry probing keyboard if
110f85
+	scancode setup failed.
110f85
+
110f85
 2014-06-21  Роман Пехов <roman_pekhov>
110f85
 
110f85
 	* grub-core/commands/loadenv.c (check_blocklists): Fix overlap check.