Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Feb 2009 10:27:35 -0800
From:      "Zhang, Helen" <helen.zhang@bluecoat.com>
To:        <freebsd-net@freebsd.org>
Subject:   Anyone working on the FreeBSD driver for broadcom 5784M Gige chip?
Message-ID:  <9CFA8139F7106843B28F9E6FB1FF4BBE0D0117@bcs-mail04.internal.cacheflow.com>

next in thread | raw e-mail | index | archive | help
Hi, there:

=20

I'm new to FreeBSD community and this is my first email to the mailing
group.

=20

Recently I'm working on Broadcom 5784M Gige driver. My code base is
close to FreeBSD,=20

but FreeBSD bge driver doesn't support the chip yet. The linux driver
supports the chip. =20

I'm wondering whether anyone is working or plans to work on to port the
linux code to=20

FreeBSD base. If so, I hope we can share some information together.
Thanks.

=20

Another thing, I found one dead loop in current src/sys/dev/bge/if_bge.c
(both 216/217=20

revisions): around line 2682,  if mii_phy_probe( ) fails, the code will
go back to again (4 lines=20

back). Variable trys will reset to 0 every time, so the (trys++<4)
condition is forever false.=20

=20

I don't know how to report the bug to freebsd Community yet. So I just
attach the related=20

code below. The fix is simple: just move "trys=3D0" line before again:

=20

Thanks and best wishes to everyone!

=20

-Helen

=20

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

src/sys/dev/bge/if_bge.c: around line 2676

=20

                BGE_CLRBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP);

again:

                bge_asf_driver_up(sc);

=20

                trys =3D 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;

                        }

=20

                        device_printf(sc->bge_dev, "MII without any
PHY!\n");

                        error =3D ENXIO;

                        goto fail;

                }

=20

=20




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9CFA8139F7106843B28F9E6FB1FF4BBE0D0117>