Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1524228
| From | khalasa@piap.pl (Krzysztof Hałasa) |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 01/15] net: phy: Add phy_ethtool_nway_reset |
| Date | 2016-11-17 11:10 +0100 |
| Message-ID | <sErNN-7If-47@gated-at.bofh.it> (permalink) |
| References | <sDQlb-8ps-5@gated-at.bofh.it> <sDQlb-8ps-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi,
Florian Fainelli <f.fainelli@gmail.com> writes:
> This function just calls into genphy_restart_aneg() to perform an
> autonegotation restart.
>
> +int phy_ethtool_nway_reset(struct net_device *ndev)
> +{
> + struct phy_device *phydev = ndev->phydev;
> +
> + if (!phydev)
> + return -ENODEV;
> +
> + return genphy_restart_aneg(phydev);
> +}
and then you're using this function as .nway_reset of all netdev drivers
in question.
genphy_restart_aneg() deals directly with MII BMCR register:
int genphy_restart_aneg(struct phy_device *phydev)
{
int ctl = phy_read(phydev, MII_BMCR);
if (ctl < 0)
return ctl;
ctl |= BMCR_ANENABLE | BMCR_ANRESTART;
/* Don't isolate the PHY if we're negotiating */
ctl &= ~BMCR_ISOLATE;
return phy_write(phydev, MII_BMCR, ctl);
}
Will the above work if the PHY is something special, e.g. a "fixed"
connection, or some kind of fiber trx etc? Normally, the PHY driver
could provide its own config_aneg().
--
Krzysztof Halasa
Industrial Research Institute for Automation and Measurements PIAP
Al. Jerozolimskie 202, 02-486 Warsaw, Poland
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 01/15] net: phy: Add phy_ethtool_nway_reset Florian Fainelli <f.fainelli@gmail.com> - 2016-11-15 19:10 +0100 Re: [PATCH 01/15] net: phy: Add phy_ethtool_nway_reset khalasa@piap.pl (Krzysztof Hałasa) - 2016-11-17 11:10 +0100
csiph-web