]> www.infradead.org Git - users/hch/misc.git/commit
net: pse-pd: Split ethtool_get_status into multiple callbacks
authorKory Maincent <kory.maincent@bootlin.com>
Fri, 10 Jan 2025 09:40:27 +0000 (10:40 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 14 Jan 2025 12:56:32 +0000 (13:56 +0100)
commit3e9dbfec499807767d03592ebdf19d9c15fd495b
tree06004ccf8232ecc07a55ebac92965e9e0af09bf0
parente0a5e2bba38aa61a900934b45d6e846e0a6d7524
net: pse-pd: Split ethtool_get_status into multiple callbacks

The ethtool_get_status callback currently handles all status and PSE
information within a single function. This approach has two key
drawbacks:

1. If the core requires some information for purposes other than
   ethtool_get_status, redundant code will be needed to fetch the same
   data from the driver (like is_enabled).

2. Drivers currently have access to all information passed to ethtool.
   New variables will soon be added to ethtool status, such as PSE ID,
   power domain IDs, and budget evaluation strategies, which are meant
   to be managed solely by the core. Drivers should not have the ability
   to modify these variables.

To resolve these issues, ethtool_get_status has been split into multiple
callbacks, with each handling a specific piece of information required
by ethtool or the core.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/pse-pd/pd692x0.c
drivers/net/pse-pd/pse_core.c
drivers/net/pse-pd/pse_regulator.c
drivers/net/pse-pd/tps23881.c
include/linux/pse-pd/pse.h
net/ethtool/pse-pd.c