net: phy: aquantia: add downshift support
authorHeiner Kallweit <hkallweit1@gmail.com>
Thu, 21 Mar 2019 20:08:35 +0000 (21:08 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Mar 2019 14:26:21 +0000 (10:26 -0400)
commit110a2432c5203d62e5df31180aa0cbd21ea76f82
tree16d9c8226f4bf5e444ac37ef6d2883a62b192980
parent1d965c4def07defeb2f3b0eb927e891c45f46748
net: phy: aquantia: add downshift support

Aquantia PHY's of the AQR107 family support the downshift feature.
Add support for it as standard PHY tunable so that it can be controlled
via ethtool.
The AQCS109 supports a proprietary 2-pair 1Gbps mode. If two such PHY's
are connected to each other with a 2-pair cable, they may not be able
to establish a link if both advertise modes > 1Gbps.

v2:
- add downshift event detection
- warn if downshift occurred
- read downshifted rate from vendor register
- enable downshift per default on all AQR107 family members

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/aquantia_main.c