net: rkwifi: Modify driver loading way to reduce boot time
authorxiaoyao <xiaoyao@rock-chips.com>
Mon, 14 Mar 2016 10:04:08 +0000 (18:04 +0800)
committerGerrit Code Review <gerrit@rock-chips.com>
Wed, 16 Mar 2016 03:17:22 +0000 (11:17 +0800)
Change-Id: Ie569aeedb5544cb0131ab48818db6a5b0dde05bb
Signed-off-by: xiaoyao <xiaoyao@rock-chips.com>
drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd.h [changed mode: 0755->0644]
drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_linux.c [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 6e45921..0e743b4
@@ -171,7 +171,7 @@ enum dhd_op_flags {
 #define DHD_SCAN_PASSIVE_TIME          130 /* ms: Embedded default Passive setting from DHD */
 
 #ifndef POWERUP_MAX_RETRY
-#define POWERUP_MAX_RETRY      3 /* how many times we retry to power up the chip */
+#define POWERUP_MAX_RETRY      1 /* how many times we retry to power up the chip */
 #endif
 #ifndef POWERUP_WAIT_MS
 #define POWERUP_WAIT_MS                2000 /* ms: time out in waiting wifi to come up */
old mode 100755 (executable)
new mode 100644 (file)
index 29c5a0e..f7beba4
@@ -9939,7 +9939,7 @@ dhd_module_cleanup(void)
        printf("%s: Exit\n", __FUNCTION__);
 }
 
-static void __exit
+static void
 dhd_module_exit(void)
 {
        dhd_buzzz_detach();
@@ -9947,11 +9947,11 @@ dhd_module_exit(void)
        unregister_reboot_notifier(&dhd_reboot_notifier);
 }
 
-static int __init
+static int
 dhd_module_init(void)
 {
        int err;
-       int retry = POWERUP_MAX_RETRY;
+       int retry = 0;
 
        printf("%s: in\n", __FUNCTION__);
 
@@ -10010,7 +10010,33 @@ dhd_reboot_callback(struct notifier_block *this, unsigned long code, void *unuse
        return NOTIFY_DONE;
 }
 
+static int wifi_init_thread(void *data)
+{
+       dhd_module_init();
+
+       return 0;
+}
+
+int __init rockchip_wifi_init_module_rkwifi(void)
+{
+       struct task_struct *kthread = NULL;
+
+       kthread = kthread_run(wifi_init_thread, NULL, "wifi_init_thread");
+       if (IS_ERR(kthread))
+               pr_err("create wifi_init_thread failed.\n");
+
+       return 0;
+}
+
+void __exit rockchip_wifi_exit_module_rkwifi(void)
+{
+       dhd_module_exit();
+}
+
+late_initcall(rockchip_wifi_init_module_rkwifi);
+module_exit(rockchip_wifi_exit_module_rkwifi);
 
+#if 0
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
 #if defined(CONFIG_DEFERRED_INITCALLS)
 #if defined(CONFIG_MACH_UNIVERSAL7420) || defined(CONFIG_SOC_EXYNOS8890) || \
@@ -10032,6 +10058,7 @@ module_init(dhd_module_init);
 
 module_exit(dhd_module_exit);
 
+#endif
 /*
  * OS specific functions required to implement DHD driver in OS independent way
  */