From owner-freebsd-net Mon Jul 29 21:38:55 2002 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 0899337B400 for ; Mon, 29 Jul 2002 21:38:53 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 31B5543E31 for ; Mon, 29 Jul 2002 21:38:48 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.3/8.12.3) with ESMTP id g6U4ciYx051308; Mon, 29 Jul 2002 22:38:47 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 29 Jul 2002 22:38:34 -0600 (MDT) Message-Id: <20020729.223834.32171634.imp@bsdimp.com> To: brooks@one-eyed-alien.net Cc: net@FreeBSD.ORG Subject: Re: switching to if_xname from if_name and if_unit From: "M. Warner Losh" In-Reply-To: <20020726211050.A30598@Odin.AC.HMC.Edu> References: <20020726211050.A30598@Odin.AC.HMC.Edu> X-Mailer: Mew version 2.1 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org In message: <20020726211050.A30598@Odin.AC.HMC.Edu> Brooks Davis writes: : [Bcc to -arch for interested people not on -net] : : NetBSD and OpenBSD have replaced the "char *if_name" and "int if_unit" : members of struct ifnet with "char if_xname[IFNAMESIZ]". I propose that : we follow suit. I like this. : @@ -280,8 +280,7 @@ ep_attach(sc) : attached = (ifp->if_softc != 0); : : ifp->if_softc = sc; : - ifp->if_unit = sc->unit; : - ifp->if_name = "ep"; : + sprintf(ifp->if_xname, "ep%d", sc->unit); strcpy(ifp->if_xname, device_get_name(sc->dev)); might be better, don't you think? Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message