diff options
author | imp <imp@FreeBSD.org> | 2006-01-27 08:00:40 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2006-01-27 08:00:40 +0000 |
commit | f16fb54318ad8f8653340ba4bc51affc75579917 (patch) | |
tree | 83d156cfeb6e5923d654068c9eb630be7e10459d | |
parent | b5beaffa5b16459227a851941a48ba19610004e5 (diff) | |
download | FreeBSD-src-f16fb54318ad8f8653340ba4bc51affc75579917.zip FreeBSD-src-f16fb54318ad8f8653340ba4bc51affc75579917.tar.gz |
Transition from ALTPHYS to LINK2. We already document in the ed(4)
man page that the ifconfig option link2 is used to disable the AUI
transceiver on the 3com boards (should also say HP PC Lan+). This
makes the connection clearer.
Add a note about why we set this flag prior to attaching the device.
We never set or clear the flag later, only test it. There can be no
races here, but this might be asthetically displeasing to some. Also
note that we may no longer need to have this knob at all as we may be
able to do it with the more sophisticated rc.d scripts we have today I
think the only reason it is there is because we didn't used to allow
its proper setting when configured to get the IP address via DHCP.
I'll note that this would be better handled by using ifmedia for all
ed cards, not just those with a miibus...
-rw-r--r-- | sys/dev/ed/if_ed.c | 22 | ||||
-rw-r--r-- | sys/dev/ed/if_ed_hpp.c | 2 |
2 files changed, 14 insertions, 10 deletions
diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index 39f0c3e..f16e517 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -310,13 +310,17 @@ ed_attach(device_t dev) dot3ChipSetNational8390); sc->mibdata.dot3Compliance = DOT3COMPLIANCE_COLLS; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; /* - * Set default state for ALTPHYS flag (used to disable the + * Set default state for LINK2 flag (used to disable the * tranceiver for AUI operation), based on config option. + * We only set this flag before we attach the device, so there's + * no race. It is convenient to allow users to turn this off + * by default in the kernel config, but given our more advanced + * boot time configuration options, this might no longer be needed. */ - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; if (device_get_flags(dev) & ED_FLAGS_DISABLE_TRANCEIVER) - ifp->if_flags |= IFF_ALTPHYS; + ifp->if_flags |= IFF_LINK2; /* * Attach the interface @@ -338,12 +342,12 @@ ed_attach(device_t dev) sc->hpp_mem_start ? "memory mapped" : "regular"); else #endif - printf("%s ", sc->isa16bit ? "(16 bit)" : "(8 bit)"); + printf("%s", sc->isa16bit ? "(16 bit)" : "(8 bit)"); #if defined(ED_HPP) || defined(ED_3C503) printf("%s", (((sc->vendor == ED_VENDOR_3COM) || (sc->vendor == ED_VENDOR_HP)) && - (ifp->if_flags & IFF_ALTPHYS)) ? + (ifp->if_flags & IFF_LINK2)) ? " tranceiver disabled" : ""); #endif printf("\n"); @@ -575,7 +579,7 @@ ed_init_locked(struct ed_softc *sc) * (there is no settable hardware default). */ if (sc->vendor == ED_VENDOR_3COM) { - if (ifp->if_flags & IFF_ALTPHYS) + if (ifp->if_flags & IFF_LINK2) ed_asic_outb(sc, ED_3COM_CR, 0); else ed_asic_outb(sc, ED_3COM_CR, ED_3COM_CR_XSEL); @@ -1241,14 +1245,14 @@ ed_ioctl(struct ifnet *ifp, u_long command, caddr_t data) */ ed_setrcr(sc); +#ifdef ED_3C503 /* * An unfortunate hack to provide the (required) software * control of the tranceiver for 3Com/HP boards. - * The ALTPHYS flag disables the tranceiver if set. + * The LINK2 flag disables the tranceiver if set. */ -#ifdef ED_3C503 if (sc->vendor == ED_VENDOR_3COM) { - if (ifp->if_flags & IFF_ALTPHYS) + if (ifp->if_flags & IFF_LINK2) ed_asic_outb(sc, ED_3COM_CR, 0); else ed_asic_outb(sc, ED_3COM_CR, ED_3COM_CR_XSEL); diff --git a/sys/dev/ed/if_ed_hpp.c b/sys/dev/ed/if_ed_hpp.c index 28e0748..1f59a8e 100644 --- a/sys/dev/ed/if_ed_hpp.c +++ b/sys/dev/ed/if_ed_hpp.c @@ -371,7 +371,7 @@ ed_hpp_set_physical_link(struct ed_softc *sc) ed_asic_outw(sc, ED_HPP_PAGING, ED_HPP_PAGE_LAN); lan_page = ed_asic_inw(sc, ED_HPP_PAGE_0); - if (ifp->if_flags & IFF_ALTPHYS) { + if (ifp->if_flags & IFF_LINK2) { /* * Use the AUI port. */ |