jme: Fix hardware action of full-duplex
authorGuo-Fu Tseng <cooldavid@cooldavid.org>
Sun, 13 Feb 2011 18:27:38 +0000 (18:27 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Feb 2011 04:43:22 +0000 (20:43 -0800)
Clear Transmit Timer/Retry setting while full-duplex.

Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/jme.c
drivers/net/jme.h

index 490bc0feff3d03a9cfccea047ce0a6a38b41ffef..6996d04e1de4c8eb268a80419db597b2db7b3453 100644 (file)
@@ -439,16 +439,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;
index dc4af5753a9e1542c143bac2f9e10c0d5cd48b5c..b33bc5b0bb4eee56f6a9094830170baab9a01e3e 100644 (file)
@@ -658,6 +658,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
  */