net: pse-pd: Introduce attached_phydev to pse control
authorKory Maincent (Dent Project) <kory.maincent@bootlin.com>
Tue, 17 Jun 2025 12:12:00 +0000 (14:12 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 19 Jun 2025 02:00:15 +0000 (19:00 -0700)
commitfa2f0454174c2f33005f5a6e6f70c7160a15b2a1
tree78e40395fd00b828134f1b1bca0c73f3aca1d3dd
parenta5b4e4f4d8394f2f6625732bd8f7cd8b425bdc21
net: pse-pd: Introduce attached_phydev to pse control

In preparation for reporting PSE events via ethtool notifications,
introduce an attached_phydev field in the pse_control structure.
This field stores the phy_device associated with the PSE PI,
ensuring that notifications are sent to the correct network
interface.

The attached_phydev pointer is directly tied to the PHY lifecycle. It
is set when the PHY is registered and cleared when the PHY is removed.
There is no need to use a refcount, as doing so could interfere with
the PHY removal process.

Signed-off-by: Kory Maincent (Dent Project) <kory.maincent@bootlin.com>
Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://patch.msgid.link/20250617-feature_poe_port_prio-v14-1-78a1a645e2ee@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/mdio/fwnode_mdio.c
drivers/net/pse-pd/pse_core.c
include/linux/pse-pd/pse.h