jme: Fix hardware action of full-duplex
authorGuo-Fu Tseng <cooldavid@cooldavid.org>
Thu, 16 Dec 2010 13:23:51 +0000 (21:23 +0800)
committerGuo-Fu Tseng <cooldavid@cooldavid.org>
Sat, 12 Feb 2011 17:57:36 +0000 (01:57 +0800)
Clear Transmit Timer/Retry setting while full-duplex.

jme.c
jme.h

diff --git a/jme.c b/jme.c
index 89c1ab7..ee39a05 100644 (file)
--- a/jme.c
+++ b/jme.c
@@ -442,16 +442,14 @@ jme_check_link(struct net_device *netdev, int testonly)
 
                if (phylink & PHY_LINK_DUPLEX) {
                        jwrite32(jme, JME_TXMCS, TXMCS_DEFAULT);
+                       jwrite32(jme, JME_TXTRHD, TXTRHD_FULLDUPLEX);
                        ghc |= GHC_DPX;
                } else {
                        jwrite32(jme, JME_TXMCS, TXMCS_DEFAULT |
                                                TXMCS_BACKOFF |
                                                TXMCS_CARRIERSENSE |
                                                TXMCS_COLLISION);
-                       jwrite32(jme, JME_TXTRHD, TXTRHD_TXPEN |
-                               ((0x2000 << TXTRHD_TXP_SHIFT) & TXTRHD_TXP) |
-                               TXTRHD_TXREN |
-                               ((8 << TXTRHD_TXRL_SHIFT) & TXTRHD_TXRL));
+                       jwrite32(jme, JME_TXTRHD, TXTRHD_HALFDUPLEX);
                }
 
                gpreg1 = GPREG1_DEFAULT;
diff --git a/jme.h b/jme.h
index 2ea3186..2011af2 100644 (file)
--- a/jme.h
+++ b/jme.h
@@ -798,6 +798,14 @@ enum jme_txtrhd_shifts {
        TXTRHD_TXRL_SHIFT       = 0,
 };
 
+enum jme_txtrhd_values {
+       TXTRHD_FULLDUPLEX       = 0x00000000,
+       TXTRHD_HALFDUPLEX       = TXTRHD_TXPEN |
+                                 ((0x2000 << TXTRHD_TXP_SHIFT) & TXTRHD_TXP) |
+                                 TXTRHD_TXREN |
+                                 ((8 << TXTRHD_TXRL_SHIFT) & TXTRHD_TXRL),
+};
+
 /*
  * RX Control/Status Bits
  */