OSDN Git Service

net: phy: add genphy_c45_ethtool_get/set_eee() support
authorOleksij Rempel <o.rempel@pengutronix.de>
Sat, 11 Feb 2023 07:41:09 +0000 (08:41 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 13 Feb 2023 11:12:31 +0000 (11:12 +0000)
commit022c3f87f88e2d68e90be7687d981c9cb893a3b1
treefc262dd87f60a5a73f44c535fcb49ff7ca67bb53
parentcf9f6079696840093aa6ea3c0ee405a553afe2fb
net: phy: add genphy_c45_ethtool_get/set_eee() support

Add replacement for phy_ethtool_get/set_eee() functions.

Current phy_ethtool_get/set_eee() implementation is great and it is
possible to make it even better:
- this functionality is for devices implementing parts of IEEE 802.3
  specification beyond Clause 22. The better place for this code is
  phy-c45.c
- currently it is able to do read/write operations on PHYs with
  different abilities to not existing registers. It is better to
  use stored supported_eee abilities to avoid false read/write
  operations.
- the eee_active detection will provide wrong results on not supported
  link modes. It is better to validate speed/duplex properties against
  supported EEE link modes.
- it is able to support only limited amount of link modes. We have more
  EEE link modes...

By refactoring this code I address most of this point except of the last
one. Adding additional EEE link modes will need more work.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy-c45.c
include/linux/mdio.h
include/linux/phy.h
include/uapi/linux/mdio.h