Re: Device driver with multiple devices; reading issues...

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

 



Ok, I seem to be in a 'self-solving mood' today :)

I made an extra structure (pcitest_device) representing a device that
links the physical device to the minor number by:

---
int pcitest_open( struct inode *inode, struct file *filep )
{
  int num = MINOR( inode->i_rdev );

  filp->private_data = &pcitest_device[num];

  return 0;
}
---

I can now use the private_data pointer in the file struct to address
my specific card.

Seems like a good idea to me.

-Kris

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux