Lines Matching refs:fh
43 struct lirc_fh *fh; in lirc_raw_event() local
79 list_for_each_entry(fh, &dev->lirc_fh, list) in lirc_raw_event()
80 kfifo_put(&fh->rawir, LIRC_SPACE(duration)); in lirc_raw_event()
98 list_for_each_entry(fh, &dev->lirc_fh, list) { in lirc_raw_event()
99 if (kfifo_put(&fh->rawir, sample)) in lirc_raw_event()
100 wake_up_poll(&fh->wait_poll, EPOLLIN | EPOLLRDNORM); in lirc_raw_event()
114 struct lirc_fh *fh; in lirc_scancode_event() local
119 list_for_each_entry(fh, &dev->lirc_fh, list) { in lirc_scancode_event()
120 if (kfifo_put(&fh->scancodes, *lsc)) in lirc_scancode_event()
121 wake_up_poll(&fh->wait_poll, EPOLLIN | EPOLLRDNORM); in lirc_scancode_event()
131 struct lirc_fh *fh = kzalloc(sizeof(*fh), GFP_KERNEL); in lirc_open() local
135 if (!fh) in lirc_open()
146 if (kfifo_alloc(&fh->rawir, MAX_IR_EVENT_SIZE, GFP_KERNEL)) { in lirc_open()
153 if (kfifo_alloc(&fh->scancodes, 32, GFP_KERNEL)) { in lirc_open()
159 fh->send_mode = LIRC_MODE_PULSE; in lirc_open()
160 fh->rc = dev; in lirc_open()
163 fh->rec_mode = LIRC_MODE_SCANCODE; in lirc_open()
165 fh->rec_mode = LIRC_MODE_MODE2; in lirc_open()
171 init_waitqueue_head(&fh->wait_poll); in lirc_open()
173 file->private_data = fh; in lirc_open()
175 list_add(&fh->list, &dev->lirc_fh); in lirc_open()
183 kfifo_free(&fh->scancodes); in lirc_open()
186 kfifo_free(&fh->rawir); in lirc_open()
188 kfree(fh); in lirc_open()
196 struct lirc_fh *fh = file->private_data; in lirc_close() local
197 struct rc_dev *dev = fh->rc; in lirc_close()
201 list_del(&fh->list); in lirc_close()
205 kfifo_free(&fh->rawir); in lirc_close()
207 kfifo_free(&fh->scancodes); in lirc_close()
208 kfree(fh); in lirc_close()
219 struct lirc_fh *fh = file->private_data; in lirc_transmit() local
220 struct rc_dev *dev = fh->rc; in lirc_transmit()
244 if (fh->send_mode == LIRC_MODE_SCANCODE) { in lirc_transmit()
364 struct lirc_fh *fh = file->private_data; in lirc_ioctl() local
365 struct rc_dev *dev = fh->rc; in lirc_ioctl()
426 val = fh->rec_mode; in lirc_ioctl()
446 fh->rec_mode = val; in lirc_ioctl()
453 val = fh->send_mode; in lirc_ioctl()
462 fh->send_mode = val; in lirc_ioctl()
496 ret = dev->s_rx_carrier_range(dev, fh->carrier_low, in lirc_ioctl()
506 fh->carrier_low = val; in lirc_ioctl()
584 struct lirc_fh *fh = file->private_data; in lirc_poll() local
585 struct rc_dev *rcdev = fh->rc; in lirc_poll()
588 poll_wait(file, &fh->wait_poll, wait); in lirc_poll()
593 if (fh->rec_mode == LIRC_MODE_SCANCODE && in lirc_poll()
594 !kfifo_is_empty(&fh->scancodes)) in lirc_poll()
597 if (fh->rec_mode == LIRC_MODE_MODE2 && in lirc_poll()
598 !kfifo_is_empty(&fh->rawir)) in lirc_poll()
608 struct lirc_fh *fh = file->private_data; in lirc_read_mode2() local
609 struct rc_dev *rcdev = fh->rc; in lirc_read_mode2()
617 if (kfifo_is_empty(&fh->rawir)) { in lirc_read_mode2()
621 ret = wait_event_interruptible(fh->wait_poll, in lirc_read_mode2()
622 !kfifo_is_empty(&fh->rawir) || in lirc_read_mode2()
634 ret = kfifo_to_user(&fh->rawir, buffer, length, &copied); in lirc_read_mode2()
646 struct lirc_fh *fh = file->private_data; in lirc_read_scancode() local
647 struct rc_dev *rcdev = fh->rc; in lirc_read_scancode()
656 if (kfifo_is_empty(&fh->scancodes)) { in lirc_read_scancode()
660 ret = wait_event_interruptible(fh->wait_poll, in lirc_read_scancode()
661 !kfifo_is_empty(&fh->scancodes) || in lirc_read_scancode()
673 ret = kfifo_to_user(&fh->scancodes, buffer, length, &copied); in lirc_read_scancode()
685 struct lirc_fh *fh = file->private_data; in lirc_read() local
686 struct rc_dev *rcdev = fh->rc; in lirc_read()
694 if (fh->rec_mode == LIRC_MODE_MODE2) in lirc_read()
775 struct lirc_fh *fh; in lirc_unregister() local
781 list_for_each_entry(fh, &dev->lirc_fh, list) in lirc_unregister()
782 wake_up_poll(&fh->wait_poll, EPOLLHUP | EPOLLERR); in lirc_unregister()
819 struct lirc_fh *fh; in rc_dev_get_from_fd() local
831 fh = fd_file(f)->private_data; in rc_dev_get_from_fd()
832 dev = fh->rc; in rc_dev_get_from_fd()