Commit db82e821 authored by Vojtech Pavlik's avatar Vojtech Pavlik

The following patch adds the "resend" capability to the keyboard driver;

when the host driver detects a parity or framing error, we can ask the
keyboard to resend the data, instead of treating random garbage as
valid data.
We also export serio_interrupt() - serio modules are using it, yet you
can't use them as modules without this symbol exported.
  -- Russell King
parent 7306c5f4
......@@ -98,6 +98,7 @@ static unsigned char atkbd_set3_keycode[512] = {
#define ATKBD_CMD_ENABLE 0x00f4
#define ATKBD_CMD_RESET_DIS 0x00f5
#define ATKBD_CMD_SETALL_MB 0x00f8
#define ATKBD_CMD_RESEND 0x00fe
#define ATKBD_CMD_EX_ENABLE 0x10ea
#define ATKBD_CMD_EX_SETLEDS 0x20eb
......@@ -141,9 +142,16 @@ static void atkbd_interrupt(struct serio *serio, unsigned char data, unsigned in
int code = data;
#ifdef ATKBD_DEBUG
printk(KERN_DEBUG "atkbd.c: Received %02x\n", data);
printk(KERN_DEBUG "atkbd.c: Received %02x flags %02x\n", data, flags);
#endif
/* Interface error. Request that the keyboard resend. */
if (flags & (SERIO_FRAME | SERIO_PARITY)) {
printk("atkbd.c: frame/parity error: %02x\n", flags);
serio_write(serio, ATKBD_CMD_RESEND);
return;
}
switch (code) {
case ATKBD_RET_ACK:
atkbd->ack = 1;
......
......@@ -42,6 +42,7 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("Serio abstraction core");
MODULE_LICENSE("GPL");
EXPORT_SYMBOL(serio_interrupt);
EXPORT_SYMBOL(serio_register_port);
EXPORT_SYMBOL(serio_unregister_port);
EXPORT_SYMBOL(serio_register_device);
......
......@@ -94,8 +94,12 @@ static __inline__ void serio_dev_write_wakeup(struct serio *serio)
serio->dev->write_wakeup(serio);
}
/*
* bit masks for use in "interrupt" flags (3rd argument)
*/
#define SERIO_TIMEOUT 1
#define SERIO_PARITY 2
#define SERIO_FRAME 4
#define SERIO_TYPE 0xff000000UL
#define SERIO_XT 0x00000000UL
......
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