mirror of
https://github.com/openwrt/openwrt.git
synced 2026-04-25 11:08:49 +04:00
Backport the PSE-PD (Power Sourcing Equipment - Powered Device) framework updates from Linux 6.13 through 6.19. This brings modern PoE (Power over Ethernet) controller support to OpenWrt, enabling userspace control of PSE hardware via ethtool. Key features: - Enhanced ethtool integration for PSE status and configuration - Power domain support with budget evaluation strategies - PSE event reporting via netlink - Port priority management for power budget allocation - New Si3474 PSE controller driver Backported commits: v6.13 core framework and TPS23881 improvements: - 6e56a6d47a7f net: pse-pd: Add power limit check - 0b567519d115 net: pse-pd: tps23881: Simplify function returns - 4c2bab507eb7 net: pse-pd: tps23881: Use helpers to calculate bit offset - f3cb3c7bea0c net: pse-pd: tps23881: Add missing configuration register - 3e9dbfec4998 net: pse-pd: Split ethtool_get_status into multiple callbacks - 4640a1f0d8f2 net: pse-pd: Remove is_enabled callback from drivers - 7f076ce3f173 net: pse-pd: tps23881: Add power limit and measurement features - 10276f3e1c7e net: pse-pd: Fix missing PI of_node description - 5385f1e1923c net: pse-pd: Clean ethtool header of PSE structures v6.17 power domains and event support: - fa2f0454174c net: pse-pd: Introduce attached_phydev to pse control - fc0e6db30941 net: pse-pd: Add support for reporting events - f5e7aecaa4ef net: pse-pd: tps23881: Add support for PSE events - 50f8b341d268 net: pse-pd: Add support for PSE power domains - 1176978ed851 net: ethtool: Add support for power domains index - c394e757dedd net: pse-pd: Add helper to report hw enable status - ffef61d6d273 net: pse-pd: Add support for budget evaluation strategies - 359754013e6a net: pse-pd: pd692x0: Add PSE PI priority feature - 24a4e3a05dd0 net: pse-pd: pd692x0: Add controller and manager power - 56cfc97635e9 net: pse-pd: tps23881: Add static port priority feature - d12b3dc10609 net: pse-pd: pd692x0: reduce stack usage v6.18 Si3474 driver and fixes: - 1c67f9c54cdc net: pse-pd: pd692x0: Fix power budget leak - 7ef353879f71 net: pse-pd: pd692x0: Skip power budget when undefined - a2317231df4b net: pse-pd: Add Si3474 PSE controller driver v6.19 maintenance and TPS23881B support: - 2c95a756e0cf net: pse-pd: tps23881: Fix current measurement scaling - f197902cd21a net: pse-pd: pd692x0: Replace __free macro - 6fa1f8b64a47 net: pse-pd: pd692x0: Separate configuration parsing - 8f3d044b34fe net: pse-pd: pd692x0: Preserve PSE configuration - 4d07797faaa1 net: pse-pd: tps23881: Add support for TPS23881B Signed-off-by: Carlo Szelinsky <github@szelinsky.de> Link: https://github.com/openwrt/openwrt/pull/21810 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
93 lines
3.1 KiB
Diff
93 lines
3.1 KiB
Diff
From 5385f1e1923ca8131eb143567d509b101a344e06 Mon Sep 17 00:00:00 2001
|
|
From: Kory Maincent <kory.maincent@bootlin.com>
|
|
Date: Fri, 10 Jan 2025 10:40:31 +0100
|
|
Subject: [PATCH] net: pse-pd: Clean ethtool header of PSE structures
|
|
|
|
Remove PSE-specific structures from the ethtool header to improve code
|
|
modularity, maintain independent headers, and reduce incremental build
|
|
time.
|
|
|
|
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
|
|
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|
Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
|
|
---
|
|
drivers/net/pse-pd/pse_core.c | 1 +
|
|
include/linux/ethtool.h | 20 --------------------
|
|
include/linux/pse-pd/pse.h | 22 +++++++++++++++++++++-
|
|
3 files changed, 22 insertions(+), 21 deletions(-)
|
|
--- a/drivers/net/pse-pd/pse_core.c
|
|
+++ b/drivers/net/pse-pd/pse_core.c
|
|
@@ -6,6 +6,7 @@
|
|
//
|
|
|
|
#include <linux/device.h>
|
|
+#include <linux/ethtool.h>
|
|
#include <linux/of.h>
|
|
#include <linux/pse-pd/pse.h>
|
|
#include <linux/regulator/driver.h>
|
|
--- a/include/linux/ethtool.h
|
|
+++ b/include/linux/ethtool.h
|
|
@@ -1322,24 +1322,4 @@ struct ethtool_forced_speed_map {
|
|
|
|
void
|
|
ethtool_forced_speed_maps_init(struct ethtool_forced_speed_map *maps, u32 size);
|
|
-
|
|
-/* C33 PSE extended state and substate. */
|
|
-struct ethtool_c33_pse_ext_state_info {
|
|
- enum ethtool_c33_pse_ext_state c33_pse_ext_state;
|
|
- union {
|
|
- enum ethtool_c33_pse_ext_substate_error_condition error_condition;
|
|
- enum ethtool_c33_pse_ext_substate_mr_pse_enable mr_pse_enable;
|
|
- enum ethtool_c33_pse_ext_substate_option_detect_ted option_detect_ted;
|
|
- enum ethtool_c33_pse_ext_substate_option_vport_lim option_vport_lim;
|
|
- enum ethtool_c33_pse_ext_substate_ovld_detected ovld_detected;
|
|
- enum ethtool_c33_pse_ext_substate_power_not_available power_not_available;
|
|
- enum ethtool_c33_pse_ext_substate_short_detected short_detected;
|
|
- u32 __c33_pse_ext_substate;
|
|
- };
|
|
-};
|
|
-
|
|
-struct ethtool_c33_pse_pw_limit_range {
|
|
- u32 min;
|
|
- u32 max;
|
|
-};
|
|
#endif /* _LINUX_ETHTOOL_H */
|
|
--- a/include/linux/pse-pd/pse.h
|
|
+++ b/include/linux/pse-pd/pse.h
|
|
@@ -5,7 +5,6 @@
|
|
#ifndef _LINUX_PSE_CONTROLLER_H
|
|
#define _LINUX_PSE_CONTROLLER_H
|
|
|
|
-#include <linux/ethtool.h>
|
|
#include <linux/list.h>
|
|
#include <uapi/linux/ethtool.h>
|
|
|
|
@@ -16,6 +15,27 @@
|
|
|
|
struct phy_device;
|
|
struct pse_controller_dev;
|
|
+struct netlink_ext_ack;
|
|
+
|
|
+/* C33 PSE extended state and substate. */
|
|
+struct ethtool_c33_pse_ext_state_info {
|
|
+ enum ethtool_c33_pse_ext_state c33_pse_ext_state;
|
|
+ union {
|
|
+ enum ethtool_c33_pse_ext_substate_error_condition error_condition;
|
|
+ enum ethtool_c33_pse_ext_substate_mr_pse_enable mr_pse_enable;
|
|
+ enum ethtool_c33_pse_ext_substate_option_detect_ted option_detect_ted;
|
|
+ enum ethtool_c33_pse_ext_substate_option_vport_lim option_vport_lim;
|
|
+ enum ethtool_c33_pse_ext_substate_ovld_detected ovld_detected;
|
|
+ enum ethtool_c33_pse_ext_substate_power_not_available power_not_available;
|
|
+ enum ethtool_c33_pse_ext_substate_short_detected short_detected;
|
|
+ u32 __c33_pse_ext_substate;
|
|
+ };
|
|
+};
|
|
+
|
|
+struct ethtool_c33_pse_pw_limit_range {
|
|
+ u32 min;
|
|
+ u32 max;
|
|
+};
|
|
|
|
/**
|
|
* struct pse_control_config - PSE control/channel configuration.
|