[PATCH] realtek-poe: add support for PoE on Realtek switches

Bjørn Mork bjorn at mork.no
Tue May 11 08:56:28 PDT 2021


John Crispin <john at phrozen.org> writes:

> This patch adds a C rewrite of the LUA tool previously posted. With this new
> daemon we map the DSA port names to the PSE port id. Support for several now
> features was added, such as setting the priority and at/af mode. In the next
> iteration addition port/mcu states will be exposed, aswell as adding support
> for 4 wire mode and fault handling.
>
> A Sample config looks like this:
>
> config global
> 	option budget	'65'
>
> config port
> 	option enable	'1'
> 	option id	'1'
> 	option name	'lan1'
> 	option poe_plus	'1'
> 	option priority	'2'
>
> ubus call poe info
> {
> 	"firmware": "v48.2",
> 	"mcu": "Nuvoton M05xx LAN Microcontroller",
> 	"budget": 65.000000,
> 	"consumption": 2.400000,
> 	"ports": {
> 		"lan1": {
> 			"priority": 2,
> 			"mode": "PoE",
> 			"status": "Delivering power",
> 			"consumption": 2.400000
> 		}
> 	}
> }


Tested-by: Bjørn Mork <bjorn at mork.no>

Running on a ZyXEL GS1900-10HP:

root at gs1900-10hp:~# ubus call poe info
{
        "firmware": "v22.4",
        "mcu": "ST Micro ST32F100 Microcontroller",
        "budget": 77.000000,
        "consumption": 7.700000,
        "ports": {
                "lan1": {
                        "priority": 0,
                        "mode": "PoE+",
                        "status": "Searching"
                },
                "lan2": {
                        "priority": 0,
                        "mode": "PoE+",
                        "status": "Searching"
                },
                "lan3": {
                        "priority": 0,
                        "mode": "PoE+",
                        "status": "Searching"
                },
                "lan4": {
                        "priority": 0,
                        "mode": "PoE+",
                        "status": "Searching"
                },
                "lan5": {
                        "priority": 0,
                        "mode": "PoE+",
                        "status": "Searching"
                },
                "lan6": {
                        "priority": 0,
                        "mode": "PoE+",
                        "status": "Searching"
                },
                "lan7": {
                        "priority": 0,
                        "mode": "PoE+",
                        "status": "Delivering power",
                        "consumption": 3.900000
                },
                "lan8": {
                        "priority": 0,
                        "mode": "PoE+",
                        "status": "Delivering power",
                        "consumption": 3.800000
                }
        }
}



Really nice stuff!





More information about the openwrt-devel mailing list