[Top] [All Lists]

mmap problem another :)

Subject: mmap problem another :)
From: Dmitriy Tochansky <>
Date: Wed, 8 Dec 2004 19:40:14 +0300
Organization: Special Technology Center
Original-recipient: rfc822;
Ok. I did as you say and got that mmap func:

static int
mdrv_mmap (struct file *file, struct vm_area_struct *vma)
  unsigned long offset = 0;
  int ret;
  struct inode *inode;
  inode = file->f_dentry->d_inode;

  struct pci_dev *curdev = NULL;

  int minor = MINOR (inode->i_rdev);
  printk("minor = 0x%X\n",minor);

  curdev = (devs[minor]);

  unsigned long start = vma->vm_start;
  unsigned long size = (vma->vm_end - vma->vm_start);
  offset = pci_resource_start (curdev, IOMEM0);
  printk("offset = 0x%X\n",(unsigned int)offset);

  ret = remap_page_range_high (start, offset, size, vma->vm_page_prot);
  return ret;

And it works fine but... but when I try to do mmap not /dev/mboard0 but 
/dev/mboard1 Im again
have the "bad" result. :( Is there something specific to mmap several devices?

<Prev in Thread] Current Thread [Next in Thread>