ucv_object_add(ucv_prototype_get(global), "interfaces", ifs);
ucv_object_add(ucv_prototype_get(global), "bss", if_bss);
-
- ucv_gc(vm);
}
static uc_value_t *
os_free(hapd);
hostapd_ucode_update_interfaces();
- ucv_gc(vm);
return NULL;
}
ret = ucv_int64_get(cur);
ucv_put(val);
- ucv_gc(vm);
return ret;
}
if (wpa_ucode_run(HOSTAPD_UC_PATH "hostapd.uc"))
goto free_vm;
- ucv_gc(vm);
return 0;
uc_value_push(ucv_get(val));
ucv_put(wpa_ucode_call(3));
ucv_put(val);
- ucv_gc(vm);
}
void hostapd_ucode_free_bss(struct hostapd_data *hapd)
ucv_put(wpa_ucode_call(2));
ucv_put(val);
- ucv_gc(vm);
}
#ifdef CONFIG_APUP
uc_value_push(ucv_string_new(ifname)); // APuP peer ifname
ucv_put(wpa_ucode_call(2));
ucv_put(val);
- ucv_gc(vm);
}
#endif // def CONFIG_APUP
static uc_value_t *registry;
static uc_vm_t vm;
-static struct uloop_timeout gc_timer;
static struct udebug ud;
static struct udebug_buf ud_log, ud_nl[3];
static const struct udebug_buf_meta meta_log = {
char *udebug_service;
struct udebug_ubus ud_ubus;
-static void uc_gc_timer(struct uloop_timeout *timeout)
-{
- ucv_gc(&vm);
-}
-
uc_value_t *uc_wpa_printf(uc_vm_t *vm, size_t nargs)
{
uc_value_t *level = uc_fn_arg(0);
uc_stdlib_load(uc_vm_scope_get(&vm));
eloop_add_uloop();
- gc_timer.cb = uc_gc_timer;
return &vm;
}
if (uc_vm_call(&vm, true, nargs) != EXCEPTION_NONE)
return NULL;
- if (!gc_timer.pending)
- uloop_timeout_set(&gc_timer, 10);
-
return uc_vm_stack_pop(&vm);
}
ucv_object_add(ifs, wpa_s->ifname, wpas_ucode_iface_get_uval(wpa_s));
ucv_object_add(ucv_prototype_get(global), "interfaces", ifs);
- ucv_gc(vm);
}
void wpas_ucode_add_bss(struct wpa_supplicant *wpa_s)
uc_value_push(ucv_string_new(wpa_s->ifname));
uc_value_push(wpas_ucode_iface_get_uval(wpa_s));
ucv_put(wpa_ucode_call(2));
- ucv_gc(vm);
}
void wpas_ucode_free_bss(struct wpa_supplicant *wpa_s)
uc_value_push(ucv_get(val));
ucv_put(wpa_ucode_call(2));
ucv_put(val);
- ucv_gc(vm);
}
void wpas_ucode_update_state(struct wpa_supplicant *wpa_s)
uc_value_push(ucv_get(val));
uc_value_push(ucv_string_new(state));
ucv_put(wpa_ucode_call(3));
- ucv_gc(vm);
}
void wpas_ucode_event(struct wpa_supplicant *wpa_s, int event, union wpa_event_data *data)
}
ucv_put(wpa_ucode_call(4));
- ucv_gc(vm);
}
static const char *obj_stringval(uc_value_t *obj, const char *name)
if (wpa_ucode_run(HOSTAPD_UC_PATH "wpa_supplicant.uc"))
goto free_vm;
- ucv_gc(vm);
return 0;
free_vm: