From owner-freebsd-net@FreeBSD.ORG Wed Jun 16 16:54:09 2004 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 428DC16A4CE for ; Wed, 16 Jun 2004 16:54:09 +0000 (GMT) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id F064F43D49 for ; Wed, 16 Jun 2004 16:54:08 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.9p1/8.12.8) with ESMTP id i5GGrcgd047382; Wed, 16 Jun 2004 09:53:38 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.9p1/8.12.3/Submit) id i5GGrcdK047381; Wed, 16 Jun 2004 09:53:38 -0700 (PDT) (envelope-from rizzo) Date: Wed, 16 Jun 2004 09:53:38 -0700 From: Luigi Rizzo To: freebsd-net@freebsd.org Message-ID: <20040616095338.A46666@xorpc.icir.org> References: <20040616132405.GB37246@empiric.dek.spc.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20040616132405.GB37246@empiric.dek.spc.org>; from bms@spc.org on Wed, Jun 16, 2004 at 02:24:05PM +0100 Subject: Re: Must softc begin with arpcom? 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: Wed, 16 Jun 2004 16:54:09 -0000 On Wed, Jun 16, 2004 at 02:24:05PM +0100, Bruce M Simpson wrote: > In if_arp.h: > 103 * The code is written so that each *_softc _must_ begin with a > 104 * struct arpcom, which in turn _must_ begin with a struct ifnet. > > It seems to be that this may no longer be the case after luigi's > recent cleanups (IFP2AC() and friends) which I nearly ended up > duplicating. it is still necessary. Many drivers certainly make this assumption by casting either ifp or sc to (struct arpcom *). One easy way out that does not require to touch all drivers is to move the only remaining arpcom field (one, plus one which is only used by ng_ether and can go into the af_data array) into the struct ifnet and '#define arpcom ifnet' The #define then can be removed after a cleaning pass on all drivers (which i'd postpone to a later time when we know what we want to do with the arpcom field, given that it is supposed to be driver-specific or possibly useless). cheers luigi