From owner-freebsd-hackers Sun Aug 6 13:40:26 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from ns1.sunesi.net (ns1.sunesi.net [196.15.192.194]) by hub.freebsd.org (Postfix) with ESMTP id 8A32C37BA22 for ; Sun, 6 Aug 2000 13:40:22 -0700 (PDT) (envelope-from nbm@sunesi.net) Received: from nbm by ns1.sunesi.net with local (Exim 3.03 #1) id 13LXDN-000NGz-00; Sun, 06 Aug 2000 22:40:09 +0200 Date: Sun, 6 Aug 2000 22:40:09 +0200 From: Neil Blakey-Milner To: Archie Cobbs Cc: dennis@etinc.com, hackers@FreeBSD.ORG Subject: Re: ether_ifattach() issue Message-ID: <20000806224009.A89400@mithrandr.moria.org> References: <20000806220611.A89046@mithrandr.moria.org> <200008062028.NAA04330@bubba.whistle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <200008062028.NAA04330@bubba.whistle.com>; from archie@whistle.com on Sun, Aug 06, 2000 at 01:28:07PM -0700 Organization: Sunesi Clinical Systems X-Operating-System: FreeBSD 3.3-RELEASE i386 X-URL: http://rucus.ru.ac.za/~nbm/ Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun 2000-08-06 (13:28), Archie Cobbs wrote: > > > No interface should be attached twice, Ethernet or other, right? > > > So try this patch and find out which driver is broken. > > > > I think the concern was because the semantics to attach devices changed, > > meaning that drivers from before no longer work. > > Hmm.. my understanding was that it was never OK to attach the > same interface twice (without detaching in between). So if this > behavior worked before then it was just "luck". > > In any case, IMHO in the future it doesn't make sense to allow > an interface to attach twice... what would that mean anyway? > > Admittedly there may be a backward compatibility problem, but > it seems like the origin of the problem is in the driver, not > the ether_attach() routine. Using dev/awi/awi.c as an example: sc->sc_dev.dv_xname, sc->sc_mib_phy.IEEE_PHY_Type == AWI_PHY_TYPE_FH ? "FH" : "DS", sc->sc_tx_rate / 10, ether_sprintf(sc->sc_mib_addr.aMAC_Address)); - if_attach(ifp); #ifdef __FreeBSD__ - ether_ifattach(ifp); -#if NBPFILTER > 0 - bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header)); -#endif + ether_ifattach(ifp, ETHER_BPF_SUPPORTED); #else + if_attach(ifp); ether_ifattach(ifp, sc->sc_mib_addr.aMAC_Address); #if NBPFILTER > 0 bpfattach(&ifp->if_bpf, ifp, DLT_EN10MB, sizeof(struct ether_header)); In other words - if_attach is no more. But, older drivers still use if_attach, and thus when ether_ifattach occurs, that's the second time that happens. Of course, I have no idea how the ether_ifattach argument change affects things - I'm just guessing as to why Dennis may be asking. Neil -- Neil Blakey-Milner Sunesi Clinical Systems nbm@mithrandr.moria.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message