diff --git a/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata b/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata index b0241239e..7004f786d 100755 --- a/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata +++ b/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata @@ -190,6 +190,7 @@ ath11k-macs) ;; yuncore,ax840|\ edgecore,eap102|\ + edgecore,eap104|\ edgecore,eap106|\ indio,um-310ax-v1|\ indio,um-510axp-v1|\ diff --git a/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/net/macs b/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/net/macs index 10f38108c..9e2e6ef65 100644 --- a/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/net/macs +++ b/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/net/macs @@ -1,3 +1,3 @@ #!/bin/sh -mac=$(cat /etc/board.json | jsonfilter -e '@["network-device"]["'$DEVICENAME'"]'.macaddr) +mac=$(cat /etc/board.json | jsonfilter -e '@["network_device"]["'$DEVICENAME'"]'.macaddr) [ -n "$mac" ] && ip link set $DEVICENAME address $mac diff --git a/feeds/mcu/mcu/Makefile b/feeds/mcu/mcu/Makefile index fd3286816..6c4ac8fd1 100644 --- a/feeds/mcu/mcu/Makefile +++ b/feeds/mcu/mcu/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mcu -PKG_VERSION:=2023-03-12 +PKG_VERSION:=2023-03-22 PKG_RELEASE=1 PKG_LICENSE:=GPL-2.0 diff --git a/feeds/mcu/mcu/files/mcu.hotplug b/feeds/mcu/mcu/files/mcu.hotplug index 715eaa581..d4189baf6 100644 --- a/feeds/mcu/mcu/files/mcu.hotplug +++ b/feeds/mcu/mcu/files/mcu.hotplug @@ -47,13 +47,19 @@ mcu_hotplug_setup() { [ $? -ne 0 ] && return 1 mcu_fw_check_and_update "$uart" - [ $? -ne 0 ] && return 1 + rc="$?" - fw_type="$(uci -q get "mcu.${SECT}.firmware" | awk -F '__' '{print $2}')" - [ -n "$fw_type" ] || return 0 + [ "$rc" = "1" ] && return 1 - [ -x "${MCU_HS_DIR}/${fw_type}.sh" ] && \ - "${MCU_HS_DIR}/${fw_type}.sh" "$SECT" + [ "$rc" = "0" ] && { + fw_type="$(uci -q get "mcu.${SECT}.firmware" | awk -F '__' '{print $2}')" + [ -n "$fw_type" ] || return 0 + + [ -x "${MCU_HS_DIR}/${fw_type}.sh" ] && \ + "${MCU_HS_DIR}/${fw_type}.sh" "$SECT" + } + + return 0 } # We are looking for ttyACM with specific product name and USB VID:PID diff --git a/feeds/mcu/mcu/files/mcu.init b/feeds/mcu/mcu/files/mcu.init index 67028cb39..2d1b91394 100644 --- a/feeds/mcu/mcu/files/mcu.init +++ b/feeds/mcu/mcu/files/mcu.init @@ -24,7 +24,16 @@ mcu_setup_uart() { [ $? -ne 0 ] && return 1 mcu_fw_check_and_update "$uart" "$baud" "$flow" - [ $? -ne 0 ] && return 1 + rc="$?" + + [ "$rc" = "1" ] && return 1 + + [ "$rc" = "2" ] && { + sleep 1 + + mcu_req "boot" "$uart" "$baud" "$flow" + [ $? -ne 0 ] && return 1 + } fw_type="$(uci -q get "mcu.${SECT}.firmware" | awk -F '__' '{print $2}')" [ -n "$fw_type" ] || return 0 @@ -141,18 +150,20 @@ mcu_setup_usb() { } mcu_fw_check_and_update "$uart" - [ $? -ne 0 ] && { + rc="$?" + + [ "$rc" = "1" ] && { mcu_enable_pin_set "$gpio_path" "$gpio_off" flock -u 9 return 1 } - fw_type="$(uci -q get "mcu.${SECT}.firmware" | awk -F '__' '{print $2}')" - [ -n "$fw_type" ] || return 0 - - [ -x "${MCU_HS_DIR}/${fw_type}.sh" ] && \ - "${MCU_HS_DIR}/${fw_type}.sh" "$SECT" + [ "$rc" = "0" ] && { + fw_type="$(uci -q get "mcu.${SECT}.firmware" | awk -F '__' '{print $2}')" + [ -n "$fw_type" -a -x "${MCU_HS_DIR}/${fw_type}.sh" ] && \ + "${MCU_HS_DIR}/${fw_type}.sh" "$SECT" + } flock -u 9 } diff --git a/feeds/mcu/mcu/files/mcu.sh b/feeds/mcu/mcu/files/mcu.sh index 011770599..ac91de398 100644 --- a/feeds/mcu/mcu/files/mcu.sh +++ b/feeds/mcu/mcu/files/mcu.sh @@ -289,6 +289,10 @@ mcu_sn_check_and_update() { return 0 } +# Returns: +# 0 if MCU was requested to boot firmware +# 1 on error +# 2 if MCU was requested to reset mcu_fw_check_and_update() { local uart="$1" local baud="$2" @@ -385,9 +389,11 @@ mcu_fw_check_and_update() { mcu_req "boot" "$uart" "$baud" "$flow" [ $? -ne 0 ] && return 1 + + return 0 } - return 0 + return 1 } # Do we have target firmware installed in the first slot? @@ -401,6 +407,8 @@ mcu_fw_check_and_update() { # Changing active slots requires MCU reset at the moment mcu_req "reset" "$uart" "$baud" "$flow" [ $? -ne 0 ] && return 1 + + return 2 else mcu_req "boot" "$uart" "$baud" "$flow" [ $? -ne 0 ] && return 1 @@ -411,15 +419,15 @@ mcu_fw_check_and_update() { mcu_logi "no matching firmware found in slot '0'" - # Upload and boot firmware on single-slot device + # Upload firmware and reset on single-slot device [ "$fw_slots" = "1" ] && { mcu_fw_upload "$board" "0" "$firmware" "$uart" "$baud" "$flow" [ $? -ne 0 ] && return 1 - mcu_req "boot" "$uart" "$baud" "$flow" + mcu_req "reset" "$uart" "$baud" "$flow" [ $? -ne 0 ] && return 1 - return 0 + return 2 } # Do we have target firmware installed in the second slot? @@ -433,6 +441,8 @@ mcu_fw_check_and_update() { # Changing active slots requires MCU reset at the moment mcu_req "reset" "$uart" "$baud" "$flow" [ $? -ne 0 ] && return 1 + + return 2 else mcu_req "boot" "$uart" "$baud" "$flow" [ $? -ne 0 ] && return 1 @@ -461,7 +471,7 @@ mcu_fw_check_and_update() { mcu_req "reset" "$uart" "$baud" "$flow" [ $? -ne 0 ] && return 1 - return 0 + return 2 } mcu_add_uci_config() { diff --git a/feeds/ucentral/ratelimit/files/etc/init.d/ratelimit b/feeds/ucentral/ratelimit/files/etc/init.d/ratelimit index fa313f232..1e56cc1e9 100755 --- a/feeds/ucentral/ratelimit/files/etc/init.d/ratelimit +++ b/feeds/ucentral/ratelimit/files/etc/init.d/ratelimit @@ -10,7 +10,7 @@ add_rate() { config_get ssid "$cfg" ssid config_get ingress "$cfg" ingress config_get egress "$cfg" egress - ubus call ratelimit defaults_set '{"name": "'$ssid'", "rate_ingress": "'$ingress'mbit", "rate_egress": "'$egress'mbit" }' + ubus call ratelimit defaults_set "{\"name\": \"$ssid\", \"rate_ingress\": \""$ingress"mbit\", \"rate_egress\": \""$egress"mbit\" }" } reload_service() {