Files
wlan-ap/feeds/ucentral/poe/files/poe.init
jackcybertan 43a8dd1303 poe: add userland helpers scripts/tools
Support user to control PSE on/off (chip: tps23861) via ucentral config file.
Use uci-default to write poe's uci default file.

Fixes: WIFI-14724
Signed-off-by: jackcybertan <jack.tsai@cybertan.com.tw>
2025-06-27 12:38:19 +02:00

34 lines
577 B
Bash

#!/bin/sh /etc/rc.common
START=10
tps23861_poe_ctrl () {
local section="$1"
local num mode
config_get num "$section" port_num
config_get mode "$section" admin_mode
if [ "$mode" == "1" ]; then
output=$(tps23861-poe-ctrl -p "${num}" -P on)
echo "<6>${output}" > "/dev/kmsg"
else
output=$(tps23861-poe-ctrl -p "${num}" -P off)
echo "<6>${output}" > "/dev/kmsg"
fi
}
start(){
. /lib/functions.sh
board=$(board_name)
case $board in
sonicfi,rap630w-311g|\
cybertan,eww631-b1)
config_load poe
config_foreach tps23861_poe_ctrl port
;;
*)
;;
esac
}