aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/ibmasm/ibmasm.h
diff options
context:
space:
mode:
authorMax Asbock <masbock@us.ibm.com>2005-06-21 20:16:34 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-21 22:07:35 -0400
commit278d72ae8803ffcd16070c95fe1d53f4466dc741 (patch)
tree6cee233065ff15a42dfa86b7b159c4b06bb01b3f /drivers/misc/ibmasm/ibmasm.h
parentb8acb808468a88a188d7c5aba3681c583a5785f9 (diff)
[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.h65
1 files changed, 24 insertions, 41 deletions
diff --git a/drivers/misc/ibmasm/ibmasm.h b/drivers/misc/ibmasm/ibmasm.h
index 35c4def5af18..653a7d096a8b 100644
--- a/drivers/misc/ibmasm/ibmasm.h
+++ b/drivers/misc/ibmasm/ibmasm.h
@@ -34,16 +34,31 @@
34#include <linux/version.h> 34#include <linux/version.h>
35#include <linux/interrupt.h> 35#include <linux/interrupt.h>
36#include <linux/device.h> 36#include <linux/device.h>
37#include <linux/input.h>
37 38
38/* Driver identification */ 39/* Driver identification */
39#define DRIVER_NAME "ibmasm" 40#define DRIVER_NAME "ibmasm"
40#define DRIVER_VERSION "0.4" 41#define DRIVER_VERSION "1.0"
41#define DRIVER_AUTHOR "Max Asbock" 42#define DRIVER_AUTHOR "Max Asbock <masbock@us.ibm.com>, Vernon Mauery <vernux@us.ibm.com>"
42#define DRIVER_DESC "IBM ASM Service Processor Driver" 43#define DRIVER_DESC "IBM ASM Service Processor Driver"
43 44
44#define err(msg) printk(KERN_ERR "%s: " msg "\n", DRIVER_NAME) 45#define err(msg) printk(KERN_ERR "%s: " msg "\n", DRIVER_NAME)
45#define info(msg) printk(KERN_INFO "%s: " msg "\n", DRIVER_NAME) 46#define info(msg) printk(KERN_INFO "%s: " msg "\n", DRIVER_NAME)
46 47
48extern int ibmasm_debug;
49#define dbg(STR, ARGS...) \
50 do { \
51 if (ibmasm_debug) \
52 printk(KERN_DEBUG STR , ##ARGS); \
53 } while (0)
54
55static inline char *get_timestamp(char *buf)
56{
57 struct timeval now;
58 do_gettimeofday(&now);
59 sprintf(buf, "%lu.%lu", now.tv_sec, now.tv_usec);
60 return buf;
61}
47 62
48#define IBMASM_CMD_PENDING 0 63#define IBMASM_CMD_PENDING 0
49#define IBMASM_CMD_COMPLETE 1 64#define IBMASM_CMD_COMPLETE 1
@@ -121,41 +136,11 @@ struct reverse_heartbeat {
121 unsigned int stopped; 136 unsigned int stopped;
122}; 137};
123 138
124 139struct ibmasm_remote {
125/* remote console events */ 140 struct input_dev keybd_dev;
126struct mouse_event { 141 struct input_dev mouse_dev;
127 long x;
128 long y;
129 unsigned char buttons;
130 unsigned char transitions;
131}; 142};
132 143
133struct keyboard_event {
134 unsigned long key_code;
135 unsigned char key_down;
136};
137
138struct remote_event {
139 unsigned long type;
140 union {
141 struct mouse_event mouse;
142 struct keyboard_event keyboard;
143 } data;
144};
145
146#define DRIVER_REMOTE_QUEUE_SIZE 240
147
148struct remote_queue {
149 struct remote_event *start;
150 struct remote_event *end;
151 struct remote_event *reader;
152 struct remote_event *writer;
153 unsigned int size;
154 int open;
155 wait_queue_head_t wait;
156};
157
158
159struct service_processor { 144struct service_processor {
160 struct list_head node; 145 struct list_head node;
161 spinlock_t lock; 146 spinlock_t lock;
@@ -168,7 +153,7 @@ struct service_processor {
168 char dirname[IBMASM_NAME_SIZE]; 153 char dirname[IBMASM_NAME_SIZE];
169 char devname[IBMASM_NAME_SIZE]; 154 char devname[IBMASM_NAME_SIZE];
170 unsigned int number; 155 unsigned int number;
171 struct remote_queue remote_queue; 156 struct ibmasm_remote *remote;
172 int serial_line; 157 int serial_line;
173 struct device *dev; 158 struct device *dev;
174}; 159};
@@ -210,11 +195,9 @@ extern int ibmasm_send_i2o_message(struct service_processor *sp);
210extern irqreturn_t ibmasm_interrupt_handler(int irq, void * dev_id, struct pt_regs *regs); 195extern irqreturn_t ibmasm_interrupt_handler(int irq, void * dev_id, struct pt_regs *regs);
211 196
212/* remote console */ 197/* remote console */
213extern void ibmasm_handle_mouse_interrupt(struct service_processor *sp); 198extern void ibmasm_handle_mouse_interrupt(struct service_processor *sp, struct pt_regs *regs);
214extern int ibmasm_init_remote_queue(struct service_processor *sp); 199extern int ibmasm_init_remote_input_dev(struct service_processor *sp);
215extern void ibmasm_free_remote_queue(struct service_processor *sp); 200extern void ibmasm_free_remote_input_dev(struct service_processor *sp);
216extern void ibmasm_advance_reader(struct remote_queue *q, unsigned int n);
217extern size_t ibmasm_events_available(struct remote_queue *q);
218 201
219/* file system */ 202/* file system */
220extern int ibmasmfs_register(void); 203extern int ibmasmfs_register(void);