mmap problem another :)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux