From owner-freebsd-net@FreeBSD.ORG Tue Sep 30 08:30:46 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B657D16A4BF; Tue, 30 Sep 2003 08:30:46 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id E0F9344013; Tue, 30 Sep 2003 08:30:41 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id BAA17679; Wed, 1 Oct 2003 01:30:30 +1000 Date: Wed, 1 Oct 2003 01:29:07 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: John Baldwin In-Reply-To: Message-ID: <20031001011119.U1245@gamplex.bde.org> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@freebsd.org cc: net@freebsd.org Subject: Re: finishing the if.h/if_var.h split X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 15:30:46 -0000 On Tue, 30 Sep 2003, John Baldwin wrote: > On 30-Sep-2003 Bruce Evans wrote: > > On Mon, 29 Sep 2003, Brooks Davis wrote: > >> Unfortunately, "soon" hasn't happened yet and it is now tripping me > >> up. To add the if_dev member to struct ifnet (see the forthcoming > >> post on that subject), it is necessary for sys/bus.h to be included in > >> net/if_var.h > > > > That would be namespace pollution, so it is not permitted :-). Requiring > > all files that include (and especially to > > include would be interface breakage so it is even less > > permitted. > > Well, if if.h stops including if_var.h, then only kernel files that > include net/if_var.h would need sys/bus.h. I think that's manageable. All userland files that include net/if_var.h would also need it (except they would only need device_t). > >> which in turn requires that if_var.h NOT be included in > >> genassym.c. > > > > Do you mean in userland? There don't seem to be any immediate problems > > for genassym.c or any other file in the kernel from including > > unconditionally in . However, the pollution may be harmful > ... > The problem is that the newbus foo_if.h files don't exist when genassym > is compiled and used. sys/bus.h needs bus_if.h and device_if.h, hence > the breakage. I see. This is a bug in the dependencies for genassym.o and .depend. "make depend" creates *_if.h but it also creates genassym.o. There aren't enough dependencies so the order is mostly accidental. genassym.o happens to get created first, so it doesn't compile unless *_if.h already exist. Bruce