diff options
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/mdio-bitbang.c | 9 | ||||
-rw-r--r-- | drivers/net/phy/mdio-gpio.c | 1 | ||||
-rw-r--r-- | drivers/net/phy/phy_device.c | 20 |
3 files changed, 13 insertions, 17 deletions
diff --git a/drivers/net/phy/mdio-bitbang.c b/drivers/net/phy/mdio-bitbang.c index 65391891d8c4..daec9b05d168 100644 --- a/drivers/net/phy/mdio-bitbang.c +++ b/drivers/net/phy/mdio-bitbang.c | |||
@@ -202,6 +202,14 @@ static int mdiobb_write(struct mii_bus *bus, int phy, int reg, u16 val) | |||
202 | return 0; | 202 | return 0; |
203 | } | 203 | } |
204 | 204 | ||
205 | static int mdiobb_reset(struct mii_bus *bus) | ||
206 | { | ||
207 | struct mdiobb_ctrl *ctrl = bus->priv; | ||
208 | if (ctrl->reset) | ||
209 | ctrl->reset(bus); | ||
210 | return 0; | ||
211 | } | ||
212 | |||
205 | struct mii_bus *alloc_mdio_bitbang(struct mdiobb_ctrl *ctrl) | 213 | struct mii_bus *alloc_mdio_bitbang(struct mdiobb_ctrl *ctrl) |
206 | { | 214 | { |
207 | struct mii_bus *bus; | 215 | struct mii_bus *bus; |
@@ -214,6 +222,7 @@ struct mii_bus *alloc_mdio_bitbang(struct mdiobb_ctrl *ctrl) | |||
214 | 222 | ||
215 | bus->read = mdiobb_read; | 223 | bus->read = mdiobb_read; |
216 | bus->write = mdiobb_write; | 224 | bus->write = mdiobb_write; |
225 | bus->reset = mdiobb_reset; | ||
217 | bus->priv = ctrl; | 226 | bus->priv = ctrl; |
218 | 227 | ||
219 | return bus; | 228 | return bus; |
diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c index 2843c90f712f..89c5a3eccc12 100644 --- a/drivers/net/phy/mdio-gpio.c +++ b/drivers/net/phy/mdio-gpio.c | |||
@@ -95,6 +95,7 @@ static struct mii_bus * __devinit mdio_gpio_bus_init(struct device *dev, | |||
95 | goto out; | 95 | goto out; |
96 | 96 | ||
97 | bitbang->ctrl.ops = &mdio_gpio_ops; | 97 | bitbang->ctrl.ops = &mdio_gpio_ops; |
98 | bitbang->ctrl.reset = pdata->reset; | ||
98 | bitbang->mdc = pdata->mdc; | 99 | bitbang->mdc = pdata->mdc; |
99 | bitbang->mdio = pdata->mdio; | 100 | bitbang->mdio = pdata->mdio; |
100 | 101 | ||
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 83a5a5afec67..f320f466f03b 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
@@ -563,20 +563,9 @@ static int genphy_config_advert(struct phy_device *phydev) | |||
563 | if (adv < 0) | 563 | if (adv < 0) |
564 | return adv; | 564 | return adv; |
565 | 565 | ||
566 | adv &= ~(ADVERTISE_ALL | ADVERTISE_100BASE4 | ADVERTISE_PAUSE_CAP | | 566 | adv &= ~(ADVERTISE_ALL | ADVERTISE_100BASE4 | ADVERTISE_PAUSE_CAP | |
567 | ADVERTISE_PAUSE_ASYM); | 567 | ADVERTISE_PAUSE_ASYM); |
568 | if (advertise & ADVERTISED_10baseT_Half) | 568 | adv |= ethtool_adv_to_mii_adv_t(advertise); |
569 | adv |= ADVERTISE_10HALF; | ||
570 | if (advertise & ADVERTISED_10baseT_Full) | ||
571 | adv |= ADVERTISE_10FULL; | ||
572 | if (advertise & ADVERTISED_100baseT_Half) | ||
573 | adv |= ADVERTISE_100HALF; | ||
574 | if (advertise & ADVERTISED_100baseT_Full) | ||
575 | adv |= ADVERTISE_100FULL; | ||
576 | if (advertise & ADVERTISED_Pause) | ||
577 | adv |= ADVERTISE_PAUSE_CAP; | ||
578 | if (advertise & ADVERTISED_Asym_Pause) | ||
579 | adv |= ADVERTISE_PAUSE_ASYM; | ||
580 | 569 | ||
581 | if (adv != oldadv) { | 570 | if (adv != oldadv) { |
582 | err = phy_write(phydev, MII_ADVERTISE, adv); | 571 | err = phy_write(phydev, MII_ADVERTISE, adv); |
@@ -595,10 +584,7 @@ static int genphy_config_advert(struct phy_device *phydev) | |||
595 | return adv; | 584 | return adv; |
596 | 585 | ||
597 | adv &= ~(ADVERTISE_1000FULL | ADVERTISE_1000HALF); | 586 | adv &= ~(ADVERTISE_1000FULL | ADVERTISE_1000HALF); |
598 | if (advertise & SUPPORTED_1000baseT_Half) | 587 | adv |= ethtool_adv_to_mii_ctrl1000_t(advertise); |
599 | adv |= ADVERTISE_1000HALF; | ||
600 | if (advertise & SUPPORTED_1000baseT_Full) | ||
601 | adv |= ADVERTISE_1000FULL; | ||
602 | 588 | ||
603 | if (adv != oldadv) { | 589 | if (adv != oldadv) { |
604 | err = phy_write(phydev, MII_CTRL1000, adv); | 590 | err = phy_write(phydev, MII_CTRL1000, adv); |