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()
262 struct hiddev_list *list; in hiddev_open() local
274 if (!(list = vzalloc(sizeof(struct hiddev_list)))) in hiddev_open()
276 mutex_init(&list->thread_lock); in hiddev_open()
277 list->hiddev = hiddev; in hiddev_open()
278 file->private_data = list; in hiddev_open()
284 if (list->hiddev->exist) { in hiddev_open()
285 if (!list->hiddev->open++) { in hiddev_open()
295 spin_lock_irq(&list->hiddev->list_lock); in hiddev_open()
296 list_add_tail(&list->node, &hiddev->list); in hiddev_open()
297 spin_unlock_irq(&list->hiddev->list_lock); in hiddev_open()
300 if (!list->hiddev->open++) in hiddev_open()
301 if (list->hiddev->exist) { in hiddev_open()
318 vfree(list); in hiddev_open()
336 struct hiddev_list *list = file->private_data; in hiddev_read() local
340 event_size = ((list->flags & HIDDEV_FLAG_UREF) != 0) ? in hiddev_read()
347 retval = mutex_lock_interruptible(&list->thread_lock); in hiddev_read()
352 if (list->head == list->tail) { in hiddev_read()
353 prepare_to_wait(&list->hiddev->wait, &wait, TASK_INTERRUPTIBLE); in hiddev_read()
355 while (list->head == list->tail) { in hiddev_read()
360 if (!list->hiddev->exist) { in hiddev_read()
370 mutex_unlock(&list->thread_lock); in hiddev_read()
372 if (mutex_lock_interruptible(&list->thread_lock)) { in hiddev_read()
373 finish_wait(&list->hiddev->wait, &wait); in hiddev_read()
378 finish_wait(&list->hiddev->wait, &wait); in hiddev_read()
383 mutex_unlock(&list->thread_lock); in hiddev_read()
388 while (list->head != list->tail && in hiddev_read()
390 if ((list->flags & HIDDEV_FLAG_UREF) == 0) { in hiddev_read()
391 if (list->buffer[list->tail].field_index != HID_FIELD_INDEX_NONE) { in hiddev_read()
394 event.hid = list->buffer[list->tail].usage_code; in hiddev_read()
395 event.value = list->buffer[list->tail].value; in hiddev_read()
397 mutex_unlock(&list->thread_lock); in hiddev_read()
403 if (list->buffer[list->tail].field_index != HID_FIELD_INDEX_NONE || in hiddev_read()
404 (list->flags & HIDDEV_FLAG_REPORT) != 0) { in hiddev_read()
406 … if (copy_to_user(buffer + retval, list->buffer + list->tail, sizeof(struct hiddev_usage_ref))) { in hiddev_read()
407 mutex_unlock(&list->thread_lock); in hiddev_read()
413 list->tail = (list->tail + 1) & (HIDDEV_BUFFER_SIZE - 1); in hiddev_read()
417 mutex_unlock(&list->thread_lock); in hiddev_read()
428 struct hiddev_list *list = file->private_data; in hiddev_poll() local
430 poll_wait(file, &list->hiddev->wait, wait); in hiddev_poll()
431 if (list->head != list->tail) in hiddev_poll()
433 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()
907 INIT_LIST_HEAD(&hiddev->list); in hiddev_connect()