]> git.hungrycats.org Git - linux/commitdiff
The following patch adds the "resend" capability to the keyboard driver;
authorVojtech Pavlik <vojtech@twilight.ucw.cz>
Thu, 25 Jul 2002 01:14:48 +0000 (03:14 +0200)
committerVojtech Pavlik <vojtech@twilight.ucw.cz>
Thu, 25 Jul 2002 01:14:48 +0000 (03:14 +0200)
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

drivers/input/keyboard/atkbd.c
drivers/input/serio/serio.c
include/linux/serio.h

index 998edbf7ff7f972e4b8a1a7ba510b8e3475edd00..c64b1934dc7a22fa5851c2ffb86875a491c807ff 100644 (file)
@@ -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;
index 415adb66556808b5f2536fea34f019f53042cf40..b6e6c0f7138495bdeecdec9f7b14e332edc3caa4 100644 (file)
@@ -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);
index 37deb0ca7836dda82f525fb4a24cae6c984f9a66..ce0359b25fb7726852f345b9787b684b42065393 100644 (file)
@@ -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