summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>1998-09-10 22:15:22 +0000
committerJason Wright <jason@cvs.openbsd.org>1998-09-10 22:15:22 +0000
commit8aeee6d44af63b1052b8db18fa5badb284c372dd (patch)
treee0ca4d1701ea8503845a10565882f01bf17064c6 /sys/arch
parenta0aee70bf932b64091baebe2cd8d561b095f50c6 (diff)
default media type is auto if a phy is found, and none if not
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc/dev/hme.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/arch/sparc/dev/hme.c b/sys/arch/sparc/dev/hme.c
index cdb86d6638e..1606266928f 100644
--- a/sys/arch/sparc/dev/hme.c
+++ b/sys/arch/sparc/dev/hme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hme.c,v 1.8 1998/09/10 17:34:32 jason Exp $ */
+/* $OpenBSD: hme.c,v 1.9 1998/09/10 22:15:21 jason Exp $ */
/*
* Copyright (c) 1998 Jason L. Wright (jason@thought.net)
@@ -219,7 +219,14 @@ hmeattach(parent, self, aux)
ifmedia_init(&sc->sc_mii.mii_media, IFM_IMASK, hme_mediachange,
hme_mediastatus);
mii_phy_probe(self, &sc->sc_mii, 0xffffffff);
- ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER | IFM_NONE);
+
+ if (LIST_FIRST(&sc->sc_mii.mii_phys) == NULL) {
+ ifmedia_add(&sc->sc_mii.mii_media, IFM_ETHER | IFM_NONE,
+ 0, NULL);
+ ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER | IFM_NONE);
+ }
+ else
+ ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER | IFM_AUTO);
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
ifp->if_softc = sc;