ethtool: Add ability to control transceiver modules' power mode

Add ability to control transceiver modules' power mode over netlink.

Example output and usage:

 # ip link set dev swp11 up

 $ ethtool --show-module swp11
 Module parameters for swp11:
 power-mode-policy: high
 power-mode: high

 $ ethtool --json --show-module swp11
 [ {
        "ifname": "swp11",
        "power-mode-policy": "high",
        "power-mode": "high"
    } ]

 # ethtool --set-module swp11 power-mode-policy auto

 $ ethtool --show-module swp11
 Module parameters for swp11:
 power-mode-policy: auto
 power-mode: high

 # ethtool --set-module swp11 power-mode-policy auto

 # ethtool --set-module swp11 power-mode-policy high

Despite three set commands, only two notifications were emitted, as the
kernel only emits notifications when an attribute changes:

 $ ethtool --monitor
 listening...

 Module parameters for swp11:
 power-mode-policy: auto
 power-mode: high

 Module parameters for swp11:
 power-mode-policy: high
 power-mode: high

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
9 files changed