Lines Matching refs:list
49 struct hiddev_list *list; member
76 struct list_head *list; in hiddev_lookup_report() local
89 list = report_enum->report_list.next; in hiddev_lookup_report()
90 if (list == &report_enum->report_list) return NULL; in hiddev_lookup_report()
91 rinfo->report_id = ((struct hid_report *) list)->id; in hiddev_lookup_report()
95 list = (struct list_head *) in hiddev_lookup_report()
98 if (list == NULL) return NULL; in hiddev_lookup_report()
99 list = list->next; in hiddev_lookup_report()
100 if (list == &report_enum->report_list) return NULL; in hiddev_lookup_report()
101 rinfo->report_id = ((struct hid_report *) list)->id; in hiddev_lookup_report()
121 struct list_head *list; in hiddev_lookup_usage() local
129 list = report_enum->report_list.next; in hiddev_lookup_usage()
130 while (list != &report_enum->report_list) { in hiddev_lookup_usage()
131 report = (struct hid_report *) list; in hiddev_lookup_usage()
143 list = list->next; in hiddev_lookup_usage()
153 struct hiddev_list *list = hiddev->list; in hiddev_send_event() local
155 while (list) { in hiddev_send_event()
157 (list->flags & HIDDEV_FLAG_REPORT) != 0) { in hiddev_send_event()
158 list->buffer[list->head] = *uref; in hiddev_send_event()
159 list->head = (list->head + 1) & in hiddev_send_event()
161 kill_fasync(&list->fasync, SIGIO, POLL_IN); in hiddev_send_event()
164 list = list->next; in hiddev_send_event()
216 struct hiddev_list *list = file->private_data; in hiddev_fasync() local
217 retval = fasync_helper(fd, file, on, &list->fasync); in hiddev_fasync()
236 struct hiddev_list *list = file->private_data; in hiddev_release() local
239 listptr = &list->hiddev->list; in hiddev_release()
242 while (*listptr && (*listptr != list)) in hiddev_release()
246 if (!--list->hiddev->open) { in hiddev_release()
247 if (list->hiddev->exist) in hiddev_release()
248 hid_close(list->hiddev->hid); in hiddev_release()
250 hiddev_cleanup(list->hiddev); in hiddev_release()
253 kfree(list); in hiddev_release()
262 struct hiddev_list *list; in hiddev_open() local
269 if (!(list = kmalloc(sizeof(struct hiddev_list), GFP_KERNEL))) in hiddev_open()
271 memset(list, 0, sizeof(struct hiddev_list)); in hiddev_open()
273 list->hiddev = hiddev_table[i]; in hiddev_open()
274 list->next = hiddev_table[i]->list; in hiddev_open()
275 hiddev_table[i]->list = list; in hiddev_open()
277 file->private_data = list; in hiddev_open()
279 if (!list->hiddev->open++) in hiddev_open()
280 if (list->hiddev->exist) in hiddev_open()
302 struct hiddev_list *list = file->private_data; in hiddev_read() local
306 event_size = ((list->flags & HIDDEV_FLAG_UREF) != 0) ? in hiddev_read()
312 if (list->head == list->tail) { in hiddev_read()
313 add_wait_queue(&list->hiddev->wait, &wait); in hiddev_read()
316 while (list->head == list->tail) { in hiddev_read()
325 if (!list->hiddev->exist) { in hiddev_read()
335 remove_wait_queue(&list->hiddev->wait, &wait); in hiddev_read()
341 while (list->head != list->tail && in hiddev_read()
343 if ((list->flags & HIDDEV_FLAG_UREF) == 0) { in hiddev_read()
344 if (list->buffer[list->tail].field_index != in hiddev_read()
347 event.hid = list->buffer[list->tail].usage_code; in hiddev_read()
348 event.value = list->buffer[list->tail].value; in hiddev_read()
354 if (list->buffer[list->tail].field_index != HID_FIELD_INDEX_NONE || in hiddev_read()
355 (list->flags & HIDDEV_FLAG_REPORT) != 0) { in hiddev_read()
356 if (copy_to_user(buffer + retval, list->buffer + list->tail, sizeof(struct hiddev_usage_ref))) in hiddev_read()
361 list->tail = (list->tail + 1) & (HIDDEV_BUFFER_SIZE - 1); in hiddev_read()
375 struct hiddev_list *list = file->private_data; in hiddev_poll() local
376 poll_wait(file, &list->hiddev->wait, wait); in hiddev_poll()
377 if (list->head != list->tail) in hiddev_poll()
379 if (!list->hiddev->exist) in hiddev_poll()
393 struct hiddev_list *list = file->private_data; in hiddev_ioctl() local
394 struct hiddev *hiddev = list->hiddev; in hiddev_ioctl()
442 return put_user(list->flags, (int *) arg); in hiddev_ioctl()
455 list->flags = newflags; in hiddev_ioctl()