diff options
author | Holger Waechtler <devnull@localhost> | 2004-12-01 21:57:02 +0000 |
---|---|---|
committer | Holger Waechtler <devnull@localhost> | 2004-12-01 21:57:02 +0000 |
commit | 26a2e2f93573b9ce846c482853a7141322db40d3 (patch) | |
tree | b600363e7e260d5866a6daafb8bc4394d5dcaf3d | |
parent | 92d39bed40db683f5949b1bd4338c13d16f4f6dc (diff) | |
download | mediapointer-dvb-s2-26a2e2f93573b9ce846c482853a7141322db40d3.tar.gz mediapointer-dvb-s2-26a2e2f93573b9ce846c482853a7141322db40d3.tar.bz2 |
event fake
-rw-r--r-- | linux/drivers/media/dvb/cinergyT2/cinergyT2.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/linux/drivers/media/dvb/cinergyT2/cinergyT2.c b/linux/drivers/media/dvb/cinergyT2/cinergyT2.c index 7074dc469..eef2de260 100644 --- a/linux/drivers/media/dvb/cinergyT2/cinergyT2.c +++ b/linux/drivers/media/dvb/cinergyT2/cinergyT2.c @@ -139,6 +139,7 @@ struct cinergyt2 { struct work_struct query_work; wait_queue_head_t poll_wq; + int pending_fe_events; void *streambuf; dma_addr_t streambuf_dmahandle; @@ -614,6 +615,13 @@ static int cinergyt2_ioctl (struct inode *inode, struct file *file, * are trivial to fill as soon FE_GET_FRONTEND is done. */ struct dvb_frontend_event *e = (void *) arg; + if (cinergyt2->pending_fe_events == 0) { + if (file->f_flags & O_NONBLOCK) + return -EWOULDBLOCK; + wait_event_interruptible(cinergyt2->poll_wq, + cinergyt2->pending_fe_events > 0); + } + cinergyt2->pending_fe_events = 0; return cinergyt2_ioctl(inode, file, FE_READ_STATUS, (unsigned long) &e->status); } @@ -643,7 +651,7 @@ static int cinergyt2_mmap(struct file *file, struct vm_area_struct *vma) goto bailout; } - vma->vm_flags |= (VM_IO | VM_DONTCOPY); + vma->vm_flags |= (VM_IO | VM_DONTCOPY); vma->vm_file = file; ret = remap_pfn_range(vma, vma->vm_start, @@ -744,8 +752,10 @@ static void cinergyt2_query (void *data) unc += le32_to_cpu(s->uncorrected_block_count); s->uncorrected_block_count = unc; - if (lock_bits != s->lock_bits) + if (lock_bits != s->lock_bits) { wake_up_interruptible(&cinergyt2->poll_wq); + cinergyt2->pending_fe_events++; + } schedule_delayed_work(&cinergyt2->query_work, msecs_to_jiffies(QUERY_INTERVAL)); |