Lines Matching refs:list
75 struct list_head *list; in hiddev_lookup_report() local
92 list = report_enum->report_list.next; in hiddev_lookup_report()
93 report = list_entry(list, struct hid_report, list); in hiddev_lookup_report()
102 list = report->list.next; in hiddev_lookup_report()
103 if (list == &report_enum->report_list) in hiddev_lookup_report()
106 report = list_entry(list, struct hid_report, list); in hiddev_lookup_report()
136 list_for_each_entry(report, &report_enum->report_list, list) { in hiddev_lookup_usage()
157 struct hiddev_list *list; in hiddev_send_event() local
161 list_for_each_entry(list, &hiddev->list, node) { in hiddev_send_event()
163 (list->flags & HIDDEV_FLAG_REPORT) != 0) { in hiddev_send_event()
164 list->buffer[list->head] = *uref; in hiddev_send_event()
165 list->head = (list->head + 1) & in hiddev_send_event()
167 kill_fasync(&list->fasync, SIGIO, POLL_IN); in hiddev_send_event()
220 struct hiddev_list *list = file->private_data; in hiddev_fasync() local
222 return fasync_helper(fd, file, on, &list->fasync); in hiddev_fasync()
231 struct hiddev_list *list = file->private_data; in hiddev_release() local
234 spin_lock_irqsave(&list->hiddev->list_lock, flags); in hiddev_release()
235 list_del(&list->node); in hiddev_release()
236 spin_unlock_irqrestore(&list->hiddev->list_lock, flags); in hiddev_release()
238 mutex_lock(&list->hiddev->existancelock); in hiddev_release()
239 if (!--list->hiddev->open) { in hiddev_release()
240 if (list->hiddev->exist) { in hiddev_release()
241 hid_hw_close(list->hiddev->hid); in hiddev_release()
242 hid_hw_power(list->hiddev->hid, PM_HINT_NORMAL); in hiddev_release()
244 mutex_unlock(&list->hiddev->existancelock); in hiddev_release()
245 kfree(list->hiddev); in hiddev_release()
246 vfree(list); in hiddev_release()
251 mutex_unlock(&list->hiddev->existancelock); in hiddev_release()
252 vfree(list); in hiddev_release()
259 struct hiddev_list *list; in __hiddev_open() local
264 list = vzalloc(sizeof(*list)); in __hiddev_open()
265 if (!list) in __hiddev_open()
268 mutex_init(&list->thread_lock); in __hiddev_open()
269 list->hiddev = hiddev; in __hiddev_open()
282 list_add_tail(&list->node, &hiddev->list); in __hiddev_open()
285 file->private_data = list; in __hiddev_open()
293 vfree(list); in __hiddev_open()
335 struct hiddev_list *list = file->private_data; in hiddev_read() local
339 event_size = ((list->flags & HIDDEV_FLAG_UREF) != 0) ? in hiddev_read()
346 retval = mutex_lock_interruptible(&list->thread_lock); in hiddev_read()
351 if (list->head == list->tail) { in hiddev_read()
352 prepare_to_wait(&list->hiddev->wait, &wait, TASK_INTERRUPTIBLE); in hiddev_read()
354 while (list->head == list->tail) { in hiddev_read()
359 if (!list->hiddev->exist) { in hiddev_read()
369 mutex_unlock(&list->thread_lock); in hiddev_read()
371 if (mutex_lock_interruptible(&list->thread_lock)) { in hiddev_read()
372 finish_wait(&list->hiddev->wait, &wait); in hiddev_read()
377 finish_wait(&list->hiddev->wait, &wait); in hiddev_read()
382 mutex_unlock(&list->thread_lock); in hiddev_read()
387 while (list->head != list->tail && in hiddev_read()
389 if ((list->flags & HIDDEV_FLAG_UREF) == 0) { in hiddev_read()
390 if (list->buffer[list->tail].field_index != HID_FIELD_INDEX_NONE) { in hiddev_read()
393 event.hid = list->buffer[list->tail].usage_code; in hiddev_read()
394 event.value = list->buffer[list->tail].value; in hiddev_read()
396 mutex_unlock(&list->thread_lock); in hiddev_read()
402 if (list->buffer[list->tail].field_index != HID_FIELD_INDEX_NONE || in hiddev_read()
403 (list->flags & HIDDEV_FLAG_REPORT) != 0) { in hiddev_read()
405 … if (copy_to_user(buffer + retval, list->buffer + list->tail, sizeof(struct hiddev_usage_ref))) { in hiddev_read()
406 mutex_unlock(&list->thread_lock); in hiddev_read()
412 list->tail = (list->tail + 1) & (HIDDEV_BUFFER_SIZE - 1); in hiddev_read()
416 mutex_unlock(&list->thread_lock); in hiddev_read()
427 struct hiddev_list *list = file->private_data; in hiddev_poll() local
429 poll_wait(file, &list->hiddev->wait, wait); in hiddev_poll()
430 if (list->head != list->tail) in hiddev_poll()
432 if (!list->hiddev->exist) in hiddev_poll()
609 struct hiddev_list *list = file->private_data; in hiddev_ioctl() local
610 struct hiddev *hiddev = list->hiddev; in hiddev_ioctl()
673 r = put_user(list->flags, (int __user *)arg) ? in hiddev_ioctl()
691 list->flags = newflags; in hiddev_ioctl()
920 INIT_LIST_HEAD(&hiddev->list); in hiddev_connect()