Zimmer Sébastien wrote:
Hi community,
I was wondering about handling of ioctl on multiplexer. The small
architecture I have in mind is the following: StreamDriver <-> Module
<-> multiplexer. The driver is opened and the module is I_PUSH'ed on
it, then the muxer is opened and I_LINK'ed to the module. In another
process, I reopen the driver and try to send an ioctl request. It
fails and the encountered error is the following: "[Errno 22] Invalid
argument".
I already checked that the ioctl is correctly handled when the muxer
is not linked. I add a lot of debug logging and apparently the driver
does *not* receive a mblk of type M_IOCTL. So the first question is:
"why don't I receive a mblk of type M_IOCTL when the muxer is linked
?". Neither the muxer, nor the module, nor the driver ... is it
possible the stream framework is rejecting any ioctl for the linked
stream ?
I also though of a work-around for this problem. Maybe I can open the
muxer instead of the driver and the muxer would forward the ioctl to
the driver. However the forwarding wasn't mention in the stream
framework pdf, so I didn't implement it. I also fail to find any
reference to such a technique in the source of opensolaris, that's why
I'm asking: "Should the muxer forward the ioctl downstream ?". I don't
think so as it a driver (it should drop unknown ioctl) but it's a
special driver, so I'm a bit perplex here :)
I think that depends on the mux driver. mux drivers are weird. Some
times it can pass down an ioctl, but then it also needs to be prepared
to pass up the reply. And if the mux sends an ioctl down multiple
paths, it has to resolve multiple responses.
I've done work like this in the past... its not hard, but its not
trivial either. There are lots of edge cases.
Best bet is to avoid having to pass an ioctl thru a mux, if you have a
choice.
Last thing I tested. I open the driver and push the module on it. In
another process, I reopen the driver, push the module and link the
muxer. Then I used the first handle to the driver and send the ioctl
request and it works. So, driver and module ioctl handling are working
but it doesn't work anymore once I linked the muxer and reopen the
driver after the I_LINK.
I think we need more information about the mux driver you're working
with, and the anticipated plumbing. It could a bug in the the bottom
driver, as well (perhaps doing qreply to the wrong queue?)
-- Garrett
Thanks for any clue you can provide me with,
Sebastien
_______________________________________________
driver-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/driver-discuss
_______________________________________________
driver-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/driver-discuss