aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.c
diff options
context:
space:
mode:
authorMatt Carlson <mcarlson@broadcom.com>2010-12-06 03:28:52 -0500
committerDavid S. Miller <davem@davemloft.net>2010-12-06 14:03:47 -0500
commita6b68dab169e2a51e59f43504f1279cbc2afcde8 (patch)
tree82f050a3cc08db4a0dc4be03f9d3660e5dccbb29 /drivers/net/tg3.c
parent699c019385fcb13498a5a3a8bd368f04f1d4a223 (diff)
tg3: Minor EEE code tweaks
The first hunk of this patch makes sure that the driver checks for the appropriate preconditions before checking if EEE negotiation succeeded. More specifically the link needs to be full duplex for EEE to be enabled. The second and third hunks of this patch fix a bug where the eee advertisement register would be programmed with extra bits set. The fourth hunk of this patch makes sure the EEE capability flag is not set for 5718 A0 devices and that the device is not a serdes device. None of these modifications are strictly necessary. The driver / hardware still does the right thing. They are submitted primarily for correctness. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r--drivers/net/tg3.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index e4efb5203e22..81dafc26cdff 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -1770,9 +1770,9 @@ static void tg3_phy_eee_adjust(struct tg3 *tp, u32 current_link_up)
1770 1770
1771 if (tp->link_config.autoneg == AUTONEG_ENABLE && 1771 if (tp->link_config.autoneg == AUTONEG_ENABLE &&
1772 current_link_up == 1 && 1772 current_link_up == 1 &&
1773 (tp->link_config.active_speed == SPEED_1000 || 1773 tp->link_config.active_duplex == DUPLEX_FULL &&
1774 (tp->link_config.active_speed == SPEED_100 && 1774 (tp->link_config.active_speed == SPEED_100 ||
1775 tp->link_config.active_duplex == DUPLEX_FULL))) { 1775 tp->link_config.active_speed == SPEED_1000)) {
1776 u32 eeectl; 1776 u32 eeectl;
1777 1777
1778 if (tp->link_config.active_speed == SPEED_1000) 1778 if (tp->link_config.active_speed == SPEED_1000)
@@ -2969,7 +2969,7 @@ static void tg3_phy_copper_begin(struct tg3 *tp)
2969 } 2969 }
2970 2970
2971 if (tp->phy_flags & TG3_PHYFLG_EEE_CAP) { 2971 if (tp->phy_flags & TG3_PHYFLG_EEE_CAP) {
2972 u32 val = 0; 2972 u32 val;
2973 2973
2974 tw32(TG3_CPMU_EEE_MODE, 2974 tw32(TG3_CPMU_EEE_MODE,
2975 tr32(TG3_CPMU_EEE_MODE) & ~TG3_CPMU_EEEMD_LPI_ENABLE); 2975 tr32(TG3_CPMU_EEE_MODE) & ~TG3_CPMU_EEEMD_LPI_ENABLE);
@@ -2986,6 +2986,7 @@ static void tg3_phy_copper_begin(struct tg3 *tp)
2986 tg3_phydsp_write(tp, MII_TG3_DSP_CH34TP2, 2986 tg3_phydsp_write(tp, MII_TG3_DSP_CH34TP2,
2987 val | MII_TG3_DSP_CH34TP2_HIBW01); 2987 val | MII_TG3_DSP_CH34TP2_HIBW01);
2988 2988
2989 val = 0;
2989 if (tp->link_config.autoneg == AUTONEG_ENABLE) { 2990 if (tp->link_config.autoneg == AUTONEG_ENABLE) {
2990 /* Advertise 100-BaseTX EEE ability */ 2991 /* Advertise 100-BaseTX EEE ability */
2991 if (tp->link_config.advertising & 2992 if (tp->link_config.advertising &
@@ -12569,9 +12570,11 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
12569 } 12570 }
12570 } 12571 }
12571 12572
12572 if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718 || 12573 if (!(tp->phy_flags & TG3_PHYFLG_ANY_SERDES) &&
12573 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765 && 12574 ((tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718 &&
12574 tp->pci_chip_rev_id != CHIPREV_ID_57765_A0)) 12575 tp->pci_chip_rev_id != CHIPREV_ID_5717_A0) ||
12576 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765 &&
12577 tp->pci_chip_rev_id != CHIPREV_ID_57765_A0)))
12575 tp->phy_flags |= TG3_PHYFLG_EEE_CAP; 12578 tp->phy_flags |= TG3_PHYFLG_EEE_CAP;
12576 12579
12577 if (!(tp->phy_flags & TG3_PHYFLG_ANY_SERDES) && 12580 if (!(tp->phy_flags & TG3_PHYFLG_ANY_SERDES) &&