wireless: defer init until after command line option processing
authorFelix Fietkau <nbd@openwrt.org>
Fri, 7 Mar 2014 17:49:43 +0000 (18:49 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Fri, 7 Mar 2014 17:49:43 +0000 (18:49 +0100)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
main.c
wireless.c
wireless.h

diff --git a/main.c b/main.c
index 43ec24fde9f48f7394ec218f0abde82688e5eb9a..fb6deed14c729a06898cac3cbe75672748fef439 100644 (file)
--- a/main.c
+++ b/main.c
@@ -24,6 +24,7 @@
 #include "config.h"
 #include "system.h"
 #include "interface.h"
+#include "wireless.h"
 
 unsigned int debug_mask = 0;
 const char *main_path = DEFAULT_MAIN_PATH;
@@ -325,6 +326,8 @@ int main(int argc, char **argv)
                return 1;
        }
 
+       wireless_init();
+
        if (system_init()) {
                fprintf(stderr, "Failed to initialize system control\n");
                return 1;
index 247d323c015164b68ea14fa8aa021b61a4a68614..ffb9e38c6666885fa1c558846c7f51d3f5138a1c 100644 (file)
@@ -491,8 +491,7 @@ wireless_add_handler(const char *script, const char *name, json_object *obj)
        D(WIRELESS, "Add handler for script %s: %s\n", script, name);
 }
 
-static void __init
-wireless_init_list(void)
+void wireless_init(void)
 {
        vlist_init(&wireless_devices, avl_strcmp, wdev_update);
        wireless_devices.keep_old = true;
index cdd7187fae2af29830e4ddda8c84fa0c80274852..f2ea7c260219ee55498fa6f40b7d41c73bfc8ce9 100644 (file)
@@ -97,5 +97,6 @@ int wireless_device_notify(struct wireless_device *wdev, struct blob_attr *data,
                           struct ubus_request_data *req);
 
 void wireless_start_pending(void);
+void wireless_init(void);
 
 #endif