Lines Matching refs:list
62 struct list_head *list; in hiddev_lookup_report() local
79 list = report_enum->report_list.next; in hiddev_lookup_report()
80 report = list_entry(list, struct hid_report, list); in hiddev_lookup_report()
89 list = report->list.next; in hiddev_lookup_report()
90 if (list == &report_enum->report_list) in hiddev_lookup_report()
93 report = list_entry(list, struct hid_report, list); in hiddev_lookup_report()
123 list_for_each_entry(report, &report_enum->report_list, list) { in hiddev_lookup_usage()
144 struct hiddev_list *list; in hiddev_send_event() local
148 list_for_each_entry(list, &hiddev->list, node) { in hiddev_send_event()
150 (list->flags & HIDDEV_FLAG_REPORT) != 0) { in hiddev_send_event()
151 list->buffer[list->head] = *uref; in hiddev_send_event()
152 list->head = (list->head + 1) & in hiddev_send_event()
154 kill_fasync(&list->fasync, SIGIO, POLL_IN); in hiddev_send_event()
207 struct hiddev_list *list = file->private_data; in hiddev_fasync() local
209 return fasync_helper(fd, file, on, &list->fasync); in hiddev_fasync()
218 struct hiddev_list *list = file->private_data; in hiddev_release() local
221 spin_lock_irqsave(&list->hiddev->list_lock, flags); in hiddev_release()
222 list_del(&list->node); in hiddev_release()
223 spin_unlock_irqrestore(&list->hiddev->list_lock, flags); in hiddev_release()
225 mutex_lock(&list->hiddev->existancelock); in hiddev_release()
226 if (!--list->hiddev->open) { in hiddev_release()
227 if (list->hiddev->exist) { in hiddev_release()
228 hid_hw_close(list->hiddev->hid); in hiddev_release()
229 hid_hw_power(list->hiddev->hid, PM_HINT_NORMAL); in hiddev_release()
231 mutex_unlock(&list->hiddev->existancelock); in hiddev_release()
232 kfree(list->hiddev); in hiddev_release()
233 vfree(list); in hiddev_release()
238 mutex_unlock(&list->hiddev->existancelock); in hiddev_release()
239 vfree(list); in hiddev_release()
246 struct hiddev_list *list; in __hiddev_open() local
251 list = vzalloc(sizeof(*list)); in __hiddev_open()
252 if (!list) in __hiddev_open()
255 mutex_init(&list->thread_lock); in __hiddev_open()
256 list->hiddev = hiddev; in __hiddev_open()
269 list_add_tail(&list->node, &hiddev->list); in __hiddev_open()
272 file->private_data = list; in __hiddev_open()
280 vfree(list); in __hiddev_open()
322 struct hiddev_list *list = file->private_data; in hiddev_read() local
326 event_size = ((list->flags & HIDDEV_FLAG_UREF) != 0) ? in hiddev_read()
333 retval = mutex_lock_interruptible(&list->thread_lock); in hiddev_read()
338 if (list->head == list->tail) { in hiddev_read()
339 prepare_to_wait(&list->hiddev->wait, &wait, TASK_INTERRUPTIBLE); in hiddev_read()
341 while (list->head == list->tail) { in hiddev_read()
346 if (!list->hiddev->exist) { in hiddev_read()
356 mutex_unlock(&list->thread_lock); in hiddev_read()
358 if (mutex_lock_interruptible(&list->thread_lock)) { in hiddev_read()
359 finish_wait(&list->hiddev->wait, &wait); in hiddev_read()
364 finish_wait(&list->hiddev->wait, &wait); in hiddev_read()
369 mutex_unlock(&list->thread_lock); in hiddev_read()
374 while (list->head != list->tail && in hiddev_read()
376 if ((list->flags & HIDDEV_FLAG_UREF) == 0) { in hiddev_read()
377 if (list->buffer[list->tail].field_index != HID_FIELD_INDEX_NONE) { in hiddev_read()
380 event.hid = list->buffer[list->tail].usage_code; in hiddev_read()
381 event.value = list->buffer[list->tail].value; in hiddev_read()
383 mutex_unlock(&list->thread_lock); in hiddev_read()
389 if (list->buffer[list->tail].field_index != HID_FIELD_INDEX_NONE || in hiddev_read()
390 (list->flags & HIDDEV_FLAG_REPORT) != 0) { in hiddev_read()
392 … if (copy_to_user(buffer + retval, list->buffer + list->tail, sizeof(struct hiddev_usage_ref))) { in hiddev_read()
393 mutex_unlock(&list->thread_lock); in hiddev_read()
399 list->tail = (list->tail + 1) & (HIDDEV_BUFFER_SIZE - 1); in hiddev_read()
403 mutex_unlock(&list->thread_lock); in hiddev_read()
414 struct hiddev_list *list = file->private_data; in hiddev_poll() local
416 poll_wait(file, &list->hiddev->wait, wait); in hiddev_poll()
417 if (list->head != list->tail) in hiddev_poll()
419 if (!list->hiddev->exist) in hiddev_poll()
596 struct hiddev_list *list = file->private_data; in hiddev_ioctl() local
597 struct hiddev *hiddev = list->hiddev; in hiddev_ioctl()
660 r = put_user(list->flags, (int __user *)arg) ? in hiddev_ioctl()
678 list->flags = newflags; in hiddev_ioctl()
897 INIT_LIST_HEAD(&hiddev->list); in hiddev_connect()