Message ID | CAGm1_kv2=9UM2PG3S1J-W+mnASWo+MQ3qd0W6dmB8QQv2X4wnw@mail.gmail.com |
---|---|
State | Superseded |
Headers | show |
Dear Yegor Yefremov, > I'm porting a phy driver from Linux to u-boot and was able to use > genphy_parse_link() without a problem. As mentioned in comment to > genphy_parse_link(), the routine itself was taken from Linux kernel > and many phy drivers are using this generic function. > > Why wasn't it exported? Are there any issues? Ccing Joe ... do you have any consumer for this now exported function? [...] Best regards, Marek Vasut
On Tue, Nov 27, 2012 at 3:57 AM, Marek Vasut <marex@denx.de> wrote: > Dear Yegor Yefremov, > >> I'm porting a phy driver from Linux to u-boot and was able to use >> genphy_parse_link() without a problem. As mentioned in comment to >> genphy_parse_link(), the routine itself was taken from Linux kernel >> and many phy drivers are using this generic function. >> >> Why wasn't it exported? Are there any issues? > > Ccing Joe ... do you have any consumer for this now exported function? Yes, I'm about to submit a phy driver for ICPlus phy and need this export. I tested it with both 100mbit and 1Gbit switches. In both cases phy reported the correct speed. Yegor
On Tue, Nov 27, 2012 at 7:55 AM, Yegor Yefremov <yegorslists@googlemail.com> wrote: > On Tue, Nov 27, 2012 at 3:57 AM, Marek Vasut <marex@denx.de> wrote: >> Dear Yegor Yefremov, >> >>> I'm porting a phy driver from Linux to u-boot and was able to use >>> genphy_parse_link() without a problem. As mentioned in comment to >>> genphy_parse_link(), the routine itself was taken from Linux kernel >>> and many phy drivers are using this generic function. >>> >>> Why wasn't it exported? Are there any issues? >> >> Ccing Joe ... do you have any consumer for this now exported function? > > Yes, I'm about to submit a phy driver for ICPlus phy and need this > export. I tested it with both 100mbit and 1Gbit switches. In both > cases phy reported the correct speed. I've sent a patch series: first patch is exporting the genphy_parse_link() the second is adding ICPlus driver. Yegor
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 1ffa791..c28ea70 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -279,7 +279,7 @@ int genphy_update_link(struct phy_device *phydev) * * Stolen from Linux's mii.c and phy_device.c */ -static int genphy_parse_link(struct phy_device *phydev) +int genphy_parse_link(struct phy_device *phydev) { int mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMSR); diff --git a/include/phy.h b/include/phy.h index 3c30f11..1342ef7 100644 --- a/include/phy.h +++ b/include/phy.h @@ -209,6 +209,7 @@ int phy_register(struct phy_driver *drv); int genphy_config_aneg(struct phy_device *phydev); int genphy_restart_aneg(struct phy_device *phydev); int genphy_update_link(struct phy_device *phydev); +int genphy_parse_link(struct phy_device *phydev); int genphy_config(struct phy_device *phydev); int genphy_startup(struct phy_device *phydev); int genphy_shutdown(struct phy_device *phydev);