diff options
author | Yaniv Rosner <yanivr@broadcom.com> | 2011-10-27 01:09:48 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-10-27 16:14:16 -0400 |
commit | 001cea77b98f912050b8ea8995253fdbe7333fb6 (patch) | |
tree | 31a426f579dba91b60b7284523bfb9d1f0cd2530 /drivers/net | |
parent | ce7c048928473220394bb126b08596e92e998a36 (diff) |
bnx2x: Fix 54618se LED behavior
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c index 23333e0a1ef4..bce203fa4b9e 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | |||
@@ -5994,7 +5994,13 @@ int bnx2x_set_led(struct link_params *params, | |||
5994 | SHARED_HW_CFG_LED_MAC1); | 5994 | SHARED_HW_CFG_LED_MAC1); |
5995 | 5995 | ||
5996 | tmp = EMAC_RD(bp, EMAC_REG_EMAC_LED); | 5996 | tmp = EMAC_RD(bp, EMAC_REG_EMAC_LED); |
5997 | EMAC_WR(bp, EMAC_REG_EMAC_LED, (tmp | EMAC_LED_OVERRIDE)); | 5997 | if (params->phy[EXT_PHY1].type == |
5998 | PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE) | ||
5999 | EMAC_WR(bp, EMAC_REG_EMAC_LED, tmp & 0xfff1); | ||
6000 | else { | ||
6001 | EMAC_WR(bp, EMAC_REG_EMAC_LED, | ||
6002 | (tmp | EMAC_LED_OVERRIDE)); | ||
6003 | } | ||
5998 | break; | 6004 | break; |
5999 | 6005 | ||
6000 | case LED_MODE_OPER: | 6006 | case LED_MODE_OPER: |
@@ -6047,8 +6053,15 @@ int bnx2x_set_led(struct link_params *params, | |||
6047 | else | 6053 | else |
6048 | REG_WR(bp, NIG_REG_LED_MODE_P0 + port*4, | 6054 | REG_WR(bp, NIG_REG_LED_MODE_P0 + port*4, |
6049 | hw_led_mode); | 6055 | hw_led_mode); |
6056 | } else if ((params->phy[EXT_PHY1].type == | ||
6057 | PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE) && | ||
6058 | (mode != LED_MODE_OPER)) { | ||
6059 | REG_WR(bp, NIG_REG_LED_MODE_P0 + port*4, 0); | ||
6060 | tmp = EMAC_RD(bp, EMAC_REG_EMAC_LED); | ||
6061 | EMAC_WR(bp, EMAC_REG_EMAC_LED, tmp | 0x3); | ||
6050 | } else | 6062 | } else |
6051 | REG_WR(bp, NIG_REG_LED_MODE_P0 + port*4, hw_led_mode); | 6063 | REG_WR(bp, NIG_REG_LED_MODE_P0 + port*4, |
6064 | hw_led_mode); | ||
6052 | 6065 | ||
6053 | REG_WR(bp, NIG_REG_LED_CONTROL_OVERRIDE_TRAFFIC_P0 + port*4, 0); | 6066 | REG_WR(bp, NIG_REG_LED_CONTROL_OVERRIDE_TRAFFIC_P0 + port*4, 0); |
6054 | /* Set blinking rate to ~15.9Hz */ | 6067 | /* Set blinking rate to ~15.9Hz */ |
@@ -6060,8 +6073,13 @@ int bnx2x_set_led(struct link_params *params, | |||
6060 | LED_BLINK_RATE_VAL_E1X_E2); | 6073 | LED_BLINK_RATE_VAL_E1X_E2); |
6061 | REG_WR(bp, NIG_REG_LED_CONTROL_BLINK_RATE_ENA_P0 + | 6074 | REG_WR(bp, NIG_REG_LED_CONTROL_BLINK_RATE_ENA_P0 + |
6062 | port*4, 1); | 6075 | port*4, 1); |
6063 | tmp = EMAC_RD(bp, EMAC_REG_EMAC_LED); | 6076 | if ((params->phy[EXT_PHY1].type != |
6064 | EMAC_WR(bp, EMAC_REG_EMAC_LED, (tmp & (~EMAC_LED_OVERRIDE))); | 6077 | PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE) && |
6078 | (mode != LED_MODE_OPER)) { | ||
6079 | tmp = EMAC_RD(bp, EMAC_REG_EMAC_LED); | ||
6080 | EMAC_WR(bp, EMAC_REG_EMAC_LED, | ||
6081 | (tmp & (~EMAC_LED_OVERRIDE))); | ||
6082 | } | ||
6065 | 6083 | ||
6066 | if (CHIP_IS_E1(bp) && | 6084 | if (CHIP_IS_E1(bp) && |
6067 | ((speed == SPEED_2500) || | 6085 | ((speed == SPEED_2500) || |
@@ -10309,22 +10327,6 @@ static int bnx2x_54618se_config_init(struct bnx2x_phy *phy, | |||
10309 | return 0; | 10327 | return 0; |
10310 | } | 10328 | } |
10311 | 10329 | ||
10312 | static void bnx2x_54618se_set_link_led(struct bnx2x_phy *phy, | ||
10313 | struct link_params *params, u8 mode) | ||
10314 | { | ||
10315 | struct bnx2x *bp = params->bp; | ||
10316 | DP(NETIF_MSG_LINK, "54618SE set link led (mode=%x)\n", mode); | ||
10317 | switch (mode) { | ||
10318 | case LED_MODE_FRONT_PANEL_OFF: | ||
10319 | case LED_MODE_OFF: | ||
10320 | case LED_MODE_OPER: | ||
10321 | case LED_MODE_ON: | ||
10322 | default: | ||
10323 | break; | ||
10324 | } | ||
10325 | return; | ||
10326 | } | ||
10327 | |||
10328 | static void bnx2x_54618se_link_reset(struct bnx2x_phy *phy, | 10330 | static void bnx2x_54618se_link_reset(struct bnx2x_phy *phy, |
10329 | struct link_params *params) | 10331 | struct link_params *params) |
10330 | { | 10332 | { |
@@ -11101,7 +11103,7 @@ static struct bnx2x_phy phy_54618se = { | |||
11101 | .config_loopback = (config_loopback_t)bnx2x_54618se_config_loopback, | 11103 | .config_loopback = (config_loopback_t)bnx2x_54618se_config_loopback, |
11102 | .format_fw_ver = (format_fw_ver_t)NULL, | 11104 | .format_fw_ver = (format_fw_ver_t)NULL, |
11103 | .hw_reset = (hw_reset_t)NULL, | 11105 | .hw_reset = (hw_reset_t)NULL, |
11104 | .set_link_led = (set_link_led_t)bnx2x_54618se_set_link_led, | 11106 | .set_link_led = (set_link_led_t)NULL, |
11105 | .phy_specific_func = (phy_specific_func_t)NULL | 11107 | .phy_specific_func = (phy_specific_func_t)NULL |
11106 | }; | 11108 | }; |
11107 | /*****************************************************************/ | 11109 | /*****************************************************************/ |