diff options
author | Matt Carlson <mcarlson@broadcom.com> | 2011-12-14 06:10:00 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-15 13:09:11 -0500 |
commit | f88788f0da6326cbcaa837e12c8c074027891f07 (patch) | |
tree | 1870e30248509a56538961d1f43347982b03b35d /drivers | |
parent | 55086ad95d740577def0b4e6ecc2c0ae9b0d6dec (diff) |
tg3: Use mii_advertise_flowctrl
This patch replaces tg3's internal tg3_advert_flowctrl_1000T function
with mii_advertise_flowctrl provided by the kernel headers.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/broadcom/tg3.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 90ef94292a9c..0766d032bd9b 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -1671,22 +1671,6 @@ static void tg3_link_report(struct tg3 *tp) | |||
1671 | } | 1671 | } |
1672 | } | 1672 | } |
1673 | 1673 | ||
1674 | static u16 tg3_advert_flowctrl_1000T(u8 flow_ctrl) | ||
1675 | { | ||
1676 | u16 miireg; | ||
1677 | |||
1678 | if ((flow_ctrl & FLOW_CTRL_TX) && (flow_ctrl & FLOW_CTRL_RX)) | ||
1679 | miireg = ADVERTISE_PAUSE_CAP; | ||
1680 | else if (flow_ctrl & FLOW_CTRL_TX) | ||
1681 | miireg = ADVERTISE_PAUSE_ASYM; | ||
1682 | else if (flow_ctrl & FLOW_CTRL_RX) | ||
1683 | miireg = ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM; | ||
1684 | else | ||
1685 | miireg = 0; | ||
1686 | |||
1687 | return miireg; | ||
1688 | } | ||
1689 | |||
1690 | static u16 tg3_advert_flowctrl_1000X(u8 flow_ctrl) | 1674 | static u16 tg3_advert_flowctrl_1000X(u8 flow_ctrl) |
1691 | { | 1675 | { |
1692 | u16 miireg; | 1676 | u16 miireg; |
@@ -1787,7 +1771,7 @@ static void tg3_adjust_link(struct net_device *dev) | |||
1787 | if (phydev->duplex == DUPLEX_HALF) | 1771 | if (phydev->duplex == DUPLEX_HALF) |
1788 | mac_mode |= MAC_MODE_HALF_DUPLEX; | 1772 | mac_mode |= MAC_MODE_HALF_DUPLEX; |
1789 | else { | 1773 | else { |
1790 | lcl_adv = tg3_advert_flowctrl_1000T( | 1774 | lcl_adv = mii_advertise_flowctrl( |
1791 | tp->link_config.flowctrl); | 1775 | tp->link_config.flowctrl); |
1792 | 1776 | ||
1793 | if (phydev->pause) | 1777 | if (phydev->pause) |
@@ -3589,7 +3573,7 @@ static int tg3_phy_autoneg_cfg(struct tg3 *tp, u32 advertise, u32 flowctrl) | |||
3589 | 3573 | ||
3590 | new_adv = ADVERTISE_CSMA; | 3574 | new_adv = ADVERTISE_CSMA; |
3591 | new_adv |= ethtool_adv_to_mii_adv_t(advertise) & ADVERTISE_ALL; | 3575 | new_adv |= ethtool_adv_to_mii_adv_t(advertise) & ADVERTISE_ALL; |
3592 | new_adv |= tg3_advert_flowctrl_1000T(flowctrl); | 3576 | new_adv |= mii_advertise_flowctrl(flowctrl); |
3593 | 3577 | ||
3594 | err = tg3_writephy(tp, MII_ADVERTISE, new_adv); | 3578 | err = tg3_writephy(tp, MII_ADVERTISE, new_adv); |
3595 | if (err) | 3579 | if (err) |
@@ -3777,7 +3761,7 @@ static bool tg3_phy_copper_an_config_ok(struct tg3 *tp, u32 *lcladv) | |||
3777 | 3761 | ||
3778 | advmsk = ADVERTISE_ALL; | 3762 | advmsk = ADVERTISE_ALL; |
3779 | if (tp->link_config.active_duplex == DUPLEX_FULL) { | 3763 | if (tp->link_config.active_duplex == DUPLEX_FULL) { |
3780 | tgtadv |= tg3_advert_flowctrl_1000T(tp->link_config.flowctrl); | 3764 | tgtadv |= mii_advertise_flowctrl(tp->link_config.flowctrl); |
3781 | advmsk |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM; | 3765 | advmsk |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM; |
3782 | } | 3766 | } |
3783 | 3767 | ||