net: phy: add genphy_c45_read_eee_abilities() function
authorOleksij Rempel <o.rempel@pengutronix.de>
Sat, 11 Feb 2023 07:41:06 +0000 (08:41 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 13 Feb 2023 11:12:31 +0000 (11:12 +0000)
commit14e47d1fb8f9596acc90a06a66808657a9c512b5
tree17bdba9f6f8c4ccdcc073c7a5fda926feaa33b2b
parent69d3b36ca045582356fc3d2c92366b200506f936
net: phy: add genphy_c45_read_eee_abilities() function

Add generic function for EEE abilities defined by IEEE 802.3
specification. For now following registers are supported:
- IEEE 802.3-2018 45.2.3.10 EEE control and capability 1 (Register 3.20)
- IEEE 802.3cg-2019 45.2.1.186b 10BASE-T1L PMA status register
  (Register 1.2295)

Since I was not able to find any flag signaling support of these
registers, we should detect link mode abilities first and then based on
these abilities doing EEE link modes detection.

Results of EEE ability detection will be stored into new variable
phydev->supported_eee.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy-c45.c
drivers/net/phy/phy_device.c
include/linux/mdio.h
include/linux/phy.h