Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Feb 2008 01:26:32 +0100
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        arch@freebsd.org
Subject:   Re: dev.* analogue for interfaces
Message-ID:  <864pc3w3wn.fsf@ds4.des.no>
In-Reply-To: <20080220234609.GB96595@funkthat.com> (John-Mark Gurney's message of "Wed\, 20 Feb 2008 15\:46\:09 -0800")
References:  <86odacc04t.fsf@ds4.des.no> <20080219233217.GS27248@funkthat.com> <86skznyf2a.fsf@ds4.des.no> <20080220234609.GB96595@funkthat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
John-Mark Gurney <jmg@funkthat.com> writes:
> Dag-Erling Smrgrav <des@des.no> writes:
> > John-Mark Gurney <jmg@funkthat.com> writes:
> > > My concern is that slowly adding them for each interface type could
> > > create some conflicts in both naming and location...
> > each interface type?  this would be done in if_attach() / if_detach(),
> > everything is taken care of centrally for all interfaces.
> I'm talking about any type of psuedo device.  Virtual web cams from
> the network, tty, disks, etc.  Any kernel interface that has a logical
> view to the user that is not backed by hardware....

Every disk has a device_t; ttys have some sort of driver attachment
since they have device nodes; I have no idea what you mean about a
"virtual web cam".

> And now new hardware devices could start using one or the other causing
> confusion in the future..  we should not allow that...  I know this isn't
> python, but python has some good guiding principals and one of them is:
> There should be one-- and preferably only one --obvious way to do it.

This is why Python is unusable for any real work.

> this adds two obvious ways to handle network interface backed by
> hardware sysctl data..

No, it simply allows the driver writer to make a mistake which can be
caught during code review.

> > Not all interfaces are devices.  That is the whole point...
> I'm confused about this, since below you say they are.

No, they're not.  Some are (if_fxp), some aren't (if_loop).  That is the
entire point.  If they were, we wouldn't be having this conversation.

> > Devices that aren't backed by hardware are still devices, they still
> > have a device_t, and they still have dev.* nodes; nexus is not backed by
> Oh, they do?  I don't see a dev.lo0 tree, or are we now talking about
> other devices?

lo0 is not a device.  It is a network interface.

> exactly, and I want a device_t for all devices (including psuedo
> interfaces, etc.) in the system...

That is your cross to bear, not mine...

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?864pc3w3wn.fsf>