30 #include <linux/module.h>
31 #include <linux/gameport.h>
32 #include <linux/kernel.h>
35 #include <linux/slab.h>
37 #define DRIVER_DESC "Gameport data dumper module"
59 printk(
KERN_INFO "joydump: ,------------------ START ----------------.\n");
65 printk(
KERN_INFO "joydump: | Raw mode not available - trying cooked. |\n");
69 printk(
KERN_INFO "joydump: | Cooked not available either. Failing. |\n");
70 printk(
KERN_INFO "joydump: `------------------- END -----------------'\n");
74 gameport_cooked_read(gameport, axes, &buttons);
76 for (i = 0; i < 4; i++)
79 printk(
KERN_INFO "joydump: `------------------- END -----------------'\n");
82 timeout = gameport_time(gameport, 10000);
95 u = gameport_read(gameport);
101 gameport_trigger(gameport);
103 while (i <
BUF_SIZE && t < timeout) {
105 dump->
data = gameport_read(gameport);
107 if (dump->
data ^ u) {
126 printk(
KERN_INFO "joydump: >------------------ DATA -----------------<\n");
128 for (j = 7; j >= 0; j--)
133 for (i = 1; i <
t; i++, dump++, prev++) {
135 i, dump->time - prev->
time);
136 for (j = 7; j >= 0; j--)
137 printk(
"%d", (dump->data >> j) & 1);
143 printk(
KERN_INFO "joydump: `------------------- END -----------------'\n");
148 static void joydump_disconnect(
struct gameport *gameport)
158 .connect = joydump_connect,
159 .disconnect = joydump_disconnect,