From owner-freebsd-arch@FreeBSD.ORG Thu Feb 21 00:26:37 2008 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1023A16A406 for ; Thu, 21 Feb 2008 00:26:37 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id C44D313C459 for ; Thu, 21 Feb 2008 00:26:36 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 40C472085 for ; Thu, 21 Feb 2008 01:26:33 +0100 (CET) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: -0.3/3.0 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on tim.des.no Received: from ds4.des.no (des.no [80.203.243.180]) by smtp.des.no (Postfix) with ESMTP id 328B32049 for ; Thu, 21 Feb 2008 01:26:33 +0100 (CET) Received: by ds4.des.no (Postfix, from userid 1001) id 1CC4A84488; Thu, 21 Feb 2008 01:26:33 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: arch@freebsd.org References: <86odacc04t.fsf@ds4.des.no> <20080219233217.GS27248@funkthat.com> <86skznyf2a.fsf@ds4.des.no> <20080220234609.GB96595@funkthat.com> Date: Thu, 21 Feb 2008 01:26:32 +0100 In-Reply-To: <20080220234609.GB96595@funkthat.com> (John-Mark Gurney's message of "Wed\, 20 Feb 2008 15\:46\:09 -0800") Message-ID: <864pc3w3wn.fsf@ds4.des.no> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: dev.* analogue for interfaces X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2008 00:26:37 -0000 John-Mark Gurney writes: > Dag-Erling Smrgrav writes: > > John-Mark Gurney 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