[Zrouter-src-freebsd] ZRouter.org: push to FreeBSD HEAD tree

zrouter-src-freebsd at zrouter.org zrouter-src-freebsd at zrouter.org
Tue Jan 10 22:13:17 UTC 2012


details:   http://zrouter.org/hg/FreeBSD/head//rev/d793615e8de2
changeset: 270:d793615e8de2
user:      ray at terran.dlink.ua
date:      Wed Jan 11 00:14:18 2012 +0200
description:
Another step to make if_arge like any other normal MAC.

diffstat:

 head/sys/mips/atheros/if_arge.c |  26 ++++++--------------------
 1 files changed, 6 insertions(+), 20 deletions(-)

diffs (39 lines):

diff -r 3c64dd8a60d3 -r d793615e8de2 head/sys/mips/atheros/if_arge.c
--- a/head/sys/mips/atheros/if_arge.c	Tue Jan 10 15:44:39 2012 +0200
+++ b/head/sys/mips/atheros/if_arge.c	Wed Jan 11 00:14:18 2012 +0200
@@ -460,29 +460,15 @@
 			    FIFO_RX_FILTMASK_DEFAULT);
 	}
 
-	printf("%s:%d: call arge_set_pll(sc, media=%08x, duplex=%08x)\n", __func__, __LINE__, sc->arge_media_type, sc->arge_media_duplex);
+	printf("%s:%d: call arge_set_pll(sc, media=%08x, duplex=%08x)\n",
+	    __func__, __LINE__, sc->arge_media_type, sc->arge_media_duplex);
 	arge_set_pll(sc, sc->arge_media_type, sc->arge_media_duplex);
 
-	/* Attach miibus */
-	struct miibus_ivars *ivars;
-	ivars = malloc(sizeof(*ivars), M_DEVBUF, M_NOWAIT);
-	if (ivars == NULL) {
-		error = ENOMEM;
-		goto fail;
-	}
-	ivars->ifp = ifp;
-	ivars->ifmedia_upd = arge_ifmedia_upd;
-	ivars->ifmedia_sts = arge_ifmedia_sts;
-	ivars->mii_flags = 0;
-	sc->arge_miibus = device_add_child(dev, "miibus", -1);
-	if (sc->arge_miibus == NULL) {
-		error = ENXIO;
-		goto fail;
-	}
-	device_set_ivars(sc->arge_miibus, ivars);
-
-	error = bus_generic_attach(dev);
+	error = mii_attach(dev, &sc->arge_miibus, ifp, arge_ifmedia_upd,
+	    arge_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY,
+	    0);
 	if (error != 0) {
+		device_printf(dev, "attaching PHYs failed\n");
 		goto fail;
 	}
 


More information about the Zrouter-src-freebsd mailing list