uqmi: set RAT preference before attach
authorDavid Bauer <mail@david-bauer.net>
Mon, 9 Oct 2023 14:29:59 +0000 (16:29 +0200)
committerDavid Bauer <mail@david-bauer.net>
Tue, 31 Oct 2023 20:12:15 +0000 (21:12 +0100)
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 <mail@david-bauer.net>
package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh

index 8c335b57758bcc311b0c67cfb74ae9892394b482..96555f537cdade4390ffb3de70deea3caacc357a 100755 (executable)
@@ -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"