Anyone working on the FreeBSD driver for broadcom 5784M Gige chip?
Zhang, Helen
helen.zhang at bluecoat.com
Mon Feb 9 10:41:34 PST 2009
Hi, there:
I'm new to FreeBSD community and this is my first email to the mailing
group.
Recently I'm working on Broadcom 5784M Gige driver. My code base is
close to FreeBSD,
but FreeBSD bge driver doesn't support the chip yet. The linux driver
supports the chip.
I'm wondering whether anyone is working or plans to work on to port the
linux code to
FreeBSD base. If so, I hope we can share some information together.
Thanks.
Another thing, I found one dead loop in current src/sys/dev/bge/if_bge.c
(both 216/217
revisions): around line 2682, if mii_phy_probe( ) fails, the code will
go back to again (4 lines
back). Variable trys will reset to 0 every time, so the (trys++<4)
condition is forever false.
I don't know how to report the bug to freebsd Community yet. So I just
attach the related
code below. The fix is simple: just move "trys=0" line before again:
Thanks and best wishes to everyone!
-Helen
===========
src/sys/dev/bge/if_bge.c: around line 2676
BGE_CLRBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP);
again:
bge_asf_driver_up(sc);
trys = 0;
if (mii_phy_probe(dev, &sc->bge_miibus, <<<<<< line
2682
bge_ifmedia_upd, bge_ifmedia_sts)) {
if (trys++ < 4) {
device_printf(sc->bge_dev, "Try
again\n");
bge_miibus_writereg(sc->bge_dev, 1,
MII_BMCR,
BMCR_RESET);
goto again;
}
device_printf(sc->bge_dev, "MII without any
PHY!\n");
error = ENXIO;
goto fail;
}
More information about the freebsd-net
mailing list