Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 37285
b: refs/heads/master
c: 4b60912
h: refs/heads/master
i:
  37283: f2b413c
v: v3
  • Loading branch information
David Moore authored and Stefan Richter committed Sep 17, 2006
1 parent 2d5585b commit 9e56733
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a1b3206b362335f7986d1fab294c16148a8c50ab
refs/heads/master: 4b60912e52bc6ccdf587f2b92f3435ee2678d730
38 changes: 37 additions & 1 deletion trunk/drivers/ieee1394/video1394.c
Original file line number Diff line number Diff line change
Expand Up @@ -1181,14 +1181,49 @@ static int video1394_mmap(struct file *file, struct vm_area_struct *vma)

lock_kernel();
if (ctx->current_ctx == NULL) {
PRINT(KERN_ERR, ctx->ohci->host->id, "Current iso context not set");
PRINT(KERN_ERR, ctx->ohci->host->id,
"Current iso context not set");
} else
res = dma_region_mmap(&ctx->current_ctx->dma, file, vma);
unlock_kernel();

return res;
}

static unsigned int video1394_poll(struct file *file, poll_table *pt)
{
struct file_ctx *ctx;
unsigned int mask = 0;
unsigned long flags;
struct dma_iso_ctx *d;
int i;

lock_kernel();
ctx = file->private_data;
d = ctx->current_ctx;
if (d == NULL) {
PRINT(KERN_ERR, ctx->ohci->host->id,
"Current iso context not set");
mask = POLLERR;
goto done;
}

poll_wait(file, &d->waitq, pt);

spin_lock_irqsave(&d->lock, flags);
for (i = 0; i < d->num_desc; i++) {
if (d->buffer_status[i] == VIDEO1394_BUFFER_READY) {
mask |= POLLIN | POLLRDNORM;
break;
}
}
spin_unlock_irqrestore(&d->lock, flags);
done:
unlock_kernel();

return mask;
}

static int video1394_open(struct inode *inode, struct file *file)
{
int i = ieee1394_file_to_instance(file);
Expand Down Expand Up @@ -1257,6 +1292,7 @@ static struct file_operations video1394_fops=
#ifdef CONFIG_COMPAT
.compat_ioctl = video1394_compat_ioctl,
#endif
.poll = video1394_poll,
.mmap = video1394_mmap,
.open = video1394_open,
.release = video1394_release
Expand Down

0 comments on commit 9e56733

Please sign in to comment.