Lines Matching refs:list

56 	struct mousedev_list *list;  member
89 struct mousedev_list *list; in mousedev_event() local
95 list = (*mousedev)->list; in mousedev_event()
96 while (list) { in mousedev_event()
104 list->dx += (value * xres - list->oldx) / size; in mousedev_event()
105 list->oldx += list->dx * size; in mousedev_event()
109 list->dy -= (value * yres - list->oldy) / size; in mousedev_event()
110 list->oldy -= list->dy * size; in mousedev_event()
117 case REL_X: list->dx += value; break; in mousedev_event()
118 case REL_Y: list->dy -= value; break; in mousedev_event()
119 case REL_WHEEL: if (list->mode) list->dz -= value; break; in mousedev_event()
129 case BTN_EXTRA: if (list->mode == 2) { index = 4; break; } in mousedev_event()
134 case BTN_SIDE: if (list->mode == 2) { index = 3; break; } in mousedev_event()
141 case 0: clear_bit(index, &list->buttons); break; in mousedev_event()
142 case 1: set_bit(index, &list->buttons); break; in mousedev_event()
148 list->ready = 1; in mousedev_event()
150 kill_fasync(&list->fasync, SIGIO, POLL_IN); in mousedev_event()
152 list = list->next; in mousedev_event()
163 struct mousedev_list *list = file->private_data; in mousedev_fasync() local
164 retval = fasync_helper(fd, file, on, &list->fasync); in mousedev_fasync()
170 struct mousedev_list *list = file->private_data; in mousedev_release() local
174 listptr = &list->mousedev->list; in mousedev_release()
177 while (*listptr && (*listptr != list)) in mousedev_release()
181 if (!--list->mousedev->open) { in mousedev_release()
182 if (list->mousedev->minor == MOUSEDEV_MIX) { in mousedev_release()
199 if (list->mousedev->exist) { in mousedev_release()
200 input_close_device(&list->mousedev->handle); in mousedev_release()
202 input_unregister_minor(list->mousedev->devfs); in mousedev_release()
203 mousedev_table[list->mousedev->minor] = NULL; in mousedev_release()
204 kfree(list->mousedev); in mousedev_release()
210 kfree(list); in mousedev_release()
218 struct mousedev_list *list; in mousedev_open() local
224 if (!(list = kmalloc(sizeof(struct mousedev_list), GFP_KERNEL))) in mousedev_open()
226 memset(list, 0, sizeof(struct mousedev_list)); in mousedev_open()
228 list->mousedev = mousedev_table[i]; in mousedev_open()
229 list->next = mousedev_table[i]->list; in mousedev_open()
230 mousedev_table[i]->list = list; in mousedev_open()
231 file->private_data = list; in mousedev_open()
233 if (!list->mousedev->open++) { in mousedev_open()
234 if (list->mousedev->minor == MOUSEDEV_MIX) { in mousedev_open()
245 if (list->mousedev->exist) in mousedev_open()
246 input_open_device(&list->mousedev->handle); in mousedev_open()
253 static void mousedev_packet(struct mousedev_list *list, unsigned char off) in mousedev_packet() argument
255 list->ps2[off] = 0x08 | ((list->dx < 0) << 4) | ((list->dy < 0) << 5) | (list->buttons & 0x07); in mousedev_packet()
256 list->ps2[off + 1] = (list->dx > 127 ? 127 : (list->dx < -127 ? -127 : list->dx)); in mousedev_packet()
257 list->ps2[off + 2] = (list->dy > 127 ? 127 : (list->dy < -127 ? -127 : list->dy)); in mousedev_packet()
258 list->dx -= list->ps2[off + 1]; in mousedev_packet()
259 list->dy -= list->ps2[off + 2]; in mousedev_packet()
260 list->bufsiz = off + 3; in mousedev_packet()
262 if (list->mode == 2) { in mousedev_packet()
263 list->ps2[off + 3] = (list->dz > 7 ? 7 : (list->dz < -7 ? -7 : list->dz)); in mousedev_packet()
264 list->dz -= list->ps2[off + 3]; in mousedev_packet()
265 list->ps2[off + 3] = (list->ps2[off + 3] & 0x0f) | ((list->buttons & 0x18) << 1); in mousedev_packet()
266 list->bufsiz++; in mousedev_packet()
269 if (list->mode == 1) { in mousedev_packet()
270 list->ps2[off + 3] = (list->dz > 127 ? 127 : (list->dz < -127 ? -127 : list->dz)); in mousedev_packet()
271 list->dz -= list->ps2[off + 3]; in mousedev_packet()
272 list->bufsiz++; in mousedev_packet()
275 if (!list->dx && !list->dy && (!list->mode || !list->dz)) list->ready = 0; in mousedev_packet()
276 list->buffer = list->bufsiz; in mousedev_packet()
282 struct mousedev_list *list = file->private_data; in mousedev_write() local
291 if (c == mousedev_imex_seq[list->imexseq]) { in mousedev_write()
292 if (++list->imexseq == MOUSEDEV_SEQ_LEN) { in mousedev_write()
293 list->imexseq = 0; in mousedev_write()
294 list->mode = 2; in mousedev_write()
296 } else list->imexseq = 0; in mousedev_write()
298 if (c == mousedev_imps_seq[list->impsseq]) { in mousedev_write()
299 if (++list->impsseq == MOUSEDEV_SEQ_LEN) { in mousedev_write()
300 list->impsseq = 0; in mousedev_write()
301 list->mode = 1; in mousedev_write()
303 } else list->impsseq = 0; in mousedev_write()
305 list->ps2[0] = 0xfa; in mousedev_write()
306 list->bufsiz = 1; in mousedev_write()
307 list->ready = 1; in mousedev_write()
312 mousedev_packet(list, 1); in mousedev_write()
316 switch (list->mode) { in mousedev_write()
317 case 0: list->ps2[1] = 0; break; in mousedev_write()
318 case 1: list->ps2[1] = 3; break; in mousedev_write()
319 case 2: list->ps2[1] = 4; break; in mousedev_write()
321 list->bufsiz = 2; in mousedev_write()
325 list->ps2[1] = 0x60; list->ps2[2] = 3; list->ps2[3] = 200; in mousedev_write()
326 list->bufsiz = 4; in mousedev_write()
330 list->buffer = list->bufsiz; in mousedev_write()
333 kill_fasync(&list->fasync, SIGIO, POLL_IN); in mousedev_write()
335 wake_up_interruptible(&list->mousedev->wait); in mousedev_write()
343 struct mousedev_list *list = file->private_data; in mousedev_read() local
346 if (!list->ready && !list->buffer) { in mousedev_read()
348 add_wait_queue(&list->mousedev->wait, &wait); in mousedev_read()
351 while (!list->ready) { in mousedev_read()
366 remove_wait_queue(&list->mousedev->wait, &wait); in mousedev_read()
372 if (!list->buffer) in mousedev_read()
373 mousedev_packet(list, 0); in mousedev_read()
375 if (count > list->buffer) in mousedev_read()
376 count = list->buffer; in mousedev_read()
378 if (copy_to_user(buffer, list->ps2 + list->bufsiz - list->buffer, count)) in mousedev_read()
381 list->buffer -= count; in mousedev_read()
389 struct mousedev_list *list = file->private_data; in mousedev_poll() local
390 poll_wait(file, &list->mousedev->wait, wait); in mousedev_poll()
391 if (list->ready || list->buffer) in mousedev_poll()