netifd: mbim.sh: drop deprecated uci_x_state usage
authorJames Christopher Adduono <jc@adduono.com>
Tue, 18 Jun 2019 21:41:00 +0000 (17:41 -0400)
committerJo-Philipp Wich <jo@mein.io>
Sun, 26 Jan 2025 13:07:08 +0000 (14:07 +0100)
Signed-off-by: James Christopher Adduono <jc@adduono.com>
package/network/utils/umbim/files/lib/netifd/proto/mbim.sh

index 01e8628d7460cdc7e2e0717963eeb28815f625e6..c5911a15e5fd80d66776fde1c4b8d0617f9f1eea 100755 (executable)
@@ -203,6 +203,9 @@ _proto_mbim_setup() {
        tid=$((tid + 1))
 
        proto_init_update "$ifname" 1
+       proto_add_data
+       json_add_int tid $tid
+       proto_close_data
        proto_send_update "$interface"
 
        [ -z "$dhcp" ] && dhcp="auto"
@@ -300,8 +303,6 @@ _proto_mbim_setup() {
                echo Setting MTU of $ifname to $mtu
                /sbin/ip link set dev $ifname mtu $mtu
        }
-
-       uci_set_state network $interface tid "$tid"
 }
 
 proto_mbim_setup() {
@@ -321,17 +322,13 @@ proto_mbim_setup() {
 proto_mbim_teardown() {
        local interface="$1"
 
-       local device
-       json_get_vars device
-       local tid=$(uci_get_state network $interface tid)
+       local device tid
+       json_get_vars device tid
 
        [ -n "$ctl_device" ] && device=$ctl_device
 
        echo "mbim[$$]" "Stopping network"
-       [ -n "$tid" ] && {
-               umbim $DBG -t $tid -d "$device" disconnect
-               uci_revert_state network $interface tid
-       }
+       [ -n "$tid" ] && umbim $DBG -t $tid -d "$device" disconnect
 
        proto_init_update "*" 0
        proto_send_update "$interface"