Commit d6e0320f authored by Andries E. Brouwer's avatar Andries E. Brouwer Committed by Linus Torvalds

[PATCH] atkbd: 0xfa is ACK

The 0xfa code can be a key scancode or it can be a protocol scancode.

Only few keyboards use it as a key scancode, and if we always interpret
it as a protocol scancode then these rare keyboards will have a dead
key.  If we interpret it as a key scancode then we have a dead keyboard
in case it was protocol.

Clearly it is safer to prefer to interpret it as a protocol scancode.

This moves the test for ACK and NAK up, so that they are always seen as
protocol.

This is just a minimal patch.  What I did in 1.1.54 was to keep track of
commands sent with a flag reply_expected, so that 0xfa could be taken as
ACK when a reply is expected and as key scancode otherwise.  That is the
better solution, but requires larger surgery.
parent 018c8581
......@@ -184,11 +184,19 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
atkbd->resend = 0;
#endif
switch (code) {
case ATKBD_RET_ACK:
atkbd->ack = 1;
goto out;
case ATKBD_RET_NAK:
atkbd->ack = -1;
goto out;
}
if (atkbd->translated) do {
if (atkbd->emul != 1) {
if (code == ATKBD_RET_EMUL0 || code == ATKBD_RET_EMUL1 ||
code == ATKBD_RET_ACK || code == ATKBD_RET_NAK)
if (code == ATKBD_RET_EMUL0 || code == ATKBD_RET_EMUL1)
break;
if (code == ATKBD_RET_BAT) {
if (!atkbd->bat_xl)
......@@ -212,15 +220,6 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
} while (0);
switch (code) {
case ATKBD_RET_ACK:
atkbd->ack = 1;
goto out;
case ATKBD_RET_NAK:
atkbd->ack = -1;
goto out;
}
if (atkbd->cmdcnt) {
atkbd->cmdbuf[--atkbd->cmdcnt] = code;
goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment