From 38e31120fcd40193d407e469c46607ecc302ab68 Mon Sep 17 00:00:00 2001 From: brooks Date: Thu, 30 Oct 2003 19:45:58 +0000 Subject: There is no way to enter the attach routine twice with the same softc without a detach call in between so don't try to deal with that possiability. This is a diff-reduction commit for the upcoming if_xname conversion. --- sys/dev/ed/if_ed.c | 84 ++++++++++++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 43 deletions(-) (limited to 'sys/dev/ed') diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index 0f584aa..0c6a0f6 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -1713,51 +1713,49 @@ ed_attach(sc, unit, flags) */ ed_stop(sc); - if (!ifp->if_name) { - /* - * Initialize ifnet structure - */ - ifp->if_softc = sc; - ifp->if_unit = unit; - ifp->if_name = "ed"; - ifp->if_output = ether_output; - ifp->if_start = ed_start; - ifp->if_ioctl = ed_ioctl; - ifp->if_watchdog = ed_watchdog; - ifp->if_init = ed_init; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; - ifp->if_linkmib = &sc->mibdata; - ifp->if_linkmiblen = sizeof sc->mibdata; - /* - * XXX - should do a better job. - */ - if (sc->chip_type == ED_CHIP_TYPE_WD790) - sc->mibdata.dot3StatsEtherChipSet = - DOT3CHIPSET(dot3VendorWesternDigital, - dot3ChipSetWesternDigital83C790); - else - sc->mibdata.dot3StatsEtherChipSet = - DOT3CHIPSET(dot3VendorNational, - dot3ChipSetNational8390); - sc->mibdata.dot3Compliance = DOT3COMPLIANCE_COLLS; + /* + * Initialize ifnet structure + */ + ifp->if_softc = sc; + ifp->if_unit = unit; + ifp->if_name = "ed"; + ifp->if_output = ether_output; + ifp->if_start = ed_start; + ifp->if_ioctl = ed_ioctl; + ifp->if_watchdog = ed_watchdog; + ifp->if_init = ed_init; + ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_linkmib = &sc->mibdata; + ifp->if_linkmiblen = sizeof sc->mibdata; + /* + * XXX - should do a better job. + */ + if (sc->chip_type == ED_CHIP_TYPE_WD790) + sc->mibdata.dot3StatsEtherChipSet = + DOT3CHIPSET(dot3VendorWesternDigital, + dot3ChipSetWesternDigital83C790); + else + sc->mibdata.dot3StatsEtherChipSet = + DOT3CHIPSET(dot3VendorNational, + dot3ChipSetNational8390); + sc->mibdata.dot3Compliance = DOT3COMPLIANCE_COLLS; - /* - * Set default state for ALTPHYS flag (used to disable the - * tranceiver for AUI operation), based on compile-time - * config option. - */ - if (flags & ED_FLAGS_DISABLE_TRANCEIVER) - ifp->if_flags = (IFF_BROADCAST | IFF_SIMPLEX | - IFF_MULTICAST | IFF_ALTPHYS); - else - ifp->if_flags = (IFF_BROADCAST | IFF_SIMPLEX | - IFF_MULTICAST); + /* + * Set default state for ALTPHYS flag (used to disable the + * tranceiver for AUI operation), based on compile-time + * config option. + */ + if (flags & ED_FLAGS_DISABLE_TRANCEIVER) + ifp->if_flags = (IFF_BROADCAST | IFF_SIMPLEX | + IFF_MULTICAST | IFF_ALTPHYS); + else + ifp->if_flags = (IFF_BROADCAST | IFF_SIMPLEX | + IFF_MULTICAST); - /* - * Attach the interface - */ - ether_ifattach(ifp, sc->arpcom.ac_enaddr); - } + /* + * Attach the interface + */ + ether_ifattach(ifp, sc->arpcom.ac_enaddr); /* device attach does transition from UNCONFIGURED to IDLE state */ /* -- cgit v1.1