aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-02-10 18:58:59 -0500
committerJeff Garzik <jgarzik@pobox.com>2006-02-17 16:16:21 -0500
commit6f4c56b2ae10b680be518cc99f5308fc59236db2 (patch)
treee9e64b3392a99fc6f4abd72428176f8100805af5 /drivers
parent564f9abb34c936e5d0c7682129042dad14dbbb95 (diff)
[PATCH] sky2: speed setting fix
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 <linville@tuxdriver.com> Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/sky2.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index cae2edf23004..bfeba5b9cd7a 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -520,10 +520,16 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port)
520 520
521 switch (sky2->speed) { 521 switch (sky2->speed) {
522 case SPEED_1000: 522 case SPEED_1000:
523 reg &= ~GM_GPCR_SPEED_100;
523 reg |= GM_GPCR_SPEED_1000; 524 reg |= GM_GPCR_SPEED_1000;
524 /* fallthru */ 525 break;
525 case SPEED_100: 526 case SPEED_100:
527 reg &= ~GM_GPCR_SPEED_1000;
526 reg |= GM_GPCR_SPEED_100; 528 reg |= GM_GPCR_SPEED_100;
529 break;
530 case SPEED_10:
531 reg &= ~(GM_GPCR_SPEED_1000 | GM_GPCR_SPEED_100);
532 break;
527 } 533 }
528 534
529 if (sky2->duplex == DUPLEX_FULL) 535 if (sky2->duplex == DUPLEX_FULL)
@@ -1446,6 +1452,29 @@ static void sky2_link_up(struct sky2_port *sky2)
1446 sky2_write8(hw, SK_REG(port, GMAC_IRQ_MSK), GMAC_DEF_MSK); 1452 sky2_write8(hw, SK_REG(port, GMAC_IRQ_MSK), GMAC_DEF_MSK);
1447 1453
1448 reg = gma_read16(hw, port, GM_GP_CTRL); 1454 reg = gma_read16(hw, port, GM_GP_CTRL);
1455 if (sky2->autoneg == AUTONEG_DISABLE) {
1456 reg |= GM_GPCR_AU_ALL_DIS;
1457
1458 /* Is write/read necessary? Copied from sky2_mac_init */
1459 gma_write16(hw, port, GM_GP_CTRL, reg);
1460 gma_read16(hw, port, GM_GP_CTRL);
1461
1462 switch (sky2->speed) {
1463 case SPEED_1000:
1464 reg &= ~GM_GPCR_SPEED_100;
1465 reg |= GM_GPCR_SPEED_1000;
1466 break;
1467 case SPEED_100:
1468 reg &= ~GM_GPCR_SPEED_1000;
1469 reg |= GM_GPCR_SPEED_100;
1470 break;
1471 case SPEED_10:
1472 reg &= ~(GM_GPCR_SPEED_1000 | GM_GPCR_SPEED_100);
1473 break;
1474 }
1475 } else
1476 reg &= ~GM_GPCR_AU_ALL_DIS;
1477
1449 if (sky2->duplex == DUPLEX_FULL || sky2->autoneg == AUTONEG_ENABLE) 1478 if (sky2->duplex == DUPLEX_FULL || sky2->autoneg == AUTONEG_ENABLE)
1450 reg |= GM_GPCR_DUP_FULL; 1479 reg |= GM_GPCR_DUP_FULL;
1451 1480