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 18:08:19 +0200
    From:        Manuel Bouyer <bouyer%antioche.eu.org@localhost>
    Message-ID:  <20120917160819.GB25378%asim.lip6.fr@localhost>

  | that's what my patch does.

I have no real interest in the driver, so I hadn't looked in detail,
but in that case, is there any real need to change it?

  | Sorry but I can't see how a kernel with COMPAT_LINUX but without
  | mfi would compile.

The way I proposed it, it wouldn't, but given that we have control
of the mfi driver, we can do "interesting stuff" to its cdevsw.

As a storage device driver (that's what it is, right?) it wouldn't
normally have a d_tty, so you could give it one, and fill the
struct tty with identifying info (values that would make no sense
for a real tty device), and then test that instead.

eg; Its t_dev field could be absurd, its t_oproc could be set to
the same value as the d_stop in cdevsw (safe to call as long as the
2nd arg that d_stop is called with is ignored) and more...

In any case, there are certainly things that can be done to allow you
to directly test whether the driver you're using is a particular one
without building in knowledge of device numbers.

Even better might be to extend cdevsw with a field that gives the
driver name, that would probably be useful in all kinds of places.

kre


Home | Main Index | Thread Index | Old Index