From 2f9c9cd46e6caee2df83d6141bfdd573f88bfd67 Mon Sep 17 00:00:00 2001 From: xiaoyao Date: Mon, 14 Mar 2016 18:04:08 +0800 Subject: [PATCH] net: rkwifi: Modify driver loading way to reduce boot time Change-Id: Ie569aeedb5544cb0131ab48818db6a5b0dde05bb Signed-off-by: xiaoyao --- .../rockchip_wlan/rkwifi/bcmdhd/dhd.h | 2 +- .../rockchip_wlan/rkwifi/bcmdhd/dhd_linux.c | 33 +++++++++++++++++-- 2 files changed, 31 insertions(+), 4 deletions(-) mode change 100755 => 100644 drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd.h mode change 100755 => 100644 drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_linux.c diff --git a/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd.h b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd.h old mode 100755 new mode 100644 index 6e45921c5b92..0e743b462ed1 --- a/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd.h +++ b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd.h @@ -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 */ diff --git a/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_linux.c b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_linux.c old mode 100755 new mode 100644 index 29c5a0e831db..f7beba4eeaba --- a/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_linux.c +++ b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_linux.c @@ -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 */ -- 2.34.1