Commit 4b67be99 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Jeff Garzik

[PATCH] skge: pause mapping for fiber

Do correct mapping of pause and duplex when using 1000BaseX fiber
versions of the board.
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent a1bc9b87
...@@ -197,8 +197,8 @@ static u32 skge_supported_modes(const struct skge_hw *hw) ...@@ -197,8 +197,8 @@ static u32 skge_supported_modes(const struct skge_hw *hw)
else if (hw->chip_id == CHIP_ID_YUKON) else if (hw->chip_id == CHIP_ID_YUKON)
supported &= ~SUPPORTED_1000baseT_Half; supported &= ~SUPPORTED_1000baseT_Half;
} else } else
supported = SUPPORTED_1000baseT_Full | SUPPORTED_FIBRE supported = SUPPORTED_1000baseT_Full | SUPPORTED_1000baseT_Half
| SUPPORTED_Autoneg; | SUPPORTED_FIBRE | SUPPORTED_Autoneg;
return supported; return supported;
} }
...@@ -1018,6 +1018,14 @@ static const u16 phy_pause_map[] = { ...@@ -1018,6 +1018,14 @@ static const u16 phy_pause_map[] = {
[FLOW_MODE_REM_SEND] = PHY_AN_PAUSE_CAP | PHY_AN_PAUSE_ASYM, [FLOW_MODE_REM_SEND] = PHY_AN_PAUSE_CAP | PHY_AN_PAUSE_ASYM,
}; };
/* special defines for FIBER (88E1011S only) */
static const u16 fiber_pause_map[] = {
[FLOW_MODE_NONE] = PHY_X_P_NO_PAUSE,
[FLOW_MODE_LOC_SEND] = PHY_X_P_ASYM_MD,
[FLOW_MODE_SYMMETRIC] = PHY_X_P_SYM_MD,
[FLOW_MODE_REM_SEND] = PHY_X_P_BOTH_MD,
};
/* Check status of Broadcom phy link */ /* Check status of Broadcom phy link */
static void bcom_check_link(struct skge_hw *hw, int port) static void bcom_check_link(struct skge_hw *hw, int port)
...@@ -1207,17 +1215,7 @@ static void xm_phy_init(struct skge_port *skge) ...@@ -1207,17 +1215,7 @@ static void xm_phy_init(struct skge_port *skge)
if (skge->advertising & ADVERTISED_1000baseT_Full) if (skge->advertising & ADVERTISED_1000baseT_Full)
ctrl |= PHY_X_AN_FD; ctrl |= PHY_X_AN_FD;
switch(skge->flow_control) { ctrl |= fiber_pause_map[skge->flow_control];
case FLOW_MODE_NONE:
ctrl |= PHY_X_P_NO_PAUSE;
break;
case FLOW_MODE_LOC_SEND:
ctrl |= PHY_X_P_ASYM_MD;
break;
case FLOW_MODE_SYMMETRIC:
ctrl |= PHY_X_P_BOTH_MD;
break;
}
xm_phy_write(hw, port, PHY_XMAC_AUNE_ADV, ctrl); xm_phy_write(hw, port, PHY_XMAC_AUNE_ADV, ctrl);
...@@ -1796,11 +1794,17 @@ static void yukon_init(struct skge_hw *hw, int port) ...@@ -1796,11 +1794,17 @@ static void yukon_init(struct skge_hw *hw, int port)
adv |= PHY_M_AN_10_FD; adv |= PHY_M_AN_10_FD;
if (skge->advertising & ADVERTISED_10baseT_Half) if (skge->advertising & ADVERTISED_10baseT_Half)
adv |= PHY_M_AN_10_HD; adv |= PHY_M_AN_10_HD;
} else /* special defines for FIBER (88E1011S only) */
adv |= PHY_M_AN_1000X_AHD | PHY_M_AN_1000X_AFD;
/* Set Flow-control capabilities */ /* Set Flow-control capabilities */
adv |= phy_pause_map[skge->flow_control]; adv |= phy_pause_map[skge->flow_control];
} else {
if (skge->advertising & ADVERTISED_1000baseT_Full)
adv |= PHY_M_AN_1000X_AFD;
if (skge->advertising & ADVERTISED_1000baseT_Half)
adv |= PHY_M_AN_1000X_AHD;
adv |= fiber_pause_map[skge->flow_control];
}
/* Restart Auto-negotiation */ /* Restart Auto-negotiation */
ctrl |= PHY_CT_ANE | PHY_CT_RE_CFG; ctrl |= PHY_CT_ANE | PHY_CT_RE_CFG;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment