net: pse-pd: Add support for reporting events

Add support for devm_pse_irq_helper() to register PSE interrupts and report
events such as over-current or over-temperature conditions. This follows a
similar approach to the regulator API but also sends notifications using a
dedicated PSE ethtool netlink socket.

Signed-off-by: Kory Maincent (Dent Project) <kory.maincent@bootlin.com>
Link: https://patch.msgid.link/20250617-feature_poe_port_prio-v14-2-78a1a645e2ee@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Kory Maincent (Dent Project)
2025-06-18 19:00:15 -07:00
committed by Jakub Kicinski
parent fa2f045417
commit fc0e6db309
7 changed files with 317 additions and 0 deletions
@@ -49,6 +49,16 @@ enum hwtstamp_source {
HWTSTAMP_SOURCE_PHYLIB,
};
/**
* enum ethtool_pse_event - PSE event list for the PSE controller
* @ETHTOOL_PSE_EVENT_OVER_CURRENT: PSE output current is too high
* @ETHTOOL_PSE_EVENT_OVER_TEMP: PSE in over temperature state
*/
enum ethtool_pse_event {
ETHTOOL_PSE_EVENT_OVER_CURRENT = 1,
ETHTOOL_PSE_EVENT_OVER_TEMP = 2,
};
enum {
ETHTOOL_A_HEADER_UNSPEC,
ETHTOOL_A_HEADER_DEV_INDEX,
@@ -718,6 +728,14 @@ enum {
ETHTOOL_A_TSCONFIG_MAX = (__ETHTOOL_A_TSCONFIG_CNT - 1)
};
enum {
ETHTOOL_A_PSE_NTF_HEADER = 1,
ETHTOOL_A_PSE_NTF_EVENTS,
__ETHTOOL_A_PSE_NTF_CNT,
ETHTOOL_A_PSE_NTF_MAX = (__ETHTOOL_A_PSE_NTF_CNT - 1)
};
enum {
ETHTOOL_MSG_USER_NONE = 0,
ETHTOOL_MSG_STRSET_GET = 1,
@@ -822,6 +840,7 @@ enum {
ETHTOOL_MSG_PHY_NTF,
ETHTOOL_MSG_TSCONFIG_GET_REPLY,
ETHTOOL_MSG_TSCONFIG_SET_REPLY,
ETHTOOL_MSG_PSE_NTF,
__ETHTOOL_MSG_KERNEL_CNT,
ETHTOOL_MSG_KERNEL_MAX = (__ETHTOOL_MSG_KERNEL_CNT - 1)