Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 20465
b: refs/heads/master
c: 6f4c56b
h: refs/heads/master
i:
  20463: 0dbc41a
v: v3
  • Loading branch information
Stephen Hemminger authored and Jeff Garzik committed Feb 17, 2006
1 parent 182965c commit fdfc673
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 564f9abb34c936e5d0c7682129042dad14dbbb95
refs/heads/master: 6f4c56b2ae10b680be518cc99f5308fc59236db2
31 changes: 30 additions & 1 deletion trunk/drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,10 +520,16 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port)

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)
Expand Down Expand Up @@ -1446,6 +1452,29 @@ static void sky2_link_up(struct sky2_port *sky2)
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;

Expand Down

0 comments on commit fdfc673

Please sign in to comment.