ponmngr: Refactorize PtP-mode detection.

This commit is contained in:
Markus Gothe 2025-02-07 16:39:00 +01:00
parent 980779a583
commit 40251b2371

View file

@ -3,7 +3,7 @@
. /lib/functions.sh
. /usr/share/libubox/jshn.sh
apply_extra_xpon_config() {
check_ptp_mode() {
local wanport enabled updated
if [ -f /etc/board.json ]; then
@ -40,6 +40,10 @@ apply_extra_xpon_config() {
fi
}
apply_extra_xpon_config() {
check_ptp_mode
}
set_serial_number() {
local vendor_id="$1"
local vssn="$2"
@ -84,10 +88,11 @@ apply_xpon_uci_config() {
configure_loid_authentication
configure_equipment_id
configure_onu_version
apply_extra_xpon_config
}
init_xpon() {
check_ptp_mode
# don't start pon daemons if xpon module is not loaded
[ -d /sys/module/xpon -o -d /sys/module/xpon_10g ] || return