On Tue, 2007-08-14 at 12:37 -0700, Edward Pilatowicz wrote:
> On Tue, Aug 14, 2007 at 11:41:14AM -0700, Artem Kachitchkine wrote:
> >
> > > There is no way to do this in the driver.
> > >
> > > By the time the driver is engaged, its too late, the name and bindings
> > > are chosen. You need to be able to change the bindings/names earlier.
> >
> > Perhaps understanding the problem better might give us some ideas.
> > Generally, driver names are completely insignificant. You should be able
> > to name and rename your driver module to literally anything, as long as
> > it does not conflict with other driver names. It just doesn't matter.
> >
> > What matters is what devices it exports to the system. A typical
> > character driver does that via ddi_create_minor_node(). Can a driver
> > named "foo" create minor nodes named "bar"? Of course it can. Should the
> > network link name hardwired to the driver name providing the link? Of
> > course it shouldn't. Kernel subsystems that propagate driver names too
> > far into userspace ain't doing it right.
> >
>
> hm. good insight.
>
> so a couple more random ideas... (i seem to have a lot of them after
> drinking coffee this morning. course i'm not saying that any of them
> are good, i'm just throwing them out.)
>
> this kind of name re-mapping could be hidden in gldv3. since i think
> that it is actually the gld framework that is calling
> ddi_create_minor_node() rather than the driver itself, right?
The problem is also *instance* numbers. You need to have separate
instance numbering namespaces. You cannot do that with just minor
numbers.
>
> another option would be to to have a single hme driver that attaches
> to all nodes, but when it detects that a node should be a qfe node
> it could not instantiate a new device minor node, but instead create
> a new pseudo device node that is bound to a "qfe" driver. that qfe
> node could be a gld based driver as well that creates qfe minor nodes
> in the system and routes requests to it's new minor node to the underlying
> hme driver node. (so the qfe node behaves kinda like a layered driver.)
>
> wow. did i just suggest that.
> i think i need to stop drinking coffee on an empty stomach.
Yikes.
I don't know about the ordering considerations here... but I do know
that the instance numbers come into play and are likely to wreak havoc.
Far better to have separate device drivers, to keep everything simple.
That's what I've done for SPARC... the qfe driver just calls into the
hme driver for its implementation, but gets a unique instance number
namespace.
-- Garrett
>
> ed
> _______________________________________________
> opensolaris-code mailing list
> [email protected]
> http://mail.opensolaris.org/mailman/listinfo/opensolaris-code
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code