On 9/19/07, kevin liu <[EMAIL PROTECTED]> wrote:
> Dear Markus:
> In em28xx-video.c, when you design memory map function,
> You used this state:
> ++++++++
> for(i=0; i<dev->num_frames; i++){
> if(dev->frame[i].buf.m.offset >> PAGE_SHIFT == vma->pgoff)
> break;
> }
> ++++++++
> Why dev->frame[i].buf.m.off>>PAGE_SHIFT == vma->pgoff;
it's just a check if vma->pgoff is out of range or not
> I see the mmap function implemented in Linux device driver3, it is like
> this:
> if(remap_pfn_range(vma, vma_start, vm->vm_pgoff, vma_size,
> vma->vm_page_prot))
> return -EAGAIN;
> ......
> ......
>
> And where did the frame[i].buf come from?
/* frames */
struct em28xx_frame_t {
void *bufmem;
struct v4l2_buffer buf;
enum em28xx_frame_state state;
struct list_head frame;
unsigned long vma_use_count;
int top_field;
int fieldbytesused;
};
> Could you please give me some explanation?
You hit the first part of the book which isn't uptodate anymore :-)
http://groups.google.de/group/linux.kernel/browse_thread/thread/d5cdcf4d9212178f/965817de9083403e?hl=de&lnk=st&q=remap_pfn_range+vm_insert_page&rnum=4#965817de9083403e
Markus
_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb