wifi: fix applying mesh parameters when wpa_supplicant is in use
[openwrt/staging/stintel.git] / package / network / services / hostapd / files / wdev.uc
index cf438f7715fc678c060a5646ffd401040106ebe0..800bb32d24ffcb646bcf1e59d708bfeac54752c1 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env ucode
 'use strict';
-import { vlist_new, is_equal, wdev_create, wdev_remove, phy_open } from "/usr/share/hostap/common.uc";
+import { vlist_new, is_equal, wdev_create, wdev_set_mesh_params, wdev_remove, phy_open } from "/usr/share/hostap/common.uc";
 import { readfile, writefile, basename, readlink, glob } from "fs";
 let libubus = require("ubus");
 
@@ -9,17 +9,6 @@ let phy = shift(ARGV);
 let command = shift(ARGV);
 let phydev;
 
-const mesh_params = [
-       "mesh_retry_timeout", "mesh_confirm_timeout", "mesh_holding_timeout", "mesh_max_peer_links",
-       "mesh_max_retries", "mesh_ttl", "mesh_element_ttl", "mesh_hwmp_max_preq_retries",
-       "mesh_path_refresh_time", "mesh_min_discovery_timeout", "mesh_hwmp_active_path_timeout",
-       "mesh_hwmp_preq_min_interval", "mesh_hwmp_net_diameter_traversal_time", "mesh_hwmp_rootmode",
-       "mesh_hwmp_rann_interval", "mesh_gate_announcements", "mesh_sync_offset_max_neighor",
-       "mesh_rssi_threshold", "mesh_hwmp_active_path_to_root_timeout", "mesh_hwmp_root_interval",
-       "mesh_hwmp_confirmation_interval", "mesh_awake_window", "mesh_plink_timeout",
-       "mesh_auto_open_plinks", "mesh_fwding", "mesh_power_mode"
-];
-
 function iface_stop(wdev)
 {
        if (keep_devices[wdev.ifname])
@@ -60,19 +49,8 @@ function iface_start(wdev)
                                push(cmd, key, wdev[key]);
                system(cmd);
 
-               cmd = ["iw", "dev", ifname, "set", "mesh_param" ];
-               let len = length(cmd);
-
-               for (let param in mesh_params)
-                       if (wdev[param])
-                               push(cmd, param, wdev[param]);
-
-               if (len == length(cmd))
-                       return;
-
-               system(cmd);
+               wdev_set_mesh_params(ifname, wdev);
        }
-
 }
 
 function iface_cb(new_if, old_if)