Heiner Kallweit d1420bb995 net: phy: improve generic EEE ethtool functions
So far the two functions consider neither member eee_enabled nor
eee_active. Therefore network drivers have to do this in some kind
of glue code. I think this can be avoided.

Getting EEE parameters:
When not advertising any EEE mode, we can't consider EEE to be enabled.
Therefore interpret "EEE enabled" as "we advertise at least one EEE
mode". It's similar with "EEE active": interpret it as "EEE modes
advertised by both link partner have at least one mode in common".

Setting EEE parameters:
If eee_enabled isn't set, don't advertise any EEE mode and restart
aneg if needed to switch off EEE. If eee_enabled is set and
data->advertised is empty (e.g. because EEE was disabled), advertise
everything we support as default. This way EEE can easily switched
on/off by doing ethtool --set-eee <if> eee on/off, w/o any additional
parameters.

The changes to both functions shouldn't break any existing user.
Once the changes have been applied, at least some users can be
simplified.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-12-03 15:13:25 -08:00
..
2018-11-01 18:34:46 -07:00
2018-11-16 09:31:59 -06:00
2018-10-29 15:16:01 -07:00
2018-10-27 09:24:24 -07:00
2018-10-25 06:50:48 -07:00
2018-10-16 11:13:50 +02:00
2018-10-11 12:12:55 +02:00
2018-11-09 17:56:44 +01:00
2018-10-29 10:38:10 -07:00
2018-11-08 17:49:04 -06:00
2018-11-02 11:25:48 -07:00
2018-10-31 16:47:55 -07:00
2018-10-25 06:31:56 -07:00
2018-11-09 16:41:58 -06:00
2018-10-26 14:36:21 -07:00
2018-10-22 17:30:06 +01:00
2018-10-26 08:14:13 -07:00
2018-11-01 08:42:21 -07:00
2018-10-26 12:09:58 -07:00
2018-10-29 15:16:01 -07:00
2018-10-31 08:54:16 -07:00
2018-11-28 08:33:55 -08:00
2018-10-11 09:16:44 -07:00
2018-11-10 13:32:14 -06:00
2018-11-11 09:21:46 -08:00
2018-11-22 08:39:29 -08:00
2018-10-31 11:01:38 -07:00
2018-10-31 11:41:37 -07:00
2018-11-10 08:58:48 -06:00