Lines Matching refs:list
41 struct hidraw_list *list = file->private_data; in hidraw_read() local
45 mutex_lock(&list->read_mutex); in hidraw_read()
48 if (list->head == list->tail) { in hidraw_read()
49 add_wait_queue(&list->hidraw->wait, &wait); in hidraw_read()
52 while (list->head == list->tail) { in hidraw_read()
57 if (!list->hidraw->exist) { in hidraw_read()
67 mutex_unlock(&list->read_mutex); in hidraw_read()
69 mutex_lock(&list->read_mutex); in hidraw_read()
74 remove_wait_queue(&list->hidraw->wait, &wait); in hidraw_read()
80 len = list->buffer[list->tail].len > count ? in hidraw_read()
81 count : list->buffer[list->tail].len; in hidraw_read()
83 if (list->buffer[list->tail].value) { in hidraw_read()
84 if (copy_to_user(buffer, list->buffer[list->tail].value, len)) { in hidraw_read()
91 kfree(list->buffer[list->tail].value); in hidraw_read()
92 list->buffer[list->tail].value = NULL; in hidraw_read()
93 list->tail = (list->tail + 1) & (HIDRAW_BUFFER_SIZE - 1); in hidraw_read()
96 mutex_unlock(&list->read_mutex); in hidraw_read()
251 struct hidraw_list *list = file->private_data; in hidraw_poll() local
254 poll_wait(file, &list->hidraw->wait, wait); in hidraw_poll()
255 if (list->head != list->tail) in hidraw_poll()
257 if (!list->hidraw->exist) in hidraw_poll()
266 struct hidraw_list *list; in hidraw_open() local
270 if (!(list = kzalloc(sizeof(struct hidraw_list), GFP_KERNEL))) { in hidraw_open()
297 list->hidraw = hidraw_table[minor]; in hidraw_open()
298 mutex_init(&list->read_mutex); in hidraw_open()
300 list_add_tail(&list->node, &hidraw_table[minor]->list); in hidraw_open()
302 file->private_data = list; in hidraw_open()
307 kfree(list); in hidraw_open()
314 struct hidraw_list *list = file->private_data; in hidraw_fasync() local
316 return fasync_helper(fd, file, on, &list->fasync); in hidraw_fasync()
347 struct hidraw_list *list = file->private_data; in hidraw_release() local
353 list_del(&list->node); in hidraw_release()
355 kfree(list); in hidraw_release()
510 struct hidraw_list *list; in hidraw_report_event() local
515 list_for_each_entry(list, &dev->list, node) { in hidraw_report_event()
516 int new_head = (list->head + 1) & (HIDRAW_BUFFER_SIZE - 1); in hidraw_report_event()
518 if (new_head == list->tail) in hidraw_report_event()
521 if (!(list->buffer[list->head].value = kmemdup(data, len, GFP_ATOMIC))) { in hidraw_report_event()
525 list->buffer[list->head].len = len; in hidraw_report_event()
526 list->head = new_head; in hidraw_report_event()
527 kill_fasync(&list->fasync, SIGIO, POLL_IN); in hidraw_report_event()
578 INIT_LIST_HEAD(&dev->list); in hidraw_connect()