Commit 8d1e0657 authored by Jeff Garzik's avatar Jeff Garzik

[netdrvr mii] fix ugly lack of useful bit masking

Found by Ion Badulescu.
parent 380ddbbd
...@@ -124,13 +124,13 @@ int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd) ...@@ -124,13 +124,13 @@ int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd)
/* advertise only what has been requested */ /* advertise only what has been requested */
advert = mii->mdio_read(dev, mii->phy_id, MII_ADVERTISE); advert = mii->mdio_read(dev, mii->phy_id, MII_ADVERTISE);
tmp = advert & ~(ADVERTISE_ALL | ADVERTISE_100BASE4); tmp = advert & ~(ADVERTISE_ALL | ADVERTISE_100BASE4);
if (ADVERTISED_10baseT_Half) if (ecmd->advertising & ADVERTISED_10baseT_Half)
tmp |= ADVERTISE_10HALF; tmp |= ADVERTISE_10HALF;
if (ADVERTISED_10baseT_Full) if (ecmd->advertising & ADVERTISED_10baseT_Full)
tmp |= ADVERTISE_10FULL; tmp |= ADVERTISE_10FULL;
if (ADVERTISED_100baseT_Half) if (ecmd->advertising & ADVERTISED_100baseT_Half)
tmp |= ADVERTISE_100HALF; tmp |= ADVERTISE_100HALF;
if (ADVERTISED_100baseT_Full) if (ecmd->advertising & ADVERTISED_100baseT_Full)
tmp |= ADVERTISE_100FULL; tmp |= ADVERTISE_100FULL;
if (advert != tmp) { if (advert != tmp) {
mii->mdio_write(dev, mii->phy_id, MII_ADVERTISE, tmp); mii->mdio_write(dev, mii->phy_id, MII_ADVERTISE, tmp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment