diff options
author | brooks <brooks@FreeBSD.org> | 2003-10-30 19:45:58 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2003-10-30 19:45:58 +0000 |
commit | 38e31120fcd40193d407e469c46607ecc302ab68 (patch) | |
tree | 7d01fdeb4d415c1bae5c7bd03a9a32e71d3a786d /sys/dev/ed/if_ed.c | |
parent | 24760267308bc1cdadffe3933510627f1a8ebec9 (diff) | |
download | FreeBSD-src-38e31120fcd40193d407e469c46607ecc302ab68.zip FreeBSD-src-38e31120fcd40193d407e469c46607ecc302ab68.tar.gz |
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.
Diffstat (limited to 'sys/dev/ed/if_ed.c')
-rw-r--r-- | sys/dev/ed/if_ed.c | 84 |
1 files changed, 41 insertions, 43 deletions
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 */ /* |