mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-29 09:32:34 +00:00
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>
34 lines
577 B
Bash
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
|
|
}
|