Lines Matching refs:list

63 	struct joydev_list *list;  member
115 struct joydev_list *list = joydev->list; in joydev_event() local
141 while (list) { in joydev_event()
143 memcpy(list->buffer + list->head, &event, sizeof(struct js_event)); in joydev_event()
145 if (list->startup == joydev->nabs + joydev->nkey) in joydev_event()
146 if (list->tail == (list->head = (list->head + 1) & (JOYDEV_BUFFER_SIZE - 1))) in joydev_event()
147 list->startup = 0; in joydev_event()
149 kill_fasync(&list->fasync, SIGIO, POLL_IN); in joydev_event()
151 list = list->next; in joydev_event()
160 struct joydev_list *list = file->private_data; in joydev_fasync() local
161 retval = fasync_helper(fd, file, on, &list->fasync); in joydev_fasync()
167 struct joydev_list *list = file->private_data; in joydev_release() local
171 listptr = &list->joydev->list; in joydev_release()
174 while (*listptr && (*listptr != list)) in joydev_release()
178 if (!--list->joydev->open) { in joydev_release()
179 if (list->joydev->exist) { in joydev_release()
180 input_close_device(&list->joydev->handle); in joydev_release()
182 input_unregister_minor(list->joydev->devfs); in joydev_release()
183 joydev_table[list->joydev->minor] = NULL; in joydev_release()
184 kfree(list->joydev); in joydev_release()
188 kfree(list); in joydev_release()
196 struct joydev_list *list; in joydev_open() local
202 if (!(list = kmalloc(sizeof(struct joydev_list), GFP_KERNEL))) in joydev_open()
204 memset(list, 0, sizeof(struct joydev_list)); in joydev_open()
206 list->joydev = joydev_table[i]; in joydev_open()
207 list->next = joydev_table[i]->list; in joydev_open()
208 joydev_table[i]->list = list; in joydev_open()
210 file->private_data = list; in joydev_open()
212 if (!list->joydev->open++) in joydev_open()
213 if (list->joydev->exist) in joydev_open()
214 input_open_device(&list->joydev->handle); in joydev_open()
227 struct joydev_list *list = file->private_data; in joydev_read() local
228 struct joydev *joydev = list->joydev; in joydev_read()
251 list->startup = 0; in joydev_read()
252 list->tail = list->head; in joydev_read()
257 if (list->head == list->tail && list->startup == joydev->nabs + joydev->nkey) { in joydev_read()
259 add_wait_queue(&list->joydev->wait, &wait); in joydev_read()
262 while (list->head == list->tail) { in joydev_read()
281 remove_wait_queue(&list->joydev->wait, &wait); in joydev_read()
287 while (list->startup < joydev->nabs + joydev->nkey && retval + sizeof(struct js_event) <= count) { in joydev_read()
293 if (list->startup < joydev->nkey) { in joydev_read()
295 event.number = list->startup; in joydev_read()
299 event.number = list->startup - joydev->nkey; in joydev_read()
306 list->startup++; in joydev_read()
310 while (list->head != list->tail && retval + sizeof(struct js_event) <= count) { in joydev_read()
312 if (copy_to_user(buf + retval, list->buffer + list->tail, sizeof(struct js_event))) in joydev_read()
315 list->tail = (list->tail + 1) & (JOYDEV_BUFFER_SIZE - 1); in joydev_read()
325 struct joydev_list *list = file->private_data; in joydev_poll() local
326 poll_wait(file, &list->joydev->wait, wait); in joydev_poll()
327 if (list->head != list->tail || list->startup < list->joydev->nabs + list->joydev->nkey) in joydev_poll()
334 struct joydev_list *list = file->private_data; in joydev_ioctl() local
335 struct joydev *joydev = list->joydev; in joydev_ioctl()