Date: Sun, 6 Aug 2000 22:40:09 +0200 From: Neil Blakey-Milner <nbm@mithrandr.moria.org> To: Archie Cobbs <archie@whistle.com> Cc: dennis@etinc.com, hackers@FreeBSD.ORG Subject: Re: ether_ifattach() issue Message-ID: <20000806224009.A89400@mithrandr.moria.org> In-Reply-To: <200008062028.NAA04330@bubba.whistle.com>; from archie@whistle.com on Sun, Aug 06, 2000 at 01:28:07PM -0700 References: <20000806220611.A89046@mithrandr.moria.org> <200008062028.NAA04330@bubba.whistle.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000806224009.A89400>