From owner-freebsd-net@FreeBSD.ORG Tue Sep 30 07:33:41 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 0D7AF16A4BF for ; Tue, 30 Sep 2003 07:33:41 -0700 (PDT) Received: from mail.speakeasy.net (mail16.speakeasy.net [216.254.0.216]) by mx1.FreeBSD.org (Postfix) with ESMTP id 11CAB43F75 for ; Tue, 30 Sep 2003 07:33:39 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 1033 invoked from network); 30 Sep 2003 14:33:38 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 30 Sep 2003 14:33:38 -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 h8UEXY6Y058230; Tue, 30 Sep 2003 10:33:35 -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: <20030930172536.U3713@gamplex.bde.org> Date: Tue, 30 Sep 2003 10:33:40 -0400 (EDT) From: John Baldwin To: Bruce Evans X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) 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 14:33:41 -0000 On 30-Sep-2003 Bruce Evans wrote: > On Mon, 29 Sep 2003, Brooks Davis wrote: > >> Six years and eight months ago, net/if.h was split into if.h and >> if_var.h. At the time, if_var.h was included at the end if if.h as >> follows (this is the current code, but it's equivalent): >> >> #ifdef _KERNEL >> struct thread; >> >> /* XXX - this should go away soon. */ >> #include >> #endif >> >> 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. >> 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 > for userland. In fact, including would just not work for > userland, since the declaration of device_t is only made in the _KERNEL > case, so use of it in struct ifnet (which is exported to userland for > some reason) would be a syntax error in userland whether or not > is included. Oops, doesn't include > in the !_KERNEL case, so the problem is a little different... 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. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/