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>
Wed, 21 Feb 2024 21:31:36 +0000 (22:31 +0100)
Signed-off-by: James Christopher Adduono <jc@adduono.com>
package/network/utils/umbim/files/lib/netifd/proto/mbim.sh

index 50913e7fa0461e2732583dd1499dffaba6de5964..17b8a2b95bfa26cc7f9d90f34fb05853246bfa6a 100755 (executable)
@@ -197,6 +197,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"
@@ -292,8 +295,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() {
@@ -313,17 +314,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"