]> git.neil.brown.name Git - history.git/commitdiff
input: Get rid of the kbd_pt_regs variable, and instead pass the
authorVojtech Pavlik <vojtech@suse.cz>
Wed, 12 Feb 2003 11:41:07 +0000 (12:41 +0100)
committerVojtech Pavlik <vojtech@suse.cz>
Wed, 12 Feb 2003 11:41:07 +0000 (12:41 +0100)
value all the way from an interrupt handler to keyboard.c
that can display it.

57 files changed:
arch/sparc64/kernel/irq.c
drivers/acorn/char/keyb_arc.c
drivers/char/ec3104_keyb.c
drivers/char/keyboard.c
drivers/input/joystick/amijoy.c
drivers/input/joystick/iforce/iforce-packets.c
drivers/input/joystick/iforce/iforce-serio.c
drivers/input/joystick/iforce/iforce-usb.c
drivers/input/joystick/iforce/iforce.h
drivers/input/joystick/magellan.c
drivers/input/joystick/spaceball.c
drivers/input/joystick/spaceorb.c
drivers/input/joystick/stinger.c
drivers/input/joystick/twidjoy.c
drivers/input/joystick/warrior.c
drivers/input/keyboard/amikbd.c
drivers/input/keyboard/atkbd.c
drivers/input/keyboard/newtonkbd.c
drivers/input/keyboard/sunkbd.c
drivers/input/keyboard/xtkbd.c
drivers/input/misc/gsc_ps2.c
drivers/input/mouse/amimouse.c
drivers/input/mouse/inport.c
drivers/input/mouse/logibm.c
drivers/input/mouse/pc110pad.c
drivers/input/mouse/psmouse.c
drivers/input/mouse/rpcmouse.c
drivers/input/mouse/sermouse.c
drivers/input/serio/ambakmi.c
drivers/input/serio/ct82c710.c
drivers/input/serio/i8042.c
drivers/input/serio/parkbd.c
drivers/input/serio/q40kbd.c
drivers/input/serio/rpckbd.c
drivers/input/serio/sa1111ps2.c
drivers/input/serio/serio.c
drivers/input/serio/serport.c
drivers/input/touchscreen/gunze.c
drivers/input/touchscreen/h3600_ts_input.c
drivers/macintosh/adbhid.c
drivers/serial/sunsu.c
drivers/serial/sunzilog.c
drivers/usb/input/aiptek.c
drivers/usb/input/hid-core.c
drivers/usb/input/hid-input.c
drivers/usb/input/hid.h
drivers/usb/input/hiddev.c
drivers/usb/input/powermate.c
drivers/usb/input/usbkbd.c
drivers/usb/input/usbmouse.c
drivers/usb/input/wacom.c
drivers/usb/input/xpad.c
include/asm-sparc/system.h
include/asm-sparc64/system.h
include/linux/hiddev.h
include/linux/input.h
include/linux/serio.h

index fb3512af435e8cb2a430cb67f0e63433375ae0fd..5fb8f5c18080b1f6d754730727179406f70c4c54 100644 (file)
@@ -740,9 +740,6 @@ void handler_irq(int irq, struct pt_regs *regs)
        irq_enter();
        kstat_cpu(cpu).irqs[irq]++;
 
-       if (irq == 9)
-               kbd_pt_regs = regs;
-
        /* Sliiiick... */
 #ifndef CONFIG_SMP
        bp = ((irq != 0) ?
index 86eca00127940d5e82d6bf2f65c28e798cb9c004..783e73fedb87a69fb1f2b861427887eaaa5a2db4 100644 (file)
@@ -406,7 +406,6 @@ kbd_error:
 
 static void a5kkbd_rx(int irq, void *dev_id, struct pt_regs *regs)
 {
-       kbd_pt_regs = regs;
        if (handle_rawcode(ioc_readb(IOC_KARTRX)))
                tasklet_schedule(&keyboard_tasklet);
 }
index 7bf15e1bdc668c2c2d86f0f66b765f17d7fdac28..933282df55b44ad2580dd130aabe8377c884e944 100644 (file)
@@ -376,8 +376,6 @@ static void ec3104_keyb_interrupt(int irq, void *data, struct pt_regs *regs)
        struct e5_struct *k = &ec3104_keyb;
        u8 msr, lsr;
 
-       kbd_pt_regs = regs;
-
        msr = ctrl_inb(EC3104_SER4_MSR);
        
        if ((msr & MSR_CTS) && !(k->last_msr & MSR_CTS)) {
index aec9a2b74a288a1cc7cb15e263e3b6f23b4ac854..e388f305f524a77ca6690c8ebca6d87596074c39 100644 (file)
@@ -64,8 +64,6 @@ extern void ctrl_alt_del(void);
 #define KBD_DEFLOCK 0
 #endif
 
-struct pt_regs *kbd_pt_regs;
-EXPORT_SYMBOL(kbd_pt_regs);
 void compute_shiftstate(void);
 
 /*
@@ -79,7 +77,7 @@ void compute_shiftstate(void);
        k_slock,        k_dead2,        k_ignore,       k_ignore
 
 typedef void (k_handler_fn)(struct vc_data *vc, unsigned char value, 
-                           char up_flag);
+                           char up_flag, struct pt_regs *regs);
 static k_handler_fn K_HANDLERS;
 static k_handler_fn *k_handler[16] = { K_HANDLERS };
 
@@ -90,7 +88,7 @@ static k_handler_fn *k_handler[16] = { K_HANDLERS };
        fn_boot_it,     fn_caps_on,     fn_compose,     fn_SAK,\
        fn_dec_console, fn_inc_console, fn_spawn_con,   fn_bare_num
 
-typedef void (fn_handler_fn)(struct vc_data *vc);
+typedef void (fn_handler_fn)(struct vc_data *vc, struct pt_regs *regs);
 static fn_handler_fn FN_HANDLERS;
 static fn_handler_fn *fn_handler[] = { FN_HANDLERS };
 
@@ -422,7 +420,7 @@ unsigned char handle_diacr(struct vc_data *vc, unsigned char ch)
 /*
  * Special function handlers
  */
-static void fn_enter(struct vc_data *vc)
+static void fn_enter(struct vc_data *vc, struct pt_regs *regs)
 {
        if (diacr) {
                put_queue(vc, diacr);
@@ -433,27 +431,27 @@ static void fn_enter(struct vc_data *vc)
                put_queue(vc, 10);
 }
 
-static void fn_caps_toggle(struct vc_data *vc)
+static void fn_caps_toggle(struct vc_data *vc, struct pt_regs *regs)
 {
        if (rep)
                return;
        chg_vc_kbd_led(kbd, VC_CAPSLOCK);
 }
 
-static void fn_caps_on(struct vc_data *vc)
+static void fn_caps_on(struct vc_data *vc, struct pt_regs *regs)
 {
        if (rep)
                return;
        set_vc_kbd_led(kbd, VC_CAPSLOCK);
 }
 
-static void fn_show_ptregs(struct vc_data *vc)
+static void fn_show_ptregs(struct vc_data *vc, struct pt_regs *regs)
 {
-       if (kbd_pt_regs)
-               show_regs(kbd_pt_regs);
+       if (regs)
+               show_regs(regs);
 }
 
-static void fn_hold(struct vc_data *vc)
+static void fn_hold(struct vc_data *vc, struct pt_regs *regs)
 {
        struct tty_struct *tty = vc->vc_tty;
 
@@ -471,12 +469,12 @@ static void fn_hold(struct vc_data *vc)
                stop_tty(tty);
 }
 
-static void fn_num(struct vc_data *vc)
+static void fn_num(struct vc_data *vc, struct pt_regs *regs)
 {
        if (vc_kbd_mode(kbd,VC_APPLIC))
                applkey(vc, 'P', 1);
        else
-               fn_bare_num(vc);
+               fn_bare_num(vc, regs);
 }
 
 /*
@@ -485,19 +483,19 @@ static void fn_num(struct vc_data *vc)
  * Bind this to NumLock if you prefer that the NumLock key always
  * changes the NumLock flag.
  */
-static void fn_bare_num(struct vc_data *vc)
+static void fn_bare_num(struct vc_data *vc, struct pt_regs *regs)
 {
        if (!rep)
                chg_vc_kbd_led(kbd, VC_NUMLOCK);
 }
 
-static void fn_lastcons(struct vc_data *vc)
+static void fn_lastcons(struct vc_data *vc, struct pt_regs *regs)
 {
        /* switch to the last used console, ChN */
        set_console(last_console);
 }
 
-static void fn_dec_console(struct vc_data *vc)
+static void fn_dec_console(struct vc_data *vc, struct pt_regs *regs)
 {
        int i;
  
@@ -510,7 +508,7 @@ static void fn_dec_console(struct vc_data *vc)
        set_console(i);
 }
 
-static void fn_inc_console(struct vc_data *vc)
+static void fn_inc_console(struct vc_data *vc, struct pt_regs *regs)
 {
        int i;
 
@@ -523,7 +521,7 @@ static void fn_inc_console(struct vc_data *vc)
        set_console(i);
 }
 
-static void fn_send_intr(struct vc_data *vc)
+static void fn_send_intr(struct vc_data *vc, struct pt_regs *regs)
 {
        struct tty_struct *tty = vc->vc_tty;
 
@@ -533,44 +531,44 @@ static void fn_send_intr(struct vc_data *vc)
        con_schedule_flip(tty);
 }
 
-static void fn_scroll_forw(struct vc_data *vc)
+static void fn_scroll_forw(struct vc_data *vc, struct pt_regs *regs)
 {
        scrollfront(0);
 }
 
-static void fn_scroll_back(struct vc_data *vc)
+static void fn_scroll_back(struct vc_data *vc, struct pt_regs *regs)
 {
        scrollback(0);
 }
 
-static void fn_show_mem(struct vc_data *vc)
+static void fn_show_mem(struct vc_data *vc, struct pt_regs *regs)
 {
        show_mem();
 }
 
-static void fn_show_state(struct vc_data *vc)
+static void fn_show_state(struct vc_data *vc, struct pt_regs *regs)
 {
        show_state();
 }
 
-static void fn_boot_it(struct vc_data *vc)
+static void fn_boot_it(struct vc_data *vc, struct pt_regs *regs)
 {
        ctrl_alt_del();
 }
 
-static void fn_compose(struct vc_data *vc)
+static void fn_compose(struct vc_data *vc, struct pt_regs *regs)
 {
        dead_key_next = 1;
 }
 
-static void fn_spawn_con(struct vc_data *vc)
+static void fn_spawn_con(struct vc_data *vc, struct pt_regs *regs)
 {
         if (spawnpid)
           if(kill_proc(spawnpid, spawnsig, 1))
             spawnpid = 0;
 }
 
-static void fn_SAK(struct vc_data *vc)
+static void fn_SAK(struct vc_data *vc, struct pt_regs *regs)
 {
        struct tty_struct *tty = vc->vc_tty;
 
@@ -583,7 +581,7 @@ static void fn_SAK(struct vc_data *vc)
        reset_vc(fg_console);
 }
 
-static void fn_null(struct vc_data *vc)
+static void fn_null(struct vc_data *vc, struct pt_regs *regs)
 {
        compute_shiftstate();
 }
@@ -591,11 +589,11 @@ static void fn_null(struct vc_data *vc)
 /*
  * Special key handlers
  */
-static void k_ignore(struct vc_data *vc, unsigned char value, char up_flag)
+static void k_ignore(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs)
 {
 }
 
-static void k_spec(struct vc_data *vc, unsigned char value, char up_flag)
+static void k_spec(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs)
 {
        if (up_flag)
                return;
@@ -605,15 +603,15 @@ static void k_spec(struct vc_data *vc, unsigned char value, char up_flag)
             kbd->kbdmode == VC_MEDIUMRAW) && 
             value != K_SAK)
                return;         /* SAK is allowed even in raw mode */
-       fn_handler[value](vc);
+       fn_handler[value](vc, regs);
 }
 
-static void k_lowercase(struct vc_data *vc, unsigned char value, char up_flag)
+static void k_lowercase(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs)
 {
        printk(KERN_ERR "keyboard.c: k_lowercase was called - impossible\n");
 }
 
-static void k_self(struct vc_data *vc, unsigned char value, char up_flag)
+static void k_self(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs)
 {
        if (up_flag)
                return;         /* no action, if this is a key release */
@@ -634,7 +632,7 @@ static void k_self(struct vc_data *vc, unsigned char value, char up_flag)
  * dead keys modifying the same character. Very useful
  * for Vietnamese.
  */
-static void k_dead2(struct vc_data *vc, unsigned char value, char up_flag)
+static void k_dead2(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs)
 {
        if (up_flag)
                return;
@@ -644,21 +642,21 @@ static void k_dead2(struct vc_data *vc, unsigned char value, char up_flag)
 /*
  * Obsolete - for backwards compatibility only
  */
-static void k_dead(struct vc_data *vc, unsigned char value, char up_flag)
+static void k_dead(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs)
 {
        static unsigned char ret_diacr[NR_DEAD] = {'`', '\'', '^', '~', '"', ',' };
        value = ret_diacr[value];
-       k_dead2(vc, value, up_flag);
+       k_dead2(vc, value, up_flag, regs);
 }
 
-static void k_cons(struct vc_data *vc, unsigned char value, char up_flag)
+static void k_cons(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs)
 {
        if (up_flag)
                return;
        set_console(value);
 }
 
-static void k_fn(struct vc_data *vc, unsigned char value, char up_flag)
+static void k_fn(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs)
 {
        if (up_flag)
                return;
@@ -669,7 +667,7 @@ static void k_fn(struct vc_data *vc, unsigned char value, char up_flag)
                printk(KERN_ERR "k_fn called with value=%d\n", value);
 }
 
-static void k_cur(struct vc_data *vc, unsigned char value, char up_flag)
+static void k_cur(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs)
 {
        static const char *cur_chars = "BDCA";
 
@@ -678,7 +676,7 @@ static void k_cur(struct vc_data *vc, unsigned char value, char up_flag)
        applkey(vc, cur_chars[value], vc_kbd_mode(kbd, VC_CKMODE));
 }
 
-static void k_pad(struct vc_data *vc, unsigned char value, char up_flag)
+static void k_pad(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs)
 {
        static const char *pad_chars = "0123456789+-*/\015,.?()#";
        static const char *app_map = "pqrstuvwxylSRQMnnmPQS";
@@ -696,34 +694,34 @@ static void k_pad(struct vc_data *vc, unsigned char value, char up_flag)
                switch (value) {
                        case KVAL(K_PCOMMA):
                        case KVAL(K_PDOT):
-                               k_fn(vc, KVAL(K_REMOVE), 0);
+                               k_fn(vc, KVAL(K_REMOVE), 0, regs);
                                return;
                        case KVAL(K_P0):
-                               k_fn(vc, KVAL(K_INSERT), 0);
+                               k_fn(vc, KVAL(K_INSERT), 0, regs);
                                return;
                        case KVAL(K_P1):
-                               k_fn(vc, KVAL(K_SELECT), 0);
+                               k_fn(vc, KVAL(K_SELECT), 0, regs);
                                return;
                        case KVAL(K_P2):
-                               k_cur(vc, KVAL(K_DOWN), 0);
+                               k_cur(vc, KVAL(K_DOWN), 0, regs);
                                return;
                        case KVAL(K_P3):
-                               k_fn(vc, KVAL(K_PGDN), 0);
+                               k_fn(vc, KVAL(K_PGDN), 0, regs);
                                return;
                        case KVAL(K_P4):
-                               k_cur(vc, KVAL(K_LEFT), 0);
+                               k_cur(vc, KVAL(K_LEFT), 0, regs);
                                return;
                        case KVAL(K_P6):
-                               k_cur(vc, KVAL(K_RIGHT), 0);
+                               k_cur(vc, KVAL(K_RIGHT), 0, regs);
                                return;
                        case KVAL(K_P7):
-                               k_fn(vc, KVAL(K_FIND), 0);
+                               k_fn(vc, KVAL(K_FIND), 0, regs);
                                return;
                        case KVAL(K_P8):
-                               k_cur(vc, KVAL(K_UP), 0);
+                               k_cur(vc, KVAL(K_UP), 0, regs);
                                return;
                        case KVAL(K_P9):
-                               k_fn(vc, KVAL(K_PGUP), 0);
+                               k_fn(vc, KVAL(K_PGUP), 0, regs);
                                return;
                        case KVAL(K_P5):
                                applkey(vc, 'G', vc_kbd_mode(kbd, VC_APPLIC));
@@ -735,7 +733,7 @@ static void k_pad(struct vc_data *vc, unsigned char value, char up_flag)
                put_queue(vc, 10);
 }
 
-static void k_shift(struct vc_data *vc, unsigned char value, char up_flag)
+static void k_shift(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs)
 {
        int old_state = shift_state;
 
@@ -776,7 +774,7 @@ static void k_shift(struct vc_data *vc, unsigned char value, char up_flag)
        }
 }
 
-static void k_meta(struct vc_data *vc, unsigned char value, char up_flag)
+static void k_meta(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs)
 {
        if (up_flag)
                return;
@@ -788,7 +786,7 @@ static void k_meta(struct vc_data *vc, unsigned char value, char up_flag)
                put_queue(vc, value | 0x80);
 }
 
-static void k_ascii(struct vc_data *vc, unsigned char value, char up_flag)
+static void k_ascii(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs)
 {
        int base;
 
@@ -810,16 +808,16 @@ static void k_ascii(struct vc_data *vc, unsigned char value, char up_flag)
                npadch = npadch * base + value;
 }
 
-static void k_lock(struct vc_data *vc, unsigned char value, char up_flag)
+static void k_lock(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs)
 {
        if (up_flag || rep)
                return;
        chg_vc_kbd_lock(kbd, value);
 }
 
-static void k_slock(struct vc_data *vc, unsigned char value, char up_flag)
+static void k_slock(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs)
 {
-       k_shift(vc, value, up_flag);
+       k_shift(vc, value, up_flag, regs);
        if (up_flag || rep)
                return;
        chg_vc_kbd_slock(kbd, value);
@@ -910,6 +908,7 @@ static void kbd_bh(unsigned long dummy)
                        input_event(handle->dev, EV_LED, LED_SCROLLL, !!(leds & 0x01));
                        input_event(handle->dev, EV_LED, LED_NUML,    !!(leds & 0x02));
                        input_event(handle->dev, EV_LED, LED_CAPSL,   !!(leds & 0x04));
+                       input_sync(handle->dev);
                }
        }
 
@@ -930,6 +929,7 @@ void kbd_refresh_leds(struct input_handle *handle)
                input_event(handle->dev, EV_LED, LED_SCROLLL, !!(leds & 0x01));
                input_event(handle->dev, EV_LED, LED_NUML,    !!(leds & 0x02));
                input_event(handle->dev, EV_LED, LED_CAPSL,   !!(leds & 0x04));
+               input_sync(handle->dev);
        }
        tasklet_enable(&keyboard_tasklet);
 }
@@ -1012,7 +1012,7 @@ static int emulate_raw(struct vc_data *vc, unsigned int keycode, unsigned char u
 }
 #endif
 
-void kbd_keycode(unsigned int keycode, int down)
+void kbd_keycode(unsigned int keycode, int down, struct pt_regs *regs)
 {
        struct vc_data *vc = vc_cons[fg_console].d;
        unsigned short keysym, *key_map;
@@ -1052,7 +1052,7 @@ void kbd_keycode(unsigned int keycode, int down)
                return;
        }
        if (sysrq_down && down && !rep) {
-               handle_sysrq(kbd_sysrq_xlate[keycode], kbd_pt_regs, tty);
+               handle_sysrq(kbd_sysrq_xlate[keycode], regs, tty);
                return;
        }
 #endif
@@ -1129,7 +1129,7 @@ void kbd_keycode(unsigned int keycode, int down)
                }
        }
 
-       (*k_handler[type])(vc, keysym & 0xff, !down);
+       (*k_handler[type])(vc, keysym & 0xff, !down, regs);
 
        if (type != KT_SLOCK)
                kbd->slockstate = 0;
@@ -1140,7 +1140,7 @@ static void kbd_event(struct input_handle *handle, unsigned int event_type,
 {
        if (event_type != EV_KEY)
                return;
-       kbd_keycode(keycode, down);
+       kbd_keycode(keycode, down, handle->dev->regs);
        tasklet_schedule(&keyboard_tasklet);
        do_poke_blanked_console = 1;
        schedule_console_callback();
index f51ff785d0ab4a2346c4cbf4defe09a7fc2d5f86..7dd5ce20f4ce3ee763c63194bb165e5fc00d9f60 100644 (file)
@@ -64,6 +64,8 @@ static void amijoy_interrupt(int irq, void *dummy, struct pt_regs *fp)
                                case 1: data = ~custom.joy1dat; button = (~ciaa.pra >> 7) & 1; break;
                        }
 
+                       input_regs(amijoy_dev + i, fp);
+
                        input_report_key(amijoy_dev + i, BTN_TRIGGER, button);
 
                        input_report_abs(amijoy_dev + i, ABS_X, ((data >> 1) & 1) - ((data >> 9) & 1));
index ad9c037f5ffe36283f3d701bc194193e71e2b018..176c5e8891868fcf7ea225dce112c69f04e23c9d 100644 (file)
@@ -151,7 +151,7 @@ static int mark_core_as_ready(struct iforce *iforce, unsigned short addr)
        return -1;
 }
 
-void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data)
+void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data, struct pt_regs *regs)
 {
        struct input_dev *dev = &iforce->dev;
        int i;
@@ -181,6 +181,8 @@ void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data)
                case 0x01:      /* joystick position data */
                case 0x03:      /* wheel position data */
 
+                       input_regs(dev, regs);
+
                        if (HI(cmd) == 1) {
                                input_report_abs(dev, ABS_X, (__s16) (((__s16)data[1] << 8) | data[0]));
                                input_report_abs(dev, ABS_Y, (__s16) (((__s16)data[3] << 8) | data[2]));
@@ -219,6 +221,7 @@ void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data)
                        break;
 
                case 0x02:      /* status report */
+                       input_regs(dev, regs);
                        input_report_key(dev, BTN_DEAD, data[0] & 0x02);
                        input_sync(dev);
 
index 1ec51fee215e1e0be6575b823d07ac1eb0269ed0..7037ded745771887ebcd601ea268b10abe2b6532 100644 (file)
@@ -78,7 +78,7 @@ static void iforce_serio_write_wakeup(struct serio *serio)
        iforce_serial_xmit((struct iforce *)serio->private);
 }
 
-static void iforce_serio_irq(struct serio *serio, unsigned char data, unsigned int flags)
+static void iforce_serio_irq(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
        struct iforce* iforce = serio->private;
 
@@ -115,7 +115,7 @@ static void iforce_serio_irq(struct serio *serio, unsigned char data, unsigned i
        }
 
        if (iforce->idx == iforce->len) {
-               iforce_process_packet(iforce, (iforce->id << 8) | iforce->idx, iforce->data);
+               iforce_process_packet(iforce, (iforce->id << 8) | iforce->idx, iforce->data, regs);
                iforce->pkt = 0;
                iforce->id  = 0;
                iforce->len = 0;
index 63cf238d6be37331f392c9d71629677593d0abd4..0acb3f9b6c1d1dec31c1d7d5d70186a27ae9d359 100644 (file)
@@ -74,7 +74,7 @@ void iforce_usb_xmit(struct iforce *iforce)
        spin_unlock_irqrestore(&iforce->xmit_lock, flags);
 }
 
-static void iforce_usb_irq(struct urb *urb)
+static void iforce_usb_irq(struct urb *urb, struct pt_regs *regs)
 {
        struct iforce *iforce = urb->context;
        int status;
@@ -96,7 +96,7 @@ static void iforce_usb_irq(struct urb *urb)
        }
 
        iforce_process_packet(iforce,
-               (iforce->data[0] << 8) | (urb->actual_length - 1), iforce->data + 1);
+               (iforce->data[0] << 8) | (urb->actual_length - 1), iforce->data + 1, regs);
 
 exit:
        status = usb_submit_urb (urb, GFP_ATOMIC);
@@ -105,7 +105,7 @@ exit:
                     __FUNCTION__, status);
 }
 
-static void iforce_usb_out(struct urb *urb)
+static void iforce_usb_out(struct urb *urb, struct pt_regs *regs)
 {
        struct iforce *iforce = urb->context;
 
@@ -120,7 +120,7 @@ static void iforce_usb_out(struct urb *urb)
                wake_up(&iforce->wait);
 }
 
-static void iforce_usb_ctrl(struct urb *urb)
+static void iforce_usb_ctrl(struct urb *urb, struct pt_regs *regs)
 {
        struct iforce *iforce = urb->context;
        if (urb->status) return;
@@ -133,11 +133,14 @@ static int iforce_usb_probe(struct usb_interface *intf,
                                const struct usb_device_id *id)
 {
        struct usb_device *dev = interface_to_usbdev(intf);
+       struct usb_host_interface *interface;
        struct usb_endpoint_descriptor *epirq, *epout;
        struct iforce *iforce;
 
-       epirq = intf->altsetting[0].endpoint + 0;
-       epout = intf->altsetting[0].endpoint + 1;
+       interface = &intf->altsetting[intf->act_altsetting];
+
+       epirq = &interface->endpoint[0].desc;
+       epout = &interface->endpoint[1].desc;
 
        if (!(iforce = kmalloc(sizeof(struct iforce) + 32, GFP_KERNEL)))
                goto fail;
index aa83b5f6c481c364147e18b96b246baeba3cc9dd..5b902522ed7505d6285ec12715fcf17b6fcc8ae1 100644 (file)
@@ -176,7 +176,7 @@ void iforce_delete_device(struct iforce *iforce);
 
 /* iforce-packets.c */
 int iforce_control_playback(struct iforce*, u16 id, unsigned int);
-void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data);
+void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data, struct pt_regs *regs);
 int iforce_send_packet(struct iforce *iforce, u16 cmd, unsigned char* data);
 void iforce_dump_packet(char *msg, u16 cmd, unsigned char *data) ;
 int iforce_get_id_packet(struct iforce *iforce, char *packet);
index ae6570053ebdc895722b23ade33ec4ac6ae4829c..203f13b4be14a900ac545ee6d2cf0789567e8dbb 100644 (file)
@@ -81,7 +81,7 @@ static int magellan_crunch_nibbles(unsigned char *data, int count)
        return 0;
 }
 
-static void magellan_process_packet(struct magellan* magellan)
+static void magellan_process_packet(struct magellan* magellan, struct pt_regs *regs)
 {
        struct input_dev *dev = &magellan->dev;
        unsigned char *data = magellan->data;
@@ -89,6 +89,8 @@ static void magellan_process_packet(struct magellan* magellan)
 
        if (!magellan->idx) return;
 
+       input_regs(dev, regs);
+
        switch (magellan->data[0]) {
 
                case 'd':                               /* Axis data */
@@ -111,12 +113,12 @@ static void magellan_process_packet(struct magellan* magellan)
        input_sync(dev);
 }
 
-static void magellan_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
+static void magellan_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
        struct magellan* magellan = serio->private;
 
        if (data == '\r') {
-               magellan_process_packet(magellan);
+               magellan_process_packet(magellan, regs);
                magellan->idx = 0;
        } else {
                if (magellan->idx < MAGELLAN_MAX_LENGTH)
index 895b3dfb52476ec4a07701469c7dafc91d0263f1..c2ecf93cc3962dbd5efb55a2920398f563253944 100644 (file)
@@ -81,7 +81,7 @@ struct spaceball {
  * SpaceBall.
  */
 
-static void spaceball_process_packet(struct spaceball* spaceball)
+static void spaceball_process_packet(struct spaceball* spaceball, struct pt_regs *regs)
 {
        struct input_dev *dev = &spaceball->dev;
        unsigned char *data = spaceball->data;
@@ -89,6 +89,8 @@ static void spaceball_process_packet(struct spaceball* spaceball)
 
        if (spaceball->idx < 2) return;
 
+       input_regs(dev, regs);
+
        switch (spaceball->data[0]) {
 
                case 'D':                                       /* Ball data */
@@ -147,13 +149,13 @@ static void spaceball_process_packet(struct spaceball* spaceball)
  * can occur in the axis values.
  */
 
-static void spaceball_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
+static void spaceball_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
        struct spaceball *spaceball = serio->private;
 
        switch (data) {
                case 0xd:
-                       spaceball_process_packet(spaceball);
+                       spaceball_process_packet(spaceball, regs);
                        spaceball->idx = 0;
                        spaceball->escape = 0;
                        return;
index cffdd486590251a4d3de2acb7296d10a5eabda5a..3c59a6316d70cd358e239f070c6ecdfabe17ebae 100644 (file)
@@ -74,7 +74,7 @@ static unsigned char *spaceorb_errors[] = { "EEPROM storing 0 failed", "Receive
  * SpaceOrb.
  */
 
-static void spaceorb_process_packet(struct spaceorb *spaceorb)
+static void spaceorb_process_packet(struct spaceorb *spaceorb, struct pt_regs *regs)
 {
        struct input_dev *dev = &spaceorb->dev;
        unsigned char *data = spaceorb->data;
@@ -86,6 +86,8 @@ static void spaceorb_process_packet(struct spaceorb *spaceorb)
        for (i = 0; i < spaceorb->idx; i++) c ^= data[i];
        if (c) return;
 
+       input_regs(dev, regs);
+
        switch (data[0]) {
 
                case 'R':                               /* Reset packet */
@@ -128,12 +130,12 @@ static void spaceorb_process_packet(struct spaceorb *spaceorb)
        input_sync(dev);
 }
 
-static void spaceorb_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
+static void spaceorb_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
        struct spaceorb* spaceorb = serio->private;
 
        if (~data & 0x80) {
-               if (spaceorb->idx) spaceorb_process_packet(spaceorb);
+               if (spaceorb->idx) spaceorb_process_packet(spaceorb, regs);
                spaceorb->idx = 0;
        }
        if (spaceorb->idx < SPACEORB_MAX_LENGTH)
index 8f705f64410a462b7aafa7e0ea1b0d524cc67fcc..3f47b345aa4bdc06ee776632be5d01a4566bc68d 100644 (file)
@@ -64,13 +64,15 @@ struct stinger {
  * Stinger. It updates the data accordingly.
  */
 
-static void stinger_process_packet(struct stinger *stinger)
+static void stinger_process_packet(struct stinger *stinger, struct pt_regs *regs)
 {
        struct input_dev *dev = &stinger->dev;
        unsigned char *data = stinger->data;
 
        if (!stinger->idx) return;
 
+       input_regs(dev, regs);
+
        input_report_key(dev, BTN_A,      ((data[0] & 0x20) >> 5));
        input_report_key(dev, BTN_B,      ((data[0] & 0x10) >> 4));
        input_report_key(dev, BTN_C,      ((data[0] & 0x08) >> 3));
@@ -96,7 +98,7 @@ static void stinger_process_packet(struct stinger *stinger)
  * packet processing routine.
  */
 
-static void stinger_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
+static void stinger_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
        struct stinger* stinger = serio->private;
 
@@ -106,7 +108,7 @@ static void stinger_interrupt(struct serio *serio, unsigned char data, unsigned
                stinger->data[stinger->idx++] = data;
 
        if (stinger->idx == 4) {
-               stinger_process_packet(stinger);
+               stinger_process_packet(stinger, regs);
                stinger->idx = 0;
        }
 
index 334de4831987b5b4dd4a399986efd630b185af37..8a98be150ef72b80a165a270ddc9f9ffed65974d 100644 (file)
@@ -101,7 +101,7 @@ struct twidjoy {
  * Twiddler. It updates the data accordingly.
  */
 
-static void twidjoy_process_packet(struct twidjoy *twidjoy)
+static void twidjoy_process_packet(struct twidjoy *twidjoy, struct pt_regs *regs)
 {
        if (twidjoy->idx == TWIDJOY_MAX_LENGTH) {
                struct input_dev *dev = &twidjoy->dev;
@@ -111,6 +111,8 @@ static void twidjoy_process_packet(struct twidjoy *twidjoy)
 
                button_bits = ((data[1] & 0x7f) << 7) | (data[0] & 0x7f);
 
+               input_regs(dev, regs);
+
                for (bp = twidjoy_buttons; bp->bitmask; bp++) {
                        int value = (button_bits & (bp->bitmask << bp->bitshift)) >> bp->bitshift;
                        int i;
@@ -140,7 +142,7 @@ static void twidjoy_process_packet(struct twidjoy *twidjoy)
  * packet processing routine.
  */
 
-static void twidjoy_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
+static void twidjoy_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struc pt_regs *regs)
 {
        struct twidjoy *twidjoy = serio->private;
 
@@ -157,7 +159,7 @@ static void twidjoy_interrupt(struct serio *serio, unsigned char data, unsigned
                twidjoy->data[twidjoy->idx++] = data;
 
        if (twidjoy->idx == TWIDJOY_MAX_LENGTH) {
-               twidjoy_process_packet(twidjoy);
+               twidjoy_process_packet(twidjoy, regs);
                twidjoy->idx = 0;
        }
 
index 8045b8e456791b3ce4e540893a690509c3d4e472..7509892f243082e7159f700f6e5d2842729ce733 100644 (file)
@@ -63,13 +63,15 @@ struct warrior {
  * Warrior. It updates the data accordingly.
  */
 
-static void warrior_process_packet(struct warrior *warrior)
+static void warrior_process_packet(struct warrior *warrior, struct pt_regs *regs)
 {
        struct input_dev *dev = &warrior->dev;
        unsigned char *data = warrior->data;
 
        if (!warrior->idx) return;
 
+       input_regs(dev, regs);
+
        switch ((data[0] >> 4) & 7) {
                case 1:                                 /* Button data */
                        input_report_key(dev, BTN_TRIGGER,  data[3]       & 1);
@@ -97,12 +99,12 @@ static void warrior_process_packet(struct warrior *warrior)
  * packet processing routine.
  */
 
-static void warrior_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
+static void warrior_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
        struct warrior* warrior = serio->private;
 
        if (data & 0x80) {
-               if (warrior->idx) warrior_process_packet(warrior);
+               if (warrior->idx) warrior_process_packet(warrior, regs);
                warrior->idx = 0;
                warrior->len = warrior_lengths[(data >> 4) & 7];
        }
@@ -111,7 +113,7 @@ static void warrior_interrupt(struct serio *serio, unsigned char data, unsigned
                warrior->data[warrior->idx++] = data;
 
        if (warrior->idx == warrior->len) {
-               if (warrior->idx) warrior_process_packet(warrior);      
+               if (warrior->idx) warrior_process_packet(warrior, regs);        
                warrior->idx = 0;
                warrior->len = 0;
        }
index 14d8d59cf7fc92cf02aac1c10ad2522cd13c1647..31a682157df6cc956840b108096c39f09607f06e 100644 (file)
@@ -87,6 +87,8 @@ static void amikbd_interrupt(int irq, void *dummy, struct pt_regs *fp)
 
                scancode = amikbd_keycode[scancode];
 
+               input_regs(&amikbd_dev, fp);
+
                if (scancode == KEY_CAPSLOCK) { /* CapsLock is a toggle switch key on Amiga */
                        input_report_key(&amikbd_dev, scancode, 1);
                        input_report_key(&amikbd_dev, scancode, 0);
index 81938c02bd81bc834bee36283b58977d670dc19d..d6a18ba074a2fb85c412f7de8e3679f90b9199ec 100644 (file)
@@ -132,7 +132,7 @@ struct atkbd {
  * the keyboard into events.
  */
 
-static void atkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
+static void atkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
        struct atkbd *atkbd = serio->private;
        int code = data;
@@ -193,6 +193,7 @@ static void atkbd_interrupt(struct serio *serio, unsigned char data, unsigned in
                                atkbd->set, code, serio->phys, atkbd->release ? "released" : "pressed");
                        break;
                default:
+                       input_regs(&atkbd->dev, regs);
                        input_report_key(&atkbd->dev, atkbd->keycode[code], !atkbd->release);
                        input_sync(&atkbd->dev);
        }
index 17959338d779e4db1ceb42dc75d6253d931947d0..2bc431a1b6353fb2c5b8da1fc86d629b41aab839 100644 (file)
@@ -62,18 +62,20 @@ struct nkbd {
        char phys[32];
 };
 
-void nkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
+void nkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
        struct nkbd *nkbd = serio->private;
 
        /* invalid scan codes are probably the init sequence, so we ignore them */
-       if (nkbd->keycode[data & NKBD_KEY])
+       if (nkbd->keycode[data & NKBD_KEY]) {
+               input_regs(&nkbd->dev, regs);
                input_report_key(&nkbd->dev, nkbd->keycode[data & NKBD_KEY], data & NKBD_PRESS);
+               input_sync(&nkbd->dev);
+       }
 
        else if (data == 0xe7) /* end of init sequence */
                printk(KERN_INFO "input: %s on %s\n", nkbd_name, serio->phys);
 
-       input_sync(&nkbd->dev);
 }
 
 void nkbd_connect(struct serio *serio, struct serio_dev *dev)
index 419ae5e672700eae52b4f4e0332805cd972f1751..ccfbf94c39efae7ed13fcb8d9ee952f20f5a34c6 100644 (file)
@@ -89,7 +89,7 @@ struct sunkbd {
  * is received.
  */
 
-static void sunkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
+static void sunkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
        struct sunkbd* sunkbd = serio->private;
 
@@ -119,6 +119,7 @@ static void sunkbd_interrupt(struct serio *serio, unsigned char data, unsigned i
 
                default:
                        if (sunkbd->keycode[data & SUNKBD_KEY]) {
+                               input_regs(&sunkbd->dev, regs);
                                 input_report_key(&sunkbd->dev, sunkbd->keycode[data & SUNKBD_KEY], !(data & SUNKBD_RELEASE));
                                input_sync(&sunkbd->dev);
                         } else {
index 5a09e3154a8871ce9d81af4fe5f4077e510443c1..8fb1051aa013757df79f28eadc6215180bc73f22 100644 (file)
@@ -63,7 +63,7 @@ struct xtkbd {
        char phys[32];
 };
 
-void xtkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
+void xtkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
        struct xtkbd *xtkbd = serio->private;
 
@@ -74,6 +74,7 @@ void xtkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags
                default:
 
                        if (xtkbd->keycode[data & XTKBD_KEY]) {
+                               input_regs(&xtkbd->dev, regs);
                                input_report_key(&xtkbd->dev, xtkbd->keycode[data & XTKBD_KEY], !(data & XTKBD_RELEASE));
                                input_sync(&xtkbd->dev);
                        } else {
index 6d615575589e35be5d79bf09b85444ab2d7c589e..b76519b369cd88a1069a0be3736bfaf6068c8920 100644 (file)
@@ -305,7 +305,7 @@ static void __init gscps2_reset(char * addr)
  * Receives a keyboard scancode, analyses it and sends it to the input layer.
  */
 
-static void gscps2_kbd_docode(void)
+static void gscps2_kbd_docode(struct pt_regs *regs)
 {
        int scancode = gscps2_readb_input(hpkeyb.addr);
        DPRINTK("rel=%d scancode=%d, esc=%d ", hpkeyb.released, scancode, hpkeyb.escaped);
@@ -341,6 +341,7 @@ static void gscps2_kbd_docode(void)
                default:
                        hpkeyb.scancode = scancode;
                        DPRINTK("sent=%d, rel=%d\n",hpkeyb.scancode, hpkeyb.released);
+                       input_regs(regs);
                        input_report_key(&hpkeyb.dev, hpkeyb_keycode[hpkeyb.scancode], !hpkeyb.released);
                        input_sync(&hpkeyb.dev);
                        if (hpkeyb.escaped)
@@ -359,7 +360,7 @@ static void gscps2_kbd_docode(void)
  * correct events to the input layer.
  */
 
-static void gscps2_mouse_docode(void)
+static void gscps2_mouse_docode(struct pt_regs *regs)
 {
        int xrel, yrel;
 
@@ -368,7 +369,7 @@ static void gscps2_mouse_docode(void)
                hpmouse.nbread--;
 
        /* stolen from psmouse.c */
-       if (hpmouse.nbread && time_after(jiffies, hpmouse.last + HZ/20)) {
+       if (hpmouse.nbread && time_after(jiffies, hpmouse.last + HZ/2)) {
                printk(KERN_DEBUG "%s:%d : Lost mouse synchronization, throwing %d bytes away.\n", __FILE__, __LINE__,
                                hpmouse.nbread);
                hpmouse.nbread = 0;
@@ -387,6 +388,8 @@ static void gscps2_mouse_docode(void)
                if ((hpmouse.bytes[PACKET_CTRL] & (MOUSE_XOVFLOW | MOUSE_YOVFLOW)))
                        DPRINTK("Mouse: position overflow\n");
                
+               input_regs(regs);
+
                input_report_key(&hpmouse.dev, BTN_LEFT, hpmouse.bytes[PACKET_CTRL] & MOUSE_LEFTBTN);
                input_report_key(&hpmouse.dev, BTN_MIDDLE, hpmouse.bytes[PACKET_CTRL] & MOUSE_MIDBTN);
                input_report_key(&hpmouse.dev, BTN_RIGHT, hpmouse.bytes[PACKET_CTRL] & MOUSE_RIGHTBTN);
@@ -421,11 +424,11 @@ static void gscps2_interrupt(int irq, void *dev, struct pt_regs *reg)
 {
        /* process mouse actions */
        while (gscps2_readb_status(hpmouse.addr) & GSC_STAT_RBNE)
-               gscps2_mouse_docode();
+               gscps2_mouse_docode(reg);
        
        /* process keyboard scancode */
        while (gscps2_readb_status(hpkeyb.addr) & GSC_STAT_RBNE)
-               gscps2_kbd_docode();
+               gscps2_kbd_docode(reg);
 }
 
 
index f89593c4f4bf8f2b939a6fb7b13c83b7b5a48228..05bf73dbf86d9073fd240dfab734a5c30db24ca5 100644 (file)
@@ -63,6 +63,8 @@ static void amimouse_interrupt(int irq, void *dummy, struct pt_regs *fp)
 
        potgor = custom.potgor;
 
+       input_regs(&amimouse_dev, fp);
+
        input_report_rel(&amimouse_dev, REL_X, dx);
        input_report_rel(&amimouse_dev, REL_Y, dy);
 
index 0223c2997a9efa172f124933cfd9faf1ecbb7c0a..64fa5a6f38f79cf89462fb4fbd74f989fbe9ed83 100644 (file)
@@ -131,6 +131,8 @@ static void inport_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        outb(INPORT_REG_MODE, INPORT_CONTROL_PORT);
        outb(INPORT_MODE_HOLD | INPORT_MODE_IRQ | INPORT_MODE_BASE, INPORT_DATA_PORT);
 
+       input_regs(&inport_dev, regs);
+
        outb(INPORT_REG_X, INPORT_CONTROL_PORT);
        input_report_rel(&inport_dev, REL_X, inb(INPORT_DATA_PORT));
 
index 5ad352feee9594f5f9f24584f576040b20720168..0f7b9a8248b6248107a4105d54f1a24a60ffc3b8 100644 (file)
@@ -130,6 +130,7 @@ static void logibm_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        dy |= (buttons & 0xf) << 4;
        buttons = ~buttons >> 5;
 
+       input_regs(&logibm_dev, regs);
        input_report_rel(&logibm_dev, REL_X, dx);
        input_report_rel(&logibm_dev, REL_Y, dy);
        input_report_key(&logibm_dev, BTN_RIGHT,  buttons & 1);
index f14896d1d32ac690476346c404be666adf4a4474..2f2acbab625200eaea57a64f6f510e7cd89a9414 100644 (file)
@@ -73,6 +73,7 @@ static void pc110pad_interrupt(int irq, void *ptr, struct pt_regs *regs)
 
        if (pc110pad_count < 3) return;
        
+       input_regs(&pc110pad_dev, regs);
        input_report_key(&pc110pad_dev, BTN_TOUCH,
                pc110pad_data[0] & 0x01);
        input_report_abs(&pc110pad_dev, ABS_X,
index f1406f55774d770d7c0a2f7e56480f34c7836e87..a45957c267fb9021208b0bab701233a350c56d27 100644 (file)
@@ -73,11 +73,13 @@ static char *psmouse_protocols[] = { "None", "PS/2", "PS2++", "PS2T++", "GenPS/2
  * reports relevant events to the input module.
  */
 
-static void psmouse_process_packet(struct psmouse *psmouse)
+static void psmouse_process_packet(struct psmouse *psmouse, struct pt_regs *regs)
 {
        struct input_dev *dev = &psmouse->dev;
        unsigned char *packet = psmouse->packet;
 
+       input_regs(dev, regs);
+
 /*
  * The PS2++ protocol is a little bit complex
  */
@@ -165,7 +167,7 @@ static void psmouse_process_packet(struct psmouse *psmouse)
  * packets or passing them to the command routine as command output.
  */
 
-static void psmouse_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
+static void psmouse_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
        struct psmouse *psmouse = serio->private;
 
@@ -201,7 +203,7 @@ static void psmouse_interrupt(struct serio *serio, unsigned char data, unsigned
        psmouse->packet[psmouse->pktcnt++] = data;
 
        if (psmouse->pktcnt == 3 + (psmouse->type >= PSMOUSE_GENPS)) {
-               psmouse_process_packet(psmouse);
+               psmouse_process_packet(psmouse, regs);
                psmouse->pktcnt = 0;
                return;
        }
index 4ceea81ce304fc436690e7f33c72c2e5e1a0e475..c9ba96d3c938dee44d3827e834d5f55b6a48875b 100644 (file)
@@ -64,6 +64,8 @@ static void rpcmouse_irq(int irq, void *dev_id, struct pt_regs *regs)
        rpcmouse_lastx = x;
        rpcmouse_lasty = y;
 
+       input_regs(dev, regs);
+
        input_report_rel(dev, REL_X, dx);
        input_report_rel(dev, REL_Y, -dy);
 
index c03470b4f2886e884d6c580daebc54fc52acfbfd..eb1af3e998eb3c83f901397b77ec74a8cc9c006f 100644 (file)
@@ -60,11 +60,13 @@ struct sermouse {
  * second, which is as good as a PS/2 or USB mouse.
  */
 
-static void sermouse_process_msc(struct sermouse *sermouse, signed char data)
+static void sermouse_process_msc(struct sermouse *sermouse, signed char data, struct pt_regs *regs)
 {
        struct input_dev *dev = &sermouse->dev;
        signed char *buf = sermouse->buf;
 
+       input_regs(dev, regs);
+
        switch (sermouse->count) {
 
                case 0:
@@ -101,13 +103,15 @@ static void sermouse_process_msc(struct sermouse *sermouse, signed char data)
  * standard 3-byte packets and 1200 bps.
  */
 
-static void sermouse_process_ms(struct sermouse *sermouse, signed char data)
+static void sermouse_process_ms(struct sermouse *sermouse, signed char data, struct pt_regs *regs)
 {
        struct input_dev *dev = &sermouse->dev;
        signed char *buf = sermouse->buf;
 
        if (data & 0x40) sermouse->count = 0;
 
+       input_regs(dev, regs);
+
        switch (sermouse->count) {
 
                case 0:
@@ -200,7 +204,7 @@ static void sermouse_process_ms(struct sermouse *sermouse, signed char data)
  * packets or passing them to the command routine as command output.
  */
 
-static void sermouse_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
+static void sermouse_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
        struct sermouse *sermouse = serio->private;
 
@@ -208,9 +212,9 @@ static void sermouse_interrupt(struct serio *serio, unsigned char data, unsigned
        sermouse->last = jiffies;
 
        if (sermouse->type > SERIO_SUN)
-               sermouse_process_ms(sermouse, data);
+               sermouse_process_ms(sermouse, data, regs);
        else
-               sermouse_process_msc(sermouse, data);
+               sermouse_process_msc(sermouse, data, regs);
 }
 
 /*
index 1d9e085d01725fac3f570bb8d38fd3a685bc854e..1520791763a8ab069ec19995d5c51d508a855481 100644 (file)
@@ -23,8 +23,6 @@
 #include <asm/irq.h>
 #include <asm/hardware/amba_kmi.h>
 
-extern struct pt_regs *kbd_pt_regs;
-
 #define KMI_BASE       (kmi->base)
 
 struct amba_kmi_port {
@@ -42,10 +40,8 @@ static void amba_kmi_int(int irq, void *dev_id, struct pt_regs *regs)
        struct amba_kmi_port *kmi = dev_id;
        unsigned int status = __raw_readb(KMIIR);
 
-       kbd_pt_regs = regs;
-
        while (status & KMIIR_RXINTR) {
-               serio_interrupt(&kmi->io, __raw_readb(KMIDATA), 0);
+               serio_interrupt(&kmi->io, __raw_readb(KMIDATA), 0, regs);
                status = __raw_readb(KMIIR);
        }
 }
index ab0ee79c01f5fab5081f7167b5102ee59f3a53c5..a3cf7bf523744fc0fc7bf3c952ae33d519930532 100644 (file)
@@ -156,7 +156,7 @@ static struct serio ct82c710_port =
 
 static void ct82c710_interrupt(int cpl, void *dev_id, struct pt_regs * regs)
 {
-       serio_interrupt(&ct82c710_port, inb(ct82c710_data), 0);
+       serio_interrupt(&ct82c710_port, inb(ct82c710_data), 0, regs);
 }
 
 /*
index 743685f737ca1331ce4c5acaa81cb26469589e60..651dec884296ef11199b665bc36664bc86de713b 100644 (file)
@@ -62,8 +62,6 @@ static unsigned char i8042_last_e0;
 static unsigned char i8042_mux_open;
 struct timer_list i8042_timer;
 
-extern struct pt_regs *kbd_pt_regs;
-
 static unsigned long i8042_unxlate_seen[256 / BITS_PER_LONG];
 static unsigned char i8042_unxlate_table[128] = {
          0,118, 22, 30, 38, 37, 46, 54, 61, 62, 70, 69, 78, 85,102, 13,
@@ -345,10 +343,6 @@ static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        } buffer[I8042_BUFFER_SIZE];
        int i, j = 0;
 
-#ifdef CONFIG_VT
-       kbd_pt_regs = regs;
-#endif
-
        spin_lock_irqsave(&i8042_lock, flags);
 
        while (j < I8042_BUFFER_SIZE && 
@@ -381,7 +375,7 @@ static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
                                dfl & SERIO_PARITY ? ", bad parity" : "",
                                dfl & SERIO_TIMEOUT ? ", timeout" : "");
 
-                       serio_interrupt(i8042_mux_port + ((str >> 6) & 3), data, dfl);
+                       serio_interrupt(i8042_mux_port + ((str >> 6) & 3), data, dfl, regs);
                        continue;
                }
 
@@ -391,7 +385,7 @@ static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
                        dfl & SERIO_TIMEOUT ? ", timeout" : "");
 
                if (i8042_aux_values.exists && (str & I8042_STR_AUXDATA)) {
-                       serio_interrupt(&i8042_aux_port, data, dfl);
+                       serio_interrupt(&i8042_aux_port, data, dfl, regs);
                        continue;
                }
 
@@ -399,7 +393,7 @@ static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
                        continue;
 
                if (i8042_direct) {
-                       serio_interrupt(&i8042_kbd_port, data, dfl);
+                       serio_interrupt(&i8042_kbd_port, data, dfl, regs);
                        continue;
                }
 
@@ -408,7 +402,7 @@ static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
                        if (index == 0xaa || index == 0xb6)
                                set_bit(index, i8042_unxlate_seen);
                        if (test_and_clear_bit(index, i8042_unxlate_seen)) {
-                               serio_interrupt(&i8042_kbd_port, 0xf0, dfl);
+                               serio_interrupt(&i8042_kbd_port, 0xf0, dfl, regs);
                                data = i8042_unxlate_table[data & 0x7f];
                        }
                } else {
@@ -418,7 +412,7 @@ static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
                i8042_last_e0 = (data == 0xe0);
 
-               serio_interrupt(&i8042_kbd_port, data, dfl);
+               serio_interrupt(&i8042_kbd_port, data, dfl, regs);
        }
 
 }
index 9f2858eb2f32b9d2aae5193e496054c5f17840bd..58fda20c3c56240437d54b9a70f6cd6a242280c6 100644 (file)
@@ -136,7 +136,7 @@ static void parkbd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
                parkbd_buffer |= (parkbd_readlines() >> 1) << parkbd_counter++;
 
                if (parkbd_counter == parkbd_mode + 10)
-                       serio_interrupt(&parkbd_port, (parkbd_buffer >> (2 - parkbd_mode)) & 0xff, 0);
+                       serio_interrupt(&parkbd_port, (parkbd_buffer >> (2 - parkbd_mode)) & 0xff, 0, regs);
        }
 
        parkbd_last = jiffies;
index a2312e0265b28576e68b58cd1112c4a893779930..b638b2672040406a699207e804fad0c0391070e0 100644 (file)
@@ -69,8 +69,7 @@ static struct serio q40kbd_port =
 static void q40kbd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
        if (Q40_IRQ_KEYB_MASK & master_inb(INTERRUPT_REG))
-               if (q40kbd_port.dev)
-                         q40kbd_port.dev->interrupt(&q40kbd_port, master_inb(KEYCODE_REG), 0);
+               serio_interrupt(&q40kbd_port, master_inb(KEYCODE_REG), 0, regs);
 
        master_outb(-1, KEYBOARD_UNLOCK_REG);
 }
index 9cfc803eb591010e61830024ee8a72c3901213a9..59e5a0f42626a30cd637e8a797a4c2b20309b042 100644 (file)
@@ -44,8 +44,6 @@ MODULE_AUTHOR("Vojtech Pavlik, Russell King");
 MODULE_DESCRIPTION("Acorn RiscPC PS/2 keyboard controller driver");
 MODULE_LICENSE("GPL");
 
-extern struct pt_regs *kbd_pt_regs;
-
 static int rpckbd_write(struct serio *port, unsigned char val)
 {
        while (!(iomd_readb(IOMD_KCTRL) & (1 << 7)))
@@ -60,12 +58,11 @@ static void rpckbd_rx(int irq, void *dev_id, struct pt_regs *regs)
 {
        struct serio *port = dev_id;
        unsigned int byte;
-       kbd_pt_regs = regs;
 
        while (iomd_readb(IOMD_KCTRL) & (1 << 5)) {
                byte = iomd_readb(IOMD_KARTRX);
 
-               serio_interrupt(port, byte, 0);
+               serio_interrupt(port, byte, 0, regs);
        }
 }
 
index 6ff316c8f1213775f1a025dc25875e65011a854e..df3466ca660d44b71d34b2f682acf05a831c9812 100644 (file)
@@ -24,8 +24,6 @@
 
 #include <asm/hardware/sa1111.h>
 
-extern struct pt_regs *kbd_pt_regs;
-
 struct ps2if {
        struct serio            io;
        struct sa1111_dev       *dev;
@@ -47,8 +45,6 @@ static void ps2_rxint(int irq, void *dev_id, struct pt_regs *regs)
        struct ps2if *ps2if = dev_id;
        unsigned int scancode, flag, status;
 
-       kbd_pt_regs = regs;
-
        status = sa1111_readl(ps2if->base + SA1111_PS2STAT);
        while (status & PS2STAT_RXF) {
                if (status & PS2STAT_STP)
@@ -62,7 +58,7 @@ static void ps2_rxint(int irq, void *dev_id, struct pt_regs *regs)
                if (hweight8(scancode) & 1)
                        flag ^= SERIO_PARITY;
 
-               serio_interrupt(&ps2if->io, scancode, flag);
+               serio_interrupt(&ps2if->io, scancode, flag, regs);
 
                        status = sa1111_readl(ps2if->base + SA1111_PS2STAT);
         }
index bf29f0becf6178a8d428b87d17ec97ee1feb3973..f0d7c60c6aa7a63ec414ef251ea109c6f897aa8c 100644 (file)
@@ -135,10 +135,10 @@ void serio_rescan(struct serio *serio)
        wake_up(&serio_wait);
 }
 
-void serio_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
+void serio_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
 {       
         if (serio->dev && serio->dev->interrupt) 
-                serio->dev->interrupt(serio, data, flags);
+                serio->dev->interrupt(serio, data, flags, regs);
        else 
                if (!flags)
                        serio_rescan(serio);
index e28ee699554f1ba9db889442e5e2791686ed2dc8..87c1eaa12b21104a7ea89699227d4da55282be0d 100644 (file)
@@ -114,6 +114,9 @@ static void serport_ldisc_close(struct tty_struct *tty)
  * serport_ldisc_receive() is called by the low level tty driver when characters
  * are ready for us. We forward the characters, one by one to the 'interrupt'
  * routine.
+ *
+ * FIXME: We should get pt_regs from the tty layer and forward them to
+ *       serio_interrupt here.
  */
 
 static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *cp, char *fp, int count)
@@ -121,7 +124,7 @@ static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *c
        struct serport *serport = (struct serport*) tty->disc_data;
        int i;
        for (i = 0; i < count; i++)
-               serio_interrupt(&serport->serio, cp[i], 0);
+               serio_interrupt(&serport->serio, cp[i], 0, NULL);
 }
 
 /*
index 795e4308d5f33b7151d347be8db971ee3c7c3b2c..ae70b387b19158711689328ca804068c302c4d88 100644 (file)
@@ -60,7 +60,7 @@ struct gunze {
        char phys[32];
 };
 
-static void gunze_process_packet(struct gunze* gunze)
+static void gunze_process_packet(struct gunze* gunze, struct pt_regs *regs)
 {
        struct input_dev *dev = &gunze->dev;
 
@@ -71,18 +71,19 @@ static void gunze_process_packet(struct gunze* gunze)
                return;
        }
 
+       input_regs(dev, regs);
        input_report_abs(dev, ABS_X, simple_strtoul(gunze->data + 1, NULL, 10) * 4);
        input_report_abs(dev, ABS_Y, 3072 - simple_strtoul(gunze->data + 6, NULL, 10) * 3);
        input_report_key(dev, BTN_TOUCH, gunze->data[0] == 'T');
        input_sync(dev);
 }
 
-static void gunze_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
+static void gunze_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
        struct gunze* gunze = serio->private;
 
        if (data == '\r') {
-               gunze_process_packet(gunze);
+               gunze_process_packet(gunze, regs);
                gunze->idx = 0;
        } else {
                if (gunze->idx < GUNZE_MAX_LENGTH)
index 0cd2a888812ee737732a0c55d9750cc247817f50..2f2855a5c619313ae8c005b457dca9ff10b9a0cb 100644 (file)
@@ -108,6 +108,7 @@ static void action_button_handler(int irq, void *dev_id, struct pt_regs *regs)
         int down = (GPLR & GPIO_BITSY_ACTION_BUTTON) ? 0 : 1;
        struct input_dev *dev = (struct input_dev *) dev_id;
 
+       input_regs(dev, regs);
        input_report_key(dev, KEY_ENTER, down);
        input_sync(dev);
 }
@@ -121,6 +122,7 @@ static void npower_button_handler(int irq, void *dev_id, struct pt_regs *regs)
         * This interrupt is only called when we release the key. So we have 
         * to fake a key press.
         */     
+       input_regs(dev, regs);
        input_report_key(dev, KEY_SUSPEND, 1);
        input_report_key(dev, KEY_SUSPEND, down);       
        input_sync(dev);
@@ -183,12 +185,14 @@ static int h3600ts_pm_callback(struct pm_dev *pm_dev, pm_request_t req,
  * packets. Some packets coming from serial are not touchscreen related. In
  * this case we send them off to be processed elsewhere. 
  */
-static void h3600ts_process_packet(struct h3600_dev *ts)
+static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs)
 {
         struct input_dev *dev = &ts->dev;
        static int touched = 0;
        int key, down = 0;
 
+       input_regs(dev, regs);
+
         switch (ts->event) {
                 /*
                    Buttons - returned as a single byte
index 5d978d9718bc7a9b7121a77ad018db2af1e85a3c..d9009024ac53691d19467901229d5bdb48300801 100644 (file)
@@ -52,8 +52,6 @@ MODULE_AUTHOR("Franz Sirl <Franz.Sirl-kernel@lauterbach.com>");
 #define KEYB_LEDREG    2       /* register # for leds on ADB keyboard */
 #define MOUSE_DATAREG  0       /* reg# for movement/button codes from mouse */
 
-extern struct pt_regs *kbd_pt_regs;
-
 static int adb_message_handler(struct notifier_block *, unsigned long, void *);
 static struct notifier_block adbhid_adb_notifier = {
        .notifier_call  = adb_message_handler,
@@ -136,14 +134,13 @@ adbhid_keyboard_input(unsigned char *data, int nb, struct pt_regs *regs, int apo
        /* first check this is from register 0 */
        if (nb != 3 || (data[0] & 3) != KEYB_KEYREG)
                return;         /* ignore it */
-       kbd_pt_regs = regs;
-       adbhid_input_keycode(id, data[1], 0);
+       adbhid_input_keycode(id, data[1], 0, regs);
        if (!(data[2] == 0xff || (data[2] == 0x7f && data[1] == 0x7f)))
-               adbhid_input_keycode(id, data[2], 0);
+               adbhid_input_keycode(id, data[2], 0, regs);
 }
 
 static void
-adbhid_input_keycode(int id, int keycode, int repeat)
+adbhid_input_keycode(int id, int keycode, int repeat, pt_regs *regs)
 {
        int up_flag;
 
@@ -152,21 +149,24 @@ adbhid_input_keycode(int id, int keycode, int repeat)
 
        switch (keycode) {
        case 0x39: /* Generate down/up events for CapsLock everytime. */
+               input_regs(&adbhid[id]->input, regs);
                input_report_key(&adbhid[id]->input, KEY_CAPSLOCK, 1);
                input_report_key(&adbhid[id]->input, KEY_CAPSLOCK, 0);
+               input_sync(&adbhid[id]->input);
                return;
        case 0x3f: /* ignore Powerbook Fn key */
                return;
        }
 
-       if (adbhid[id]->keycode[keycode])
+       if (adbhid[id]->keycode[keycode]) {
+               input_regs(&adbhid[id]->input, regs);
                input_report_key(&adbhid[id]->input,
                                 adbhid[id]->keycode[keycode], !up_flag);
-       else
+               input_sync(&adbhid[id]->input);
+       } else
                printk(KERN_INFO "Unhandled ADB key (scancode %#02x) %s.\n", keycode,
                       up_flag ? "released" : "pressed");
 
-       input_sync(&adbhid[id]->input);
 }
 
 static void
@@ -253,6 +253,8 @@ adbhid_mouse_input(unsigned char *data, int nb, struct pt_regs *regs, int autopo
                 break;
        }
 
+       input_regs(&adbhid[id]->input, regs);
+
        input_report_key(&adbhid[id]->input, BTN_LEFT,   !((data[1] >> 7) & 1));
        input_report_key(&adbhid[id]->input, BTN_MIDDLE, !((data[2] >> 7) & 1));
 
@@ -277,6 +279,8 @@ adbhid_buttons_input(unsigned char *data, int nb, struct pt_regs *regs, int auto
                return;
        }
 
+       input_regs(&adbhid[id]->input, regs);
+
        switch (adbhid[id]->original_handler_id) {
        default:
        case 0x02: /* Adjustable keyboard button device */
index 4879bfd96356cf8c992b261d96165c28c0ba8fed..bf249dc55e438004d7bbd214f8cdd0a4cacd67d9 100644 (file)
@@ -527,7 +527,7 @@ static void receive_kbd_ms_chars(struct uart_sunsu_port *up, struct pt_regs *reg
                        }
                        kbd_pt_regs = regs;
 #ifdef CONFIG_SERIO
-                       serio_interrupt(&up->serio, ch, 0);
+                       serio_interrupt(&up->serio, ch, 0, regs);
 #endif
                } else if (up->su_type == SU_PORT_MS) {
                        int ret = suncore_mouse_baud_detection(ch, is_break);
@@ -541,7 +541,7 @@ static void receive_kbd_ms_chars(struct uart_sunsu_port *up, struct pt_regs *reg
 
                        case 0:
 #ifdef CONFIG_SERIO
-                               serio_interrupt(&up->serio, ch, 0);
+                               serio_interrupt(&up->serio, ch, 0, regs);
 #endif
                                break;
                        };
index 359a0c02652826cfe64084d87e5f87048b204707..ec18422c88372cd8c24aa98b6fd02cd64742d146 100644 (file)
@@ -303,7 +303,7 @@ static void sunzilog_kbdms_receive_chars(struct uart_sunzilog_port *up,
                }
                kbd_pt_regs = regs;
 #ifdef CONFIG_SERIO
-               serio_interrupt(&up->serio, ch, 0);
+               serio_interrupt(&up->serio, ch, 0, regs);
 #endif
        } else if (ZS_IS_MOUSE(up)) {
                int ret = suncore_mouse_baud_detection(ch, is_break);
@@ -317,7 +317,7 @@ static void sunzilog_kbdms_receive_chars(struct uart_sunzilog_port *up,
 
                case 0:
 #ifdef CONFIG_SERIO
-                       serio_interrupt(&up->serio, ch, 0);
+                       serio_interrupt(&up->serio, ch, 0, regs);
 #endif
                        break;
                };
index a40dd8132b8b26facea0e3f913573ee43b5f22c0..6379f83cd965ae0682983a159307ee4f516c4ba1 100644 (file)
@@ -155,6 +155,8 @@ aiptek_irq(struct urb *urb, struct pt_regs *regs)
                dbg("received unknown report #%d", data[0]);
        }
 
+       input_regs(dev, regs);
+
        proximity = data[5] & 0x01;
        input_report_key(dev, BTN_TOOL_PEN, proximity);
 
index dc77e786b5960cd85ea0b3fed3377895fcd877bb..e82310f4063219190ffacd45c1f5ba4f07d0a958 100644 (file)
@@ -773,13 +773,13 @@ static __inline__ int search(__s32 *array, __s32 value, unsigned n)
        return -1;
 }
 
-static void hid_process_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value)
+static void hid_process_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value, struct pt_regs *regs)
 {
        hid_dump_input(usage, value);
        if (hid->claimed & HID_CLAIMED_INPUT)
-               hidinput_hid_event(hid, field, usage, value);
+               hidinput_hid_event(hid, field, usage, value, regs);
        if (hid->claimed & HID_CLAIMED_HIDDEV)
-               hiddev_hid_event(hid, field, usage, value);
+               hiddev_hid_event(hid, field, usage, value, regs);
 }
 
 /*
@@ -788,7 +788,7 @@ static void hid_process_event(struct hid_device *hid, struct hid_field *field, s
  * reporting to the layer).
  */
 
-static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data)
+static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, struct pt_regs *regs)
 {
        unsigned n;
        unsigned count = field->report_count;
@@ -818,25 +818,25 @@ static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u
                        } else {
                                if (value[n] == field->value[n]) continue;
                        }       
-                       hid_process_event(hid, field, &field->usage[n], value[n]);
+                       hid_process_event(hid, field, &field->usage[n], value[n], regs);
                        continue;
                }
 
                if (field->value[n] >= min && field->value[n] <= max
                        && field->usage[field->value[n] - min].hid
                        && search(value, field->value[n], count))
-                               hid_process_event(hid, field, &field->usage[field->value[n] - min], 0);
+                               hid_process_event(hid, field, &field->usage[field->value[n] - min], 0, regs);
 
                if (value[n] >= min && value[n] <= max
                        && field->usage[value[n] - min].hid
                        && search(field->value, value[n], count))
-                               hid_process_event(hid, field, &field->usage[value[n] - min], 1);
+                               hid_process_event(hid, field, &field->usage[value[n] - min], 1, regs);
        }
 
        memcpy(field->value, value, count * sizeof(__s32));
 }
 
-static int hid_input_report(int type, struct urb *urb)
+static int hid_input_report(int type, struct urb *urb, struct pt_regs *regs)
 {
        struct hid_device *hid = urb->context;
        struct hid_report_enum *report_enum = hid->report_enum + type;
@@ -886,7 +886,7 @@ static int hid_input_report(int type, struct urb *urb)
                hiddev_report_event(hid, report);
 
        for (n = 0; n < report->maxfield; n++)
-               hid_input_field(hid, report->field[n], data);
+               hid_input_field(hid, report->field[n], data, regs);
 
        if (hid->claimed & HID_CLAIMED_INPUT)
                hidinput_report_event(hid, report);
@@ -905,7 +905,7 @@ static void hid_irq_in(struct urb *urb, struct pt_regs *regs)
 
        switch (urb->status) {
        case 0:                 /* success */
-               hid_input_report(HID_INPUT_REPORT, urb);
+               hid_input_report(HID_INPUT_REPORT, urb, regs);
                break;
        case -ECONNRESET:       /* unlink */
        case -ENOENT:
@@ -1130,7 +1130,7 @@ static void hid_ctrl(struct urb *urb, struct pt_regs *regs)
        spin_lock_irqsave(&hid->ctrllock, flags);
 
        if (hid->ctrl[hid->ctrltail].dir == USB_DIR_IN) 
-               hid_input_report(hid->ctrl[hid->ctrltail].report->type, urb);
+               hid_input_report(hid->ctrl[hid->ctrltail].report->type, urb, regs);
 
        hid->ctrltail = (hid->ctrltail + 1) & (HID_CONTROL_FIFO_SIZE - 1);
 
index 1fae2bc757fcbd70ecbadafabf0e9754f2d70182..259eacbf17dba3ac049359ed9d92480d35350534 100644 (file)
@@ -380,11 +380,13 @@ static void hidinput_configure_usage(struct hid_device *device, struct hid_field
        }
 }
 
-void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value)
+void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value, struct pt_regs *regs)
 {
        struct input_dev *input = &hid->input;
        int *quirks = &hid->quirks;
 
+       input_regs(input, regs);
+
        if (usage->hat_min != usage->hat_max) {
                value = (value - usage->hat_min) * 8 / (usage->hat_max - usage->hat_min + 1) + 1;
                if (value < 0 || value > 8) value = 0;
index 2672f12ada5a63df1cf1cfade6cbfe45eabf57ad..e0f73812cd7be3e6c4a73d22eab9ad04aa583b39 100644 (file)
@@ -420,13 +420,13 @@ struct hid_descriptor {
 /* Applications from HID Usage Tables 4/8/99 Version 1.1 */
 /* We ignore a few input applications that are not widely used */
 #define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || ( a == 0x00010080) || ( a == 0x000c0001))
-extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32);
+extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32, struct pt_regs *regs);
 extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report);
 extern int hidinput_connect(struct hid_device *);
 extern void hidinput_disconnect(struct hid_device *);
 #else
 #define IS_INPUT_APPLICATION(a) (0)
-static inline void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value) { }
+static inline void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value, struct pt_regs *regs) { }
 static inline void hidinput_report_event(struct hid_device *hid, struct hid_report *report) { }
 static inline int hidinput_connect(struct hid_device *hid) { return -ENODEV; }
 static inline void hidinput_disconnect(struct hid_device *hid) { }
index 1b19d5c0404fbe88d5bd8f3399e67e8c045d290b..5ec45879d78c51d9787a413f34035cd3b5f7891b 100644 (file)
@@ -180,7 +180,7 @@ static void hiddev_send_event(struct hid_device *hid,
  * the interrupt pipe
  */
 void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,
-                     struct hid_usage *usage, __s32 value)
+                     struct hid_usage *usage, __s32 value, struct pt_regs *regs)
 {
        unsigned type = field->report_type;
        struct hiddev_usage_ref uref;
index dfd55ce2f252557e52fefdba0c2d50dad5dcfc36..59e897fd2345da35633056c3033d52989bd74f37 100644 (file)
@@ -96,6 +96,7 @@ static void powermate_irq(struct urb *urb, struct pt_regs *regs)
        }
 
        /* handle updates to device state */
+       input_regs(&pm->input, regs);
        input_report_key(&pm->input, BTN_0, pm->data[0] & 0x01);
        input_report_rel(&pm->input, REL_DIAL, pm->data[1]);
        input_sync(&pm->input);
index 96d7b2301bbb814569f7ccb80a23a67aed8e50da..f9d89466c4a37a704d1f43c363882b170fbc33b4 100644 (file)
@@ -99,6 +99,8 @@ static void usb_kbd_irq(struct urb *urb, struct pt_regs *regs)
                goto resubmit;
        }
 
+       input_regs(&kbd->dev, regs);
+
        for (i = 0; i < 8; i++)
                input_report_key(&kbd->dev, usb_kbd_keycode[i + 224], (kbd->new[0] >> i) & 1);
 
index 9914ba86e8e765888456f6261966a90d991bcfc6..5cad58bd5e38055dffe5847f00d703856f3122ad 100644 (file)
@@ -76,6 +76,7 @@ static void usb_mouse_irq(struct urb *urb, struct pt_regs *regs)
                goto resubmit;
        }
 
+       input_regs(dev, regs);
 
        input_report_key(dev, BTN_LEFT,   data[0] & 0x01);
        input_report_key(dev, BTN_RIGHT,  data[0] & 0x02);
index efa3455f6cef95899b1efb737c7bf2899190fe2d..66e9122a6e7fbfb197fdfdaf8a5621822109ec89 100644 (file)
@@ -129,6 +129,8 @@ static void wacom_pl_irq(struct urb *urb, struct pt_regs *regs)
                dbg("received unknown report #%d", data[0]);
 
        prox = data[1] & 0x40;
+
+       input_regs(dev, regs);
        
        input_report_key(dev, BTN_TOOL_PEN, prox);
        
@@ -179,6 +181,7 @@ static void wacom_penpartner_irq(struct urb *urb, struct pt_regs *regs)
                goto exit;
        }
 
+       input_regs(dev, regs);
        input_report_key(dev, BTN_TOOL_PEN, 1);
        input_report_abs(dev, ABS_X, data[2] << 8 | data[1]);
        input_report_abs(dev, ABS_Y, data[4] << 8 | data[3]);
@@ -223,6 +226,8 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs)
        x = data[2] | ((__u32)data[3] << 8);
        y = data[4] | ((__u32)data[5] << 8);
 
+       input_regs(dev, regs);
+
        switch ((data[1] >> 5) & 3) {
 
                case 0: /* Pen */
@@ -294,6 +299,8 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
        if (data[0] != 2)
                dbg("received unknown report #%d", data[0]);
 
+       input_regs(dev, regs);
+
        /* tool number */
        idx = data[1] & 0x01;
 
index 7f4bcd75fc2f1e9216dbd892d47610611693bf0e..c8d448ae51acd2464f54dfecc726f79a737ba846 100644 (file)
@@ -124,9 +124,11 @@ struct usb_xpad {
  *      http://euc.jp/periphs/xbox-controller.ja.html
  */
 
-static void xpad_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned char *data)
+static void xpad_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned char *data, struct pt_regs *regs)
 {
        struct input_dev *dev = &xpad->dev;
+
+       input_regs(dev, regs);
        
        /* left stick */
        input_report_abs(dev, ABS_X, (__s16) (((__s16)data[13] << 8) | data[12]));
@@ -183,7 +185,7 @@ static void xpad_irq_in(struct urb *urb, struct pt_regs *regs)
                goto exit;
        }
        
-       xpad_process_packet(xpad, 0, xpad->idata);
+       xpad_process_packet(xpad, 0, xpad->idata, regs);
 
 exit:
        retval = usb_submit_urb (urb, GFP_ATOMIC);
index 244647dc22c4f11e93e23ca259c4ed0b4f857fc7..31fcc6d48eb22ad61b16f2676d689616f0a6b8b3 100644 (file)
@@ -62,8 +62,6 @@ static __inline__ int con_is_present(void)
        return serial_console ? 0 : 1;
 }
 
-extern struct pt_regs *kbd_pt_regs;
-
 /* When a context switch happens we must flush all user windows so that
  * the windows of the current process are flushed onto its stack. This
  * way the windows are all clean for the next process and the stack
index a4e088fec38a62bd937b4c891479220dd8890bca..c41ddfc89a2b43bb5de3aebac489f5b3d9d2d279 100644 (file)
@@ -131,8 +131,6 @@ static __inline__ int con_is_present(void)
        return serial_console ? 0 : 1;
 }
 
-extern struct pt_regs *kbd_pt_regs;
-
 extern void synchronize_user_stack(void);
 
 extern void __flushw_user(void);
index a2e1c8e09020f882ef285ab86ec15d1633d649e9..dc6d8dd843b58554706a5564dda0fee5ac8a5602 100644 (file)
@@ -204,7 +204,7 @@ struct hiddev_usage_ref {
 int hiddev_connect(struct hid_device *);
 void hiddev_disconnect(struct hid_device *);
 void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,
-                     struct hid_usage *usage, __s32 value);
+                     struct hid_usage *usage, __s32 value, struct pt_regs *regs);
 void hiddev_report_event(struct hid_device *hid, struct hid_report *report);
 int __init hiddev_init(void);
 void __exit hiddev_exit(void);
@@ -212,7 +212,7 @@ void __exit hiddev_exit(void);
 static inline int hiddev_connect(struct hid_device *hid) { return -1; }
 static inline void hiddev_disconnect(struct hid_device *hid) { }
 static inline void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,
-                     struct hid_usage *usage, __s32 value) { }
+                     struct hid_usage *usage, __s32 value, struct pt_regs *regs) { }
 static inline void hiddev_report_event(struct hid_device *hid, struct hid_report *report) { }
 static inline int hiddev_init(void) { return 0; }
 static inline void hiddev_exit(void) { }
index d3425c78d8222bc7ec8b0be854f628ac8fee0b83..5991c97b45cc55570771655a24b6a6f80f0fd192 100644 (file)
@@ -774,6 +774,7 @@ struct input_dev {
        struct timer_list timer;
 
        struct pm_dev *pm_dev;
+       struct pt_regs *regs;
        int state;
 
        int sync;
@@ -899,13 +900,15 @@ void input_unregister_minor(devfs_handle_t handle);
 
 void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);
 
-#define input_sync(a)          input_event(a, EV_SYN, SYN_REPORT, 0)
 #define input_report_key(a,b,c) input_event(a, EV_KEY, b, !!(c))
 #define input_report_rel(a,b,c) input_event(a, EV_REL, b, c)
 #define input_report_abs(a,b,c) input_event(a, EV_ABS, b, c)
 #define input_report_ff(a,b,c) input_event(a, EV_FF, b, c)
 #define input_report_ff_status(a,b,c)  input_event(a, EV_FF_STATUS, b, c)
 
+#define input_regs(a,b)                do { (a)->regs = (b); } while (0)
+#define input_sync(a)          do { input_event(a, EV_SYN, SYN_REPORT, 0); (a)->regs = NULL; } while (0)
+
 extern struct device_class input_devclass;
 
 #endif
index 2e45f82a554d75ddc20a1e94cb08f60b18593f87..751b0690668d3a866b2e9d6d61c8c8bed2456362 100644 (file)
  */
 
 #include <linux/ioctl.h>
-#include <linux/list.h>
 
 #define SPIOCSTYPE     _IOW('q', 0x01, unsigned long)
 
+#ifdef __KERNEL__
+
+#include <linux/list.h>
+
 struct serio;
 
 struct serio {
@@ -47,7 +50,7 @@ struct serio_dev {
        char *name;
 
        void (*write_wakeup)(struct serio *);
-       void (*interrupt)(struct serio *, unsigned char, unsigned int);
+       void (*interrupt)(struct serio *, unsigned char, unsigned int, struct pt_regs *);
        void (*connect)(struct serio *, struct serio_dev *dev);
        void (*disconnect)(struct serio *);
        void (*cleanup)(struct serio *);
@@ -58,7 +61,7 @@ struct serio_dev {
 int serio_open(struct serio *serio, struct serio_dev *dev);
 void serio_close(struct serio *serio);
 void serio_rescan(struct serio *serio);
-void serio_interrupt(struct serio *serio, unsigned char data, unsigned int flags);
+void serio_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs);
 
 void serio_register_port(struct serio *serio);
 void serio_unregister_port(struct serio *serio);
@@ -85,6 +88,8 @@ static __inline__ void serio_cleanup(struct serio *serio)
                serio->dev->cleanup(serio);
 }
 
+#endif
+
 /*
  * bit masks for use in "interrupt" flags (3rd argument)
  */