tech-kern archive

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

Re: pass-through linux ioctl for mfi(4)

    Date:        Mon, 17 Sep 2012 17:47:08 +0200
    From:        Manuel Bouyer <>
    Message-ID:  <>

  | But this assumes that the mfi driver is compiled in. it doesn't
  | look right, especially in the context of modules.

Sure - the point is that you just do whatever the system would do
in order to call the ioctl() function, other than actually calling it,
to the point where you believe that it is the mfi driver, or that it

Of course, it doesn't need to be the d_ioctl that gets tested, you
could use anything that's in cdevsw[] - and you can test anything
that you can find (including the file name the module was dynamically
loaded from).

What you do now (if it is a module) is that it must have already been
loaded (because we have a fd that refers to it), so its functions are
all there to test.

Personally, I wouldn't test at all, I'[d just assume it is an mfi
if it is an mfi looking ioctl cmd, call the device's d_ioctl() in the
normal way (after doing whatever arg/cmd massaging is needed to get
from the compat interface to the native ioctl), and if it succeeds,
you're done, if it fails, you just revert to the original everything
and let whatever happens, happen (it wasn't mfi after all.)


Home | Main Index | Thread Index | Old Index