diff options
author | Max Asbock <masbock@us.ibm.com> | 2005-06-21 17:16:34 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-21 19:07:35 -0700 |
commit | 278d72ae8803ffcd16070c95fe1d53f4466dc741 (patch) | |
tree | 6cee233065ff15a42dfa86b7b159c4b06bb01b3f /drivers/misc/ibmasm/ibmasm.h | |
parent | b8acb808468a88a188d7c5aba3681c583a5785f9 (diff) | |
download | op-kernel-dev-278d72ae8803ffcd16070c95fe1d53f4466dc741.zip op-kernel-dev-278d72ae8803ffcd16070c95fe1d53f4466dc741.tar.gz |
[PATCH] ibmasm driver: redesign handling of remote control events
This patch rewrites the handling of remote control events. Rather than making
them available from a special file in the ibmasmfs, now the events from the
RSA card get translated into kernel input events and injected into the input
subsystem. The driver now will generate two /dev/input/eventX nodes -- one
for the keyboard and one for the mouse. The mouse node generates absolute
events more like a touch pad than a mouse.
Signed-off-by: Vernon Mauery <vernux@us.ibm.com>
Signed-off-by: Max Asbock <masbock@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/misc/ibmasm/ibmasm.h')
-rw-r--r-- | drivers/misc/ibmasm/ibmasm.h | 65 |
1 files changed, 24 insertions, 41 deletions
diff --git a/drivers/misc/ibmasm/ibmasm.h b/drivers/misc/ibmasm/ibmasm.h index 35c4def..653a7d0 100644 --- a/drivers/misc/ibmasm/ibmasm.h +++ b/drivers/misc/ibmasm/ibmasm.h @@ -34,16 +34,31 @@ #include <linux/version.h> #include <linux/interrupt.h> #include <linux/device.h> +#include <linux/input.h> /* Driver identification */ #define DRIVER_NAME "ibmasm" -#define DRIVER_VERSION "0.4" -#define DRIVER_AUTHOR "Max Asbock" +#define DRIVER_VERSION "1.0" +#define DRIVER_AUTHOR "Max Asbock <masbock@us.ibm.com>, Vernon Mauery <vernux@us.ibm.com>" #define DRIVER_DESC "IBM ASM Service Processor Driver" #define err(msg) printk(KERN_ERR "%s: " msg "\n", DRIVER_NAME) #define info(msg) printk(KERN_INFO "%s: " msg "\n", DRIVER_NAME) +extern int ibmasm_debug; +#define dbg(STR, ARGS...) \ + do { \ + if (ibmasm_debug) \ + printk(KERN_DEBUG STR , ##ARGS); \ + } while (0) + +static inline char *get_timestamp(char *buf) +{ + struct timeval now; + do_gettimeofday(&now); + sprintf(buf, "%lu.%lu", now.tv_sec, now.tv_usec); + return buf; +} #define IBMASM_CMD_PENDING 0 #define IBMASM_CMD_COMPLETE 1 @@ -121,41 +136,11 @@ struct reverse_heartbeat { unsigned int stopped; }; - -/* remote console events */ -struct mouse_event { - long x; - long y; - unsigned char buttons; - unsigned char transitions; +struct ibmasm_remote { + struct input_dev keybd_dev; + struct input_dev mouse_dev; }; -struct keyboard_event { - unsigned long key_code; - unsigned char key_down; -}; - -struct remote_event { - unsigned long type; - union { - struct mouse_event mouse; - struct keyboard_event keyboard; - } data; -}; - -#define DRIVER_REMOTE_QUEUE_SIZE 240 - -struct remote_queue { - struct remote_event *start; - struct remote_event *end; - struct remote_event *reader; - struct remote_event *writer; - unsigned int size; - int open; - wait_queue_head_t wait; -}; - - struct service_processor { struct list_head node; spinlock_t lock; @@ -168,7 +153,7 @@ struct service_processor { char dirname[IBMASM_NAME_SIZE]; char devname[IBMASM_NAME_SIZE]; unsigned int number; - struct remote_queue remote_queue; + struct ibmasm_remote *remote; int serial_line; struct device *dev; }; @@ -210,11 +195,9 @@ extern int ibmasm_send_i2o_message(struct service_processor *sp); extern irqreturn_t ibmasm_interrupt_handler(int irq, void * dev_id, struct pt_regs *regs); /* remote console */ -extern void ibmasm_handle_mouse_interrupt(struct service_processor *sp); -extern int ibmasm_init_remote_queue(struct service_processor *sp); -extern void ibmasm_free_remote_queue(struct service_processor *sp); -extern void ibmasm_advance_reader(struct remote_queue *q, unsigned int n); -extern size_t ibmasm_events_available(struct remote_queue *q); +extern void ibmasm_handle_mouse_interrupt(struct service_processor *sp, struct pt_regs *regs); +extern int ibmasm_init_remote_input_dev(struct service_processor *sp); +extern void ibmasm_free_remote_input_dev(struct service_processor *sp); /* file system */ extern int ibmasmfs_register(void); |