From owner-freebsd-arch@FreeBSD.ORG Tue Sep 30 07:33:48 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5D4C116A4B3 for ; Tue, 30 Sep 2003 07:33:48 -0700 (PDT) Received: from mail.speakeasy.net (mail9.speakeasy.net [216.254.0.209]) by mx1.FreeBSD.org (Postfix) with ESMTP id CA46243F85 for ; Tue, 30 Sep 2003 07:33:46 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 28020 invoked from network); 30 Sep 2003 14:33:46 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 30 Sep 2003 14:33:46 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.9/8.12.9) with ESMTP id h8UEXg6Y058235; Tue, 30 Sep 2003 10:33:43 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <8475.1064905854@critter.freebsd.dk> Date: Tue, 30 Sep 2003 10:33:48 -0400 (EDT) From: John Baldwin To: Poul-Henning Kamp X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: arch@freebsd.org cc: Vincent Jardin cc: net@freebsd.org Subject: Re: adding if_dev member to struct ifnet X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 14:33:48 -0000 On 30-Sep-2003 Poul-Henning Kamp wrote: > In message <200309301045.15776.vjardin@wanadoo.fr>, Vincent Jardin writes: >>Le Mardi 30 Septembre 2003 03:03, Brooks Davis a écrit : >>> [Previously posted to -net in another form.] >>> >>> I propose to add an if_dev member to struct ifnet. It would be of type >>> device_t and be defined to point to the device for the interface or NULL >>> if there is no device (or if there was not an easy way to get access to >>> one). >>> >>> This change would codify the the relationship between an interface and >>> the underlying physical device. It also would get rid of the existing >>> abuses of if_name to look up the driver associated with an interface >>> and simplify a number of messy cases in the conversion from if_unit and >>> if_name to if_xname. >>> >>> Does this seem like a reasonable thing to do? >> >>Yes, if it helps to remove if_name/if_unit, it is a thing to do. Moreover it >>sounds a good idea to have the if_dev field into the ifnet structure. > > Somebody please explain how this would work for non-hardware > interfaces like if_loop, if_tun, if_tap etc ? > > device_t is what we use to hitch drivers to hardware. > > ifnet is what we use to hitch drivers to the netstack. > > They should not be tangled. You mean like dev_t and device_t shouldn't be tangled like we do with si_drv1? Oh, wait... -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/