From owner-freebsd-arch@FreeBSD.ORG Tue Sep 30 10:56:46 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 6279C16A4B3; Tue, 30 Sep 2003 10:56:46 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1C0F944011; Tue, 30 Sep 2003 10:56:45 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h8UHufOP013248; Tue, 30 Sep 2003 19:56:42 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: Brooks Davis From: "Poul-Henning Kamp" In-Reply-To: Your message of "Tue, 30 Sep 2003 10:15:36 PDT." <20030930171535.GA31908@Odin.AC.HMC.Edu> Date: Tue, 30 Sep 2003 19:56:41 +0200 Message-ID: <13247.1064944601@critter.freebsd.dk> cc: arch@FreeBSD.org cc: net@FreeBSD.org cc: Vincent Jardin 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 17:56:46 -0000 In message <20030930171535.GA31908@Odin.AC.HMC.Edu>, Brooks Davis writes: >> Somebody please explain how this would work for non-hardware >> interfaces like if_loop, if_tun, if_tap etc ? > >if_dev would be NULL when a device_t was not available. Code which used >this feature would be required to either check that if_dev was non-NULL >before trying to use it or have special knowldege that it only gets >called with struct ifnet instances which have a non-NULL if_dev member. >For instance, driver routines which take a struct ifnet would know that >they are only called on their own ifnet so they could assume they had >filled it in. So you'd still have to keep the if_name + if_unit around for the drivers which do not have a device_t ? -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.