From c1fcce111290875ca463d785550d53e2ff6014fd Mon Sep 17 00:00:00 2001 From: David Bauer Date: Mon, 9 Oct 2023 16:29:59 +0200 Subject: [PATCH] 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 --- package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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" -- 2.30.2