Lines Matching refs:mousedev
51 struct mousedev { struct
63 struct mousedev *mousedev; member
79 static struct mousedev *mousedev_table[MOUSEDEV_MINORS];
80 static struct mousedev mousedev_mix;
87 struct mousedev *mousedevs[3] = { handle->private, &mousedev_mix, NULL }; in mousedev_event()
88 struct mousedev **mousedev = mousedevs; in mousedev_event() local
94 while (*mousedev) { in mousedev_event()
95 list = (*mousedev)->list; in mousedev_event()
155 wake_up_interruptible(&((*mousedev)->wait)); in mousedev_event()
156 mousedev++; in mousedev_event()
174 listptr = &list->mousedev->list; in mousedev_release()
181 if (!--list->mousedev->open) { in mousedev_release()
182 if (list->mousedev->minor == MOUSEDEV_MIX) { in mousedev_release()
185 struct mousedev *mousedev = handle->private; in mousedev_release() local
186 if (!mousedev->open) { in mousedev_release()
187 if (mousedev->exist) { in mousedev_release()
188 input_close_device(&mousedev->handle); in mousedev_release()
190 input_unregister_minor(mousedev->devfs); in mousedev_release()
191 mousedev_table[mousedev->minor] = NULL; in mousedev_release()
192 kfree(mousedev); 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()
228 list->mousedev = mousedev_table[i]; in mousedev_open()
233 if (!list->mousedev->open++) { in mousedev_open()
234 if (list->mousedev->minor == MOUSEDEV_MIX) { in mousedev_open()
237 struct mousedev *mousedev = handle->private; in mousedev_open() local
238 if (!mousedev->open) in mousedev_open()
239 if (mousedev->exist) in mousedev_open()
245 if (list->mousedev->exist) in mousedev_open()
246 input_open_device(&list->mousedev->handle); in mousedev_open()
335 wake_up_interruptible(&list->mousedev->wait); in mousedev_write()
348 add_wait_queue(&list->mousedev->wait, &wait); in mousedev_read()
366 remove_wait_queue(&list->mousedev->wait, &wait); in mousedev_read()
390 poll_wait(file, &list->mousedev->wait, wait); in mousedev_poll()
408 struct mousedev *mousedev; in mousedev_connect() local
428 if (!(mousedev = kmalloc(sizeof(struct mousedev), GFP_KERNEL))) in mousedev_connect()
430 memset(mousedev, 0, sizeof(struct mousedev)); in mousedev_connect()
431 init_waitqueue_head(&mousedev->wait); in mousedev_connect()
433 mousedev->exist = 1; in mousedev_connect()
434 mousedev->minor = minor; in mousedev_connect()
435 mousedev_table[minor] = mousedev; in mousedev_connect()
437 mousedev->handle.dev = dev; in mousedev_connect()
438 mousedev->handle.handler = handler; in mousedev_connect()
439 mousedev->handle.private = mousedev; in mousedev_connect()
441 mousedev->devfs = input_register_minor("mouse%d", minor, MOUSEDEV_MINOR_BASE); in mousedev_connect()
444 input_open_device(&mousedev->handle); in mousedev_connect()
448 return &mousedev->handle; in mousedev_connect()
453 struct mousedev *mousedev = handle->private; in mousedev_disconnect() local
455 mousedev->exist = 0; in mousedev_disconnect()
457 if (mousedev->open) { in mousedev_disconnect()
462 input_unregister_minor(mousedev->devfs); in mousedev_disconnect()
463 mousedev_table[mousedev->minor] = NULL; in mousedev_disconnect()
464 kfree(mousedev); in mousedev_disconnect()
480 memset(&mousedev_mix, 0, sizeof(struct mousedev)); in mousedev_init()