diff options
author | Matt Carlson <mcarlson@broadcom.com> | 2012-02-22 07:35:19 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-02-23 01:57:17 -0500 |
commit | d13ba512cbba7de5d55d7a3b2aae7d83c8921457 (patch) | |
tree | d0c284b767071ab109b7e881354ad32d36655d5d /drivers/net/ethernet/broadcom/tg3.c | |
parent | 34655ad63893d3dd64f3fbaaaa0791550e554fa9 (diff) |
tg3: Remove SPEED_UNKNOWN checks
tg3_phy_copper_begin() has code that configures the link
advertisements through the use of the link_config.speed and
link_config.duplex members. The driver does not internally use these
members in this way, nor is it (currently) permitted via the ethtool
interface. This patch removes the dead code.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/tg3.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/tg3.c | 67 |
1 files changed, 23 insertions, 44 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 0caf565fafe4..f921484d2086 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -3894,51 +3894,33 @@ done: | |||
3894 | 3894 | ||
3895 | static void tg3_phy_copper_begin(struct tg3 *tp) | 3895 | static void tg3_phy_copper_begin(struct tg3 *tp) |
3896 | { | 3896 | { |
3897 | u32 new_adv; | 3897 | if (tp->link_config.autoneg == AUTONEG_ENABLE || |
3898 | int i; | 3898 | (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)) { |
3899 | 3899 | u32 adv, fc; | |
3900 | if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER) { | 3900 | |
3901 | new_adv = ADVERTISED_10baseT_Half | | 3901 | if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER) { |
3902 | ADVERTISED_10baseT_Full; | 3902 | adv = ADVERTISED_10baseT_Half | |
3903 | if (tg3_flag(tp, WOL_SPEED_100MB)) | 3903 | ADVERTISED_10baseT_Full; |
3904 | new_adv |= ADVERTISED_100baseT_Half | | 3904 | if (tg3_flag(tp, WOL_SPEED_100MB)) |
3905 | ADVERTISED_100baseT_Full; | 3905 | adv |= ADVERTISED_100baseT_Half | |
3906 | 3906 | ADVERTISED_100baseT_Full; | |
3907 | tg3_phy_autoneg_cfg(tp, new_adv, | 3907 | |
3908 | FLOW_CTRL_TX | FLOW_CTRL_RX); | 3908 | fc = FLOW_CTRL_TX | FLOW_CTRL_RX; |
3909 | } else if (tp->link_config.speed == SPEED_UNKNOWN) { | ||
3910 | if (tp->phy_flags & TG3_PHYFLG_10_100_ONLY) | ||
3911 | tp->link_config.advertising &= | ||
3912 | ~(ADVERTISED_1000baseT_Half | | ||
3913 | ADVERTISED_1000baseT_Full); | ||
3914 | |||
3915 | tg3_phy_autoneg_cfg(tp, tp->link_config.advertising, | ||
3916 | tp->link_config.flowctrl); | ||
3917 | } else { | ||
3918 | /* Asking for a specific link mode. */ | ||
3919 | if (tp->link_config.speed == SPEED_1000) { | ||
3920 | if (tp->link_config.duplex == DUPLEX_FULL) | ||
3921 | new_adv = ADVERTISED_1000baseT_Full; | ||
3922 | else | ||
3923 | new_adv = ADVERTISED_1000baseT_Half; | ||
3924 | } else if (tp->link_config.speed == SPEED_100) { | ||
3925 | if (tp->link_config.duplex == DUPLEX_FULL) | ||
3926 | new_adv = ADVERTISED_100baseT_Full; | ||
3927 | else | ||
3928 | new_adv = ADVERTISED_100baseT_Half; | ||
3929 | } else { | 3909 | } else { |
3930 | if (tp->link_config.duplex == DUPLEX_FULL) | 3910 | adv = tp->link_config.advertising; |
3931 | new_adv = ADVERTISED_10baseT_Full; | 3911 | if (tp->phy_flags & TG3_PHYFLG_10_100_ONLY) |
3932 | else | 3912 | adv &= ~(ADVERTISED_1000baseT_Half | |
3933 | new_adv = ADVERTISED_10baseT_Half; | 3913 | ADVERTISED_1000baseT_Full); |
3914 | |||
3915 | fc = tp->link_config.flowctrl; | ||
3934 | } | 3916 | } |
3935 | 3917 | ||
3936 | tg3_phy_autoneg_cfg(tp, new_adv, | 3918 | tg3_phy_autoneg_cfg(tp, adv, fc); |
3937 | tp->link_config.flowctrl); | ||
3938 | } | ||
3939 | 3919 | ||
3940 | if (tp->link_config.autoneg == AUTONEG_DISABLE && | 3920 | tg3_writephy(tp, MII_BMCR, |
3941 | tp->link_config.speed != SPEED_UNKNOWN) { | 3921 | BMCR_ANENABLE | BMCR_ANRESTART); |
3922 | } else { | ||
3923 | int i; | ||
3942 | u32 bmcr, orig_bmcr; | 3924 | u32 bmcr, orig_bmcr; |
3943 | 3925 | ||
3944 | tp->link_config.active_speed = tp->link_config.speed; | 3926 | tp->link_config.active_speed = tp->link_config.speed; |
@@ -3980,9 +3962,6 @@ static void tg3_phy_copper_begin(struct tg3 *tp) | |||
3980 | tg3_writephy(tp, MII_BMCR, bmcr); | 3962 | tg3_writephy(tp, MII_BMCR, bmcr); |
3981 | udelay(40); | 3963 | udelay(40); |
3982 | } | 3964 | } |
3983 | } else { | ||
3984 | tg3_writephy(tp, MII_BMCR, | ||
3985 | BMCR_ANENABLE | BMCR_ANRESTART); | ||
3986 | } | 3965 | } |
3987 | } | 3966 | } |
3988 | 3967 | ||