Users report problems w/ auto-negotiation disabled and the link set
to 100/Half or 10/Half.  Problems range from poor performance to no
link at all.

The current sky2 code does not set things properly on link up if
autonegotiation is disabled.  Plus it does not contemplate a 10Mbit
setting at all.  This patch corrects that.

Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
---

If you don't like the "Is write/read necessary?" comment (or if the
write/read actually is unnecessary), let me know and I will respin
the patch...

 drivers/net/sky2.c |   31 ++++++++++++++++++++++++++++++-
 1 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index f8b973a..8334f14 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -522,10 +522,16 @@ static void sky2_mac_init(struct sky2_hw
 
                switch (sky2->speed) {
                case SPEED_1000:
+                       reg &= ~GM_GPCR_SPEED_100;
                        reg |= GM_GPCR_SPEED_1000;
-                       /* fallthru */
+                       break;
                case SPEED_100:
+                       reg &= ~GM_GPCR_SPEED_1000;
                        reg |= GM_GPCR_SPEED_100;
+                       break;
+               case SPEED_10:
+                       reg &= ~(GM_GPCR_SPEED_1000 | GM_GPCR_SPEED_100);
+                       break;
                }
 
                if (sky2->duplex == DUPLEX_FULL)
@@ -1448,6 +1454,29 @@ static void sky2_link_up(struct sky2_por
        sky2_write8(hw, SK_REG(port, GMAC_IRQ_MSK), GMAC_DEF_MSK);
 
        reg = gma_read16(hw, port, GM_GP_CTRL);
+       if (sky2->autoneg == AUTONEG_DISABLE) {
+               reg |= GM_GPCR_AU_ALL_DIS;
+
+               /* Is write/read necessary?  Copied from sky2_mac_init */
+               gma_write16(hw, port, GM_GP_CTRL, reg);
+               gma_read16(hw, port, GM_GP_CTRL);
+
+               switch (sky2->speed) {
+               case SPEED_1000:
+                       reg &= ~GM_GPCR_SPEED_100;
+                       reg |= GM_GPCR_SPEED_1000;
+                       break;
+               case SPEED_100:
+                       reg &= ~GM_GPCR_SPEED_1000;
+                       reg |= GM_GPCR_SPEED_100;
+                       break;
+               case SPEED_10:
+                       reg &= ~(GM_GPCR_SPEED_1000 | GM_GPCR_SPEED_100);
+                       break;
+               }
+       } else
+               reg &= ~GM_GPCR_AU_ALL_DIS;
+
        if (sky2->duplex == DUPLEX_FULL || sky2->autoneg == AUTONEG_ENABLE)
                reg |= GM_GPCR_DUP_FULL;
 
-- 
John W. Linville
[EMAIL PROTECTED]
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to