Skip to content

Commit 372788f

Browse files
tlendackydavem330
authored andcommitted
net: phy: expose phy_aneg_done API for use by drivers
Make phy_aneg_done() available to drivers so that the result of the auto-negotiation initiated by phy_start_aneg() can be determined. Remove the local implementation of phy_aneg_done() from the Aeroflex driver and use the phy library version. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5ab1dcd commit 372788f

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

drivers/net/ethernet/aeroflex/greth.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,15 +1290,6 @@ static int greth_mdio_probe(struct net_device *dev)
12901290
return 0;
12911291
}
12921292

1293-
static inline int phy_aneg_done(struct phy_device *phydev)
1294-
{
1295-
int retval;
1296-
1297-
retval = phy_read(phydev, MII_BMSR);
1298-
1299-
return (retval < 0) ? retval : (retval & BMSR_ANEGCOMPLETE);
1300-
}
1301-
13021293
static int greth_mdio_init(struct greth_private *greth)
13031294
{
13041295
int ret;

drivers/net/phy/phy.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,14 @@ static int phy_config_interrupt(struct phy_device *phydev, u32 interrupts)
143143
* Returns > 0 on success or < 0 on error. 0 means that auto-negotiation
144144
* is still pending.
145145
*/
146-
static inline int phy_aneg_done(struct phy_device *phydev)
146+
int phy_aneg_done(struct phy_device *phydev)
147147
{
148148
if (phydev->drv->aneg_done)
149149
return phydev->drv->aneg_done(phydev);
150150

151151
return genphy_aneg_done(phydev);
152152
}
153+
EXPORT_SYMBOL(phy_aneg_done);
153154

154155
/* A structure for mapping a particular speed and duplex
155156
* combination to a particular SUPPORTED and ADVERTISED value

include/linux/phy.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,7 @@ void phy_detach(struct phy_device *phydev);
786786
void phy_start(struct phy_device *phydev);
787787
void phy_stop(struct phy_device *phydev);
788788
int phy_start_aneg(struct phy_device *phydev);
789+
int phy_aneg_done(struct phy_device *phydev);
789790

790791
int phy_stop_interrupts(struct phy_device *phydev);
791792

0 commit comments

Comments
 (0)