kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* wrapper device driver
@ 2015-02-02 21:24 riya khanna
       [not found] ` <4796D93DD200E1498C487662EAD9C0DD11A5969F@MBXP14.ds.man.ac.uk>
  2015-02-02 22:02 ` Valdis.Kletnieks at vt.edu
  0 siblings, 2 replies; 15+ messages in thread
From: riya khanna @ 2015-02-02 21:24 UTC (permalink / raw)
  To: kernelnewbies

Hi,

I'm writing a device driver to to provide a wrapper device around a
real device. Is it acceptable to do the following:

wrapper_dev_open(flags) {
   // do additional bookkeeping
   real_dev_filp = filp_open(real_device_node_path, flags);
}

wrapper_dev_mmap(mmap_parameters) {
   // do additional checks
   return real_dev_filp->f_op->mmap(mmap_parameters);
}

wrapper_dev_ioctl(ioctl_parameters) {
   // do additional checks
   return real_dev_filp->f_op->ioctl(ioctl_parameters);
}

Is it safe to do something like this? what would be the caveats? Given
a good use case, would the maintainers be willing to mainstream
something like this? Thanks!

-Riya

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2015-02-03 20:18 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-02 21:24 wrapper device driver riya khanna
     [not found] ` <4796D93DD200E1498C487662EAD9C0DD11A5969F@MBXP14.ds.man.ac.uk>
2015-02-02 21:44   ` FW: " Malte Vesper
2015-02-02 22:05     ` riya khanna
2015-02-02 22:17       ` Greg KH
2015-02-02 22:46         ` riya khanna
2015-02-02 23:00           ` Greg KH
2015-02-02 23:50             ` riya khanna
2015-02-03  2:49               ` Valdis.Kletnieks at vt.edu
2015-02-03  3:09                 ` riya khanna
2015-02-03  3:15               ` Greg KH
2015-02-03 15:34                 ` riya khanna
2015-02-03 17:50                   ` Valdis.Kletnieks at vt.edu
2015-02-03 20:18                   ` Greg KH
2015-02-02 22:02 ` Valdis.Kletnieks at vt.edu
2015-02-02 22:04   ` riya khanna

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).