aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.c
diff options
context:
space:
mode:
authorMatt Carlson <mcarlson@broadcom.com>2007-12-20 23:09:00 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:59:33 -0500
commit82cd3d11f359763da445a7636ee683a922aaf025 (patch)
treecf379bfb47a1c837e49601d43ff4ee4db664bc9f /drivers/net/tg3.c
parentc98f6e3be1d1b9bc9299d84da4f0b1ea9a50f392 (diff)
[TG3]: Correct 5704S flowctrl advertisements
This patch modifies the 5704S hardware autoneg code to use the administrator specified flow control parameters. Since the 5704S uses device specific flow control enumerations, the 1000-BaseX utility functions are used and code was added to convert the definitions to and from the proprietary enumerations. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r--drivers/net/tg3.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 6575e9bc170f..3caead4c2702 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -1695,7 +1695,7 @@ static void tg3_setup_flow_control(struct tg3 *tp, u32 local_adv, u32 remote_adv
1695 u32 old_tx_mode = tp->tx_mode; 1695 u32 old_tx_mode = tp->tx_mode;
1696 1696
1697 if (tp->tg3_flags & TG3_FLAG_PAUSE_AUTONEG) { 1697 if (tp->tg3_flags & TG3_FLAG_PAUSE_AUTONEG) {
1698 if (tp->tg3_flags2 & TG3_FLG2_MII_SERDES) 1698 if (tp->tg3_flags2 & (TG3_FLG2_MII_SERDES|TG3_FLG2_HW_AUTONEG))
1699 new_tg3_flags = tg3_resolve_flowctrl_1000X(local_adv, 1699 new_tg3_flags = tg3_resolve_flowctrl_1000X(local_adv,
1700 remote_adv); 1700 remote_adv);
1701 else 1701 else
@@ -2658,6 +2658,7 @@ static void tg3_init_bcm8002(struct tg3 *tp)
2658 2658
2659static int tg3_setup_fiber_hw_autoneg(struct tg3 *tp, u32 mac_status) 2659static int tg3_setup_fiber_hw_autoneg(struct tg3 *tp, u32 mac_status)
2660{ 2660{
2661 u16 flowctrl;
2661 u32 sg_dig_ctrl, sg_dig_status; 2662 u32 sg_dig_ctrl, sg_dig_status;
2662 u32 serdes_cfg, expected_sg_dig_ctrl; 2663 u32 serdes_cfg, expected_sg_dig_ctrl;
2663 int workaround, port_a; 2664 int workaround, port_a;
@@ -2706,11 +2707,11 @@ static int tg3_setup_fiber_hw_autoneg(struct tg3 *tp, u32 mac_status)
2706 /* Want auto-negotiation. */ 2707 /* Want auto-negotiation. */
2707 expected_sg_dig_ctrl = SG_DIG_USING_HW_AUTONEG | SG_DIG_COMMON_SETUP; 2708 expected_sg_dig_ctrl = SG_DIG_USING_HW_AUTONEG | SG_DIG_COMMON_SETUP;
2708 2709
2709 /* Pause capability */ 2710 flowctrl = tg3_advert_flowctrl_1000X(tp->link_config.flowctrl);
2710 expected_sg_dig_ctrl |= SG_DIG_PAUSE_CAP; 2711 if (flowctrl & ADVERTISE_1000XPAUSE)
2711 2712 expected_sg_dig_ctrl |= SG_DIG_PAUSE_CAP;
2712 /* Asymettric pause */ 2713 if (flowctrl & ADVERTISE_1000XPSE_ASYM)
2713 expected_sg_dig_ctrl |= SG_DIG_ASYM_PAUSE; 2714 expected_sg_dig_ctrl |= SG_DIG_ASYM_PAUSE;
2714 2715
2715 if (sg_dig_ctrl != expected_sg_dig_ctrl) { 2716 if (sg_dig_ctrl != expected_sg_dig_ctrl) {
2716 if ((tp->tg3_flags2 & TG3_FLG2_PARALLEL_DETECT) && 2717 if ((tp->tg3_flags2 & TG3_FLG2_PARALLEL_DETECT) &&
@@ -2738,14 +2739,17 @@ restart_autoneg:
2738 2739
2739 if ((sg_dig_status & SG_DIG_AUTONEG_COMPLETE) && 2740 if ((sg_dig_status & SG_DIG_AUTONEG_COMPLETE) &&
2740 (mac_status & MAC_STATUS_PCS_SYNCED)) { 2741 (mac_status & MAC_STATUS_PCS_SYNCED)) {
2741 u32 local_adv, remote_adv; 2742 u32 local_adv = 0, remote_adv = 0;
2743
2744 if (sg_dig_ctrl & SG_DIG_PAUSE_CAP)
2745 local_adv |= ADVERTISE_1000XPAUSE;
2746 if (sg_dig_ctrl & SG_DIG_ASYM_PAUSE)
2747 local_adv |= ADVERTISE_1000XPSE_ASYM;
2742 2748
2743 local_adv = ADVERTISE_PAUSE_CAP;
2744 remote_adv = 0;
2745 if (sg_dig_status & SG_DIG_PARTNER_PAUSE_CAPABLE) 2749 if (sg_dig_status & SG_DIG_PARTNER_PAUSE_CAPABLE)
2746 remote_adv |= LPA_PAUSE_CAP; 2750 remote_adv |= LPA_1000XPAUSE;
2747 if (sg_dig_status & SG_DIG_PARTNER_ASYM_PAUSE) 2751 if (sg_dig_status & SG_DIG_PARTNER_ASYM_PAUSE)
2748 remote_adv |= LPA_PAUSE_ASYM; 2752 remote_adv |= LPA_1000XPAUSE_ASYM;
2749 2753
2750 tg3_setup_flow_control(tp, local_adv, remote_adv); 2754 tg3_setup_flow_control(tp, local_adv, remote_adv);
2751 current_link_up = 1; 2755 current_link_up = 1;