diff options
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 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 | ||
48 | extern int ibmasm_debug; | ||
49 | #define dbg(STR, ARGS...) \ | ||
50 | do { \ | ||
51 | if (ibmasm_debug) \ | ||
52 | printk(KERN_DEBUG STR , ##ARGS); \ | ||
53 | } while (0) | ||
54 | |||
55 | static 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 | 139 | struct ibmasm_remote { | |
125 | /* remote console events */ | 140 | struct input_dev keybd_dev; |
126 | struct 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 | ||
133 | struct keyboard_event { | ||
134 | unsigned long key_code; | ||
135 | unsigned char key_down; | ||
136 | }; | ||
137 | |||
138 | struct 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 | |||
148 | struct 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 | |||
159 | struct service_processor { | 144 | struct 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); | |||
210 | extern irqreturn_t ibmasm_interrupt_handler(int irq, void * dev_id, struct pt_regs *regs); | 195 | extern irqreturn_t ibmasm_interrupt_handler(int irq, void * dev_id, struct pt_regs *regs); |
211 | 196 | ||
212 | /* remote console */ | 197 | /* remote console */ |
213 | extern void ibmasm_handle_mouse_interrupt(struct service_processor *sp); | 198 | extern void ibmasm_handle_mouse_interrupt(struct service_processor *sp, struct pt_regs *regs); |
214 | extern int ibmasm_init_remote_queue(struct service_processor *sp); | 199 | extern int ibmasm_init_remote_input_dev(struct service_processor *sp); |
215 | extern void ibmasm_free_remote_queue(struct service_processor *sp); | 200 | extern void ibmasm_free_remote_input_dev(struct service_processor *sp); |
216 | extern void ibmasm_advance_reader(struct remote_queue *q, unsigned int n); | ||
217 | extern size_t ibmasm_events_available(struct remote_queue *q); | ||
218 | 201 | ||
219 | /* file system */ | 202 | /* file system */ |
220 | extern int ibmasmfs_register(void); | 203 | extern int ibmasmfs_register(void); |