From owner-freebsd-arch@FreeBSD.ORG Wed Oct 1 11:38:17 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 ECF6E16A4B3 for ; Wed, 1 Oct 2003 11:38:17 -0700 (PDT) Received: from mwinf0502.wanadoo.fr (smtp4.wanadoo.fr [193.252.22.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4A37543F93 for ; Wed, 1 Oct 2003 11:38:16 -0700 (PDT) (envelope-from vjardin@wanadoo.fr) Received: from mercure.vincentjardin.net (AVelizy-102-1-4-9.w80-11.abo.wanadoo.fr [80.11.204.9]) by mwinf0502.wanadoo.fr (SMTP Server) with ESMTP id C333DE800204; Wed, 1 Oct 2003 20:38:14 +0200 (CEST) Content-Type: text/plain; charset="iso-8859-1" From: Vincent Jardin To: Brooks Davis , Harti Brandt Date: Wed, 1 Oct 2003 20:38:13 +0200 User-Agent: KMail/1.4.3 References: <20030930174815.GC31908@Odin.AC.HMC.Edu> <20031001093334.S113@beagle.fokus.fraunhofer.de> <20031001164036.GA1263@Odin.AC.HMC.Edu> In-Reply-To: <20031001164036.GA1263@Odin.AC.HMC.Edu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200310012038.14062.vjardin@wanadoo.fr> cc: arch@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: Wed, 01 Oct 2003 18:38:18 -0000 > > messier BD>example is in the new ATM code where interfaces are looked= up > > by name. > > > > Where is this? > > One example would be in sys/netatm/atm_if.c around line 1081. Do you mean pif_name and pif_unit ? This code could be updated. It uses pif_unit and pif_name that could beco= me=20 pif_xname. for (pip =3D atm_interface_head; pip; pip =3D pip->pif_next) { if (strcmp(pip->pif_xname, n) =3D=3D 0) break; } instead of for (pip =3D atm_interface_head; pip; pip =3D pip->pif_next) { if ((pip->pif_unit =3D=3D unit) && (strcmp(pip->pif_name, n)= =3D=3D 0)) break; } Moreover, a PIF (Physical IF) is not an ifnet. It is the ATM device. The = ATM=20 PVC are the NIF (Network IF -> ifnet). They are many NIF (PVC) over a sin= gle=20 PIF (ATM device). With the ATM stack, the main issue is related to AIOCS_SET_NIF. It sets t= he=20 ifp's if_name to the NIF's nif_name and the ifp's if_unit to a regular=20 counter. In fact we could change the following code strcpy ( nip->nif_name, asr->asr_nif_pref ); nip->nif_sel =3D count; ifp->if_name =3D nip->nif_name; ifp->if_unit =3D count; to snprintf(nip->nif_xname, sizeof(nip->nif_xname), "%s%= d", asr->asr_nif_pref, count); nip->nif_sel =3D count; /* we need to keep a selector= to=20 build the UNI ATM address */ ifp->if_xname =3D nip->nif_xname; #if 0 ifp->if_unit =3D count; /* it is not required anymore= */ #endif Regards, Vincent