net: phy: Extract genphy_c45_pma_read_abilities from marvell10g
authorMaxime Chevallier <maxime.chevallier@bootlin.com>
Mon, 11 Feb 2019 14:25:28 +0000 (15:25 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 14 Feb 2019 00:17:53 +0000 (19:17 -0500)
commitac3f5533343f6ec7fa24a27f0ae22bbfd27e0b23
tree8d331b1509236d5bdf74e7f500d6b6682c2ec4d7
parent3feb9b23bf4cbf9f34568035170c6f1c25416523
net: phy: Extract genphy_c45_pma_read_abilities from marvell10g

Marvell 10G PHY driver has a generic way of initializing the supported
link modes by reading the PHY's C45 PMA abilities. This can be made
generic, since these registers are part of the 802.3 specifications.

This commit extracts the config_init link_mode initialization code from
marvell10g and uses it to introduce the genphy_c45_pma_read_abilities
function.

Only PMA modes are read, it's still up to the caller to set the Pause
parameters.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/marvell10g.c
drivers/net/phy/phy-c45.c
include/linux/phy.h