hostapd: use new udebug ubus api to make debug rings configurable
[openwrt/staging/hauke.git] / package / network / services / hostapd / files / wpa_supplicant.uc
index aac144b3399b673dc3fff82afdc2b422a83871b6..1709bb019e310785ac4083feef7fbc23cb71235d 100644 (file)
@@ -244,32 +244,9 @@ let main_obj = {
        },
 };
 
-function handle_debug_config(cfg) {
-       if (!cfg)
-               return;
-
-       let data = cfg.service;
-       if (!data)
-               return;
-
-       data = data.wpa_supplicant;
-       if (!data)
-               return;
-
-       wpas.udebug_set(!!+data.enabled);
-}
-
 wpas.data.ubus = ubus;
 wpas.data.obj = ubus.publish("wpa_supplicant", main_obj);
-wpas.data.debug_sub = ubus.subscriber((req) => {
-       if (req.type != "config")
-               return;
-
-       handle_debug_config(req.data);
-});
-
-wpas.data.debug_sub.subscribe("udebug");
-handle_debug_config(ubus.call("udebug", "get_config", {}));
+wpas.udebug_set("wpa_supplicant", wpas.data.ubus);
 
 function iface_event(type, name, data) {
        let ubus = wpas.data.ubus;