diff options
author | Matt Carlson <mcarlson@broadcom.com> | 2011-11-17 14:30:55 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-21 15:27:19 -0500 |
commit | 37f07023d30708b5da091fe6d6be9b60783c6d82 (patch) | |
tree | e4f576abd841cdeddc6cbdc9da6b083277784295 /drivers/net/mii.c | |
parent | b8ffdbd05f8692cdadccd04464271e48b1e8d439 (diff) |
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 <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/mii.c')
-rw-r--r-- | drivers/net/mii.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/net/mii.c b/drivers/net/mii.c index d0a296272713..c70c2332d15e 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; |