From 37f07023d30708b5da091fe6d6be9b60783c6d82 Mon Sep 17 00:00:00 2001 From: Matt Carlson Date: Thu, 17 Nov 2011 14:30:55 +0000 Subject: net: Change mii to ethtool advertisement function names This patch implements advice by Ben Hutchings to change the mii side of the function names to look more like the register whose values they convert. New LPA translation functions have been added as well. Signed-off-by: Matt Carlson Signed-off-by: Michael Chan Signed-off-by: David S. Miller --- drivers/net/mii.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'drivers/net/mii.c') diff --git a/drivers/net/mii.c b/drivers/net/mii.c index d0a29627271..c70c2332d15 100644 --- a/drivers/net/mii.c +++ b/drivers/net/mii.c @@ -35,14 +35,11 @@ static u32 mii_get_an(struct mii_if_info *mii, u16 addr) { - u32 result = 0; int advert; advert = mii->mdio_read(mii->dev, mii->phy_id, addr); - if (advert & LPA_LPACK) - result |= ADVERTISED_Autoneg; - return result | mii_adv_to_ethtool_100bt(advert); + return mii_lpa_to_ethtool_lpa_t(advert); } /** @@ -93,12 +90,13 @@ int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd) ecmd->advertising |= mii_get_an(mii, MII_ADVERTISE); if (mii->supports_gmii) - ecmd->advertising |= mii_adv_to_ethtool_1000T(ctrl1000); + ecmd->advertising |= + mii_ctrl1000_to_ethtool_adv_t(ctrl1000); if (bmsr & BMSR_ANEGCOMPLETE) { ecmd->lp_advertising = mii_get_an(mii, MII_LPA); ecmd->lp_advertising |= - mii_lpa_to_ethtool_1000T(stat1000); + mii_stat1000_to_ethtool_lpa_t(stat1000); } else { ecmd->lp_advertising = 0; } @@ -186,10 +184,11 @@ int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd) advert2 = mii->mdio_read(dev, mii->phy_id, MII_CTRL1000); tmp2 = advert2 & ~(ADVERTISE_1000HALF | ADVERTISE_1000FULL); } - tmp |= ethtool_adv_to_mii_100bt(ecmd->advertising); + tmp |= ethtool_adv_to_mii_adv_t(ecmd->advertising); if (mii->supports_gmii) - tmp2 |= ethtool_adv_to_mii_1000T(ecmd->advertising); + tmp2 |= + ethtool_adv_to_mii_ctrl1000_t(ecmd->advertising); if (advert != tmp) { mii->mdio_write(dev, mii->phy_id, MII_ADVERTISE, tmp); mii->advertising = tmp; -- cgit v1.2.3-18-g5258