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.


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 11:45:46 -0000
@@ -336,8 +336,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_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.

Reply via email to