From: David Bauer Date: Mon, 9 Oct 2023 14:29:59 +0000 (+0200) Subject: uqmi: set RAT preference before attach X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=c1fcce111290875ca463d785550d53e2ff6014fd;p=openwrt%2Fstaging%2F981213.git uqmi: set RAT preference before attach Set the RAT preference before attaching. This handles cases better, where a network might be available but not with the preferred RAT. If RAT is changed to a non-available RAT after attach, QMI does not fail with missing registration but with failing to establish a PDP session. Signed-off-by: David Bauer --- diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh index 8c335b5775..96555f537c 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -252,6 +252,13 @@ proto_qmi_setup() { uqmi -s -d "$device" --network-register > /dev/null 2>&1 + [ -n "$modes" ] && { + uqmi -s -d "$device" --set-network-modes "$modes" > /dev/null 2>&1 + sleep 3 + # Scan network to not rely on registration-timeout after RAT change + uqmi -s -d "$device" --network-scan > /dev/null 2>&1 + } + echo "Waiting for network registration" sleep 5 local registration_timeout=0 @@ -281,7 +288,6 @@ proto_qmi_setup() { return 1 done - [ -n "$modes" ] && uqmi -s -d "$device" --set-network-modes "$modes" > /dev/null 2>&1 echo "Starting network $interface"