From owner-freebsd-arch@FreeBSD.ORG Tue Sep 30 11:23:06 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 214B216A4B3 for ; Tue, 30 Sep 2003 11:23:06 -0700 (PDT) Received: from mail.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id 920494400E for ; Tue, 30 Sep 2003 11:23:04 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 13306 invoked from network); 30 Sep 2003 18:23:03 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 30 Sep 2003 18:23:03 -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 h8UIMv6Y059221; Tue, 30 Sep 2003 14:22:58 -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: <20030930174815.GC31908@Odin.AC.HMC.Edu> Date: Tue, 30 Sep 2003 14:23:02 -0400 (EDT) From: John Baldwin To: Brooks Davis X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: arch@freebsd.org cc: Poul-Henning Kamp 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 18:23:06 -0000 On 30-Sep-2003 Brooks Davis wrote: > On Tue, Sep 30, 2003 at 01:14:39PM -0400, John Baldwin wrote: >> >> Fair enough. I think that Brooks planned to use a NULL device_t for >> interfaces w/o a backing new-bus device. However, that means you >> still need if_name for all the non-newbus devices, so this seems >> somewhat pointless if if_name is the only reason. Another counterpoint >> is that the new-bus namespace and the netif namespace aren't the same >> anyway and that seemed to be the point of this linkage. The >> dev_t <> softc <> device_t linkages aren't about unifying namespaces. > > The idea here is that virtually all uses of if_name/if_unit that aren't > just there for the users benefit are actually references to the > underlying driver not name of the interface. Currently they are the > same (i.e. ifname is nearly always device_get_name(dev) or a bug prone > manual version there of), but I would like to separate them so we can > rename interfaces. > > Since device_t is as close to a repository of driver/instance > information as we've got, I though using it would be a reasonable way > to go. As a side benefit, most drivers have a copy of it in their softc > already so you'd have a standard place to put it. > > I suppose a usable alternative would be to revive if_name and if_unit > as something like if_drvname and if_drvunit. Are these uses all within the driver itself? If so, then just giving ifnet a void * that is private to the driver would allow ifnet devices hung off of new-bus devices to cache their device_t w/o requiring the rest of the kernel to know what that private variable is. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/