summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-03-07 18:49:43 +0100
committerFelix Fietkau <nbd@openwrt.org>2014-03-07 18:49:43 +0100
commita565ae60a2fd6aea1fb64a8a3728d101ab2357c3 (patch)
tree6e2d13dbc9bde4b4c0336bd7da5fe0840f419344
parent4d1a597f65bbb49aa843112812d5ca929478c706 (diff)
wireless: defer init until after command line option processing
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rw-r--r--main.c3
-rw-r--r--wireless.c3
-rw-r--r--wireless.h1
3 files changed, 5 insertions, 2 deletions
diff --git a/main.c b/main.c
index 43ec24f..fb6deed 100644
--- 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;
diff --git a/wireless.c b/wireless.c
index 247d323..ffb9e38 100644
--- a/wireless.c
+++ b/wireless.c
@@ -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;
diff --git a/wireless.h b/wireless.h
index cdd7187..f2ea7c2 100644
--- a/wireless.h
+++ b/wireless.h
@@ -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