- if (!strcmp(s->type, "interface"))
- config_parse_interface(s);
+ dev_name = uci_lookup_option_string(uci_ctx, s, "device");
+ if (!dev_name)
+ continue;
+
+ wdev = vlist_find(&wireless_devices, dev_name, wdev, node);
+ if (!wdev) {
+ DPRINTF("device %s not found!\n", dev_name);
+ continue;
+ }
+
+ config_parse_wireless_interface(wdev, s);
+ }
+
+ vlist_for_each_element(&wireless_devices, wdev, node)
+ vlist_flush(&wdev->interfaces);
+}
+
+int
+config_init_all(void)
+{
+ int ret = 0;
+ char *err;
+
+ uci_network = config_init_package("network");
+ if (!uci_network) {
+ uci_get_errorstr(uci_ctx, &err, NULL);
+ netifd_log_message(L_CRIT, "Failed to load network config (%s)\n", err);
+ free(err);
+ return -1;