On Mon, Jun 02, 2008 at 07:45:04PM -0700, Garrett D'Amore wrote:
> If I had a device driver that, for reasons I won't go into here, needed
> to be STREAMS, could I then add a devmap(9E) entry point to additionally
> support mmap(2)?
>

off the top of my head, i can't think of any fundamental reasons why this
couldn't be made to work.  there might be some assumptions in the current
code that cause this to break, but these could be treated as bugs.

>
> My read of the code is that this will work for mmap(2) from userland
> applications, but not from kernel layered drivers using ldi_xxx.

the ldi will reject devmap/segmap operations on streams based devices.
that said, if it was necessary, i think the ldi could easily be modified
to allow these types of request to pass through.

> However, I suspect that this would represent "weird" functionality --
> quite likely never done before.  Am I entirely insane for even
> contemplating this?
>

it's kinda "weird" when you're comming from a streams vs char/block
device mentality.  but what really matters here are the interfaces
that are being used by applications, and not how the underlying driver
works.  given that there is an existing model to translate these
mmap() accesses into a data stream that can be consumed by a serial
type device, then supporting this doesn't seem like such a bad idea.

ed
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to