See Patch
On Mon, Sep 01, 2008 at 05:53:54PM +0200, Stefan Reinauer wrote:
fix keyboard driver bugs.
Jordan is probably better-suited to review this, but can you elaborate a bit more in the commit message? What bug, what's wrong, what effects does the bug have, how is it fixed, etc?
Signed-off-by: Stefan Reinauer stepan@coresystems.de
Index: libpayload/drivers/keyboard.c
--- libpayload/drivers/keyboard.c (revision 3556) +++ libpayload/drivers/keyboard.c (working copy) @@ -79,7 +79,7 @@
int keyboard_getchar(void) {
- static int modifier;
- static int modifier = 0; unsigned char ch; int shift; int ret = 0;
@@ -91,17 +91,17 @@ switch (ch) { case 0x36: case 0x2a:
modifier &= ~MOD_SHIFT;
break; case 0x80 | 0x36: case 0x80 | 0x2a:modifier |= MOD_SHIFT;
modifier |= MOD_SHIFT;
break; case 0x1d:modifier &= ~MOD_SHIFT;
modifier &= ~MOD_CTRL;
break; case 0x80 | 0x1d:modifier |= MOD_CTRL;
modifier |= MOD_CTRL;
break; case 0x3a: if (modifier & MOD_CAPSLOCK)modifier &= ~MOD_CTRL;
Uwe.
Uwe Hermann schrieb:
On Mon, Sep 01, 2008 at 05:53:54PM +0200, Stefan Reinauer wrote:
fix keyboard driver bugs.
Jordan is probably better-suited to review this, but can you elaborate a bit more in the commit message? What bug, what's wrong, what effects does the bug have, how is it fixed, etc?
The |0x80 codes are "break codes", that means, codes that are emitted when the key transitions from pressed to non-pressed, so the modifier was always in the wrong state, as soon as you pressed shift for the first time.
I have no idea why that didn't occur to me when I looked at it earlier today :-/
Acked-by: Patrick Georgi patrick.georgi@coresystems.de
Signed-off-by: Stefan Reinauer stepan@coresystems.de
Index: libpayload/drivers/keyboard.c
--- libpayload/drivers/keyboard.c (revision 3556) +++ libpayload/drivers/keyboard.c (working copy) @@ -79,7 +79,7 @@
int keyboard_getchar(void) {
- static int modifier;
- static int modifier = 0; unsigned char ch; int shift; int ret = 0;
@@ -91,17 +91,17 @@ switch (ch) { case 0x36: case 0x2a:
modifier &= ~MOD_SHIFT;
break; case 0x80 | 0x36: case 0x80 | 0x2a:modifier |= MOD_SHIFT;
modifier |= MOD_SHIFT;
break; case 0x1d:modifier &= ~MOD_SHIFT;
modifier &= ~MOD_CTRL;
break; case 0x80 | 0x1d:modifier |= MOD_CTRL;
modifier |= MOD_CTRL;
break; case 0x3a: if (modifier & MOD_CAPSLOCK)modifier &= ~MOD_CTRL;
On 01/09/08 21:29 +0200, Patrick Georgi wrote:
Uwe Hermann schrieb:
On Mon, Sep 01, 2008 at 05:53:54PM +0200, Stefan Reinauer wrote:
fix keyboard driver bugs.
Jordan is probably better-suited to review this, but can you elaborate a bit more in the commit message? What bug, what's wrong, what effects does the bug have, how is it fixed, etc?
The |0x80 codes are "break codes", that means, codes that are emitted when the key transitions from pressed to non-pressed, so the modifier was always in the wrong state, as soon as you pressed shift for the first time.
I have no idea why that didn't occur to me when I looked at it earlier today :-/
Acked-by: Patrick Georgi patrick.georgi@coresystems.de
Thats right - I hosed up that state machine and never noticed it because we have never had any payloads that used special keys to any degree.
Also acked by me.
Jordan