On Sat, Jul 25, 2009 at 08:48:47AM -0400, Brad wrote:
> On Sat, Jul 25, 2009 at 08:32:40AM -0400, Brad wrote:
> > Replaces the magic numbers with the standard define from mii.h and
> > only advertises the flow control capabilities via the ANAR register
> > if the MIIF_DOPAUSE flag is set, as done by all other PHY.
> >
> > No matter what I can't seem to get jmphy(4) to autoneg flow control
> > status whether the code as is or with the proper define's, with or
> > without the MIIF_DOPAUSE checking as would be expected. So I figure
> > might as well tidy up the code for consistency and readability.
>
> *sigh* need sleep. I thought I had already merged in the jmphy_status()
> bit and double checking shows I had not. Now it works. :)
I also had a user test this a few months ago now that jme(4) is starting
to show up in real hw.
OK?
> Index: jmphy.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/mii/jmphy.c,v
> retrieving revision 1.2
> diff -u -p -r1.2 jmphy.c
> --- jmphy.c 20 Oct 2008 00:05:38 -0000 1.2
> +++ jmphy.c 25 Jul 2009 12:44:30 -0000
> @@ -254,12 +254,10 @@ jmphy_status(struct mii_softc *sc)
> }
>
> if ((ssr & JMPHY_SSR_DUPLEX) != 0)
> - mii->mii_media_active |= IFM_FDX;
> + mii->mii_media_active |= mii_phy_flowstatus(sc) | IFM_FDX;
> else
> mii->mii_media_active |= IFM_HDX;
>
> - /* XXX Flow-control. */
> -
> if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) {
> if ((PHY_READ(sc, MII_100T2SR) & GTSR_MS_RES) != 0)
> mii->mii_media_active |= IFM_ETH_MASTER;
> @@ -336,8 +334,9 @@ jmphy_auto(struct mii_softc *sc, struct
> bmcr |= BMCR_LOOP;
>
> anar = jmphy_anar(ife);
> - /* XXX Always advertise pause capability. */
> - anar |= (3 << 10);
> +
> + if (sc->mii_flags & MIIF_DOPAUSE)
> + anar |= ANAR_FC | ANAR_PAUSE_TOWARDS;
>
> if ((sc->mii_flags & MIIF_HAVE_GTCR) != 0) {
> #ifdef notyet
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.