# bool "rda 5990p"
# ---help---
# rda5990P fm bt wifi
+
+config WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ bool "Wifi load driver when kernel bootup"
+ default y
+ ---help---
+ Wifi driver will be load (use late_initcall) when kernel bootup
menuconfig RTL_WIRELESS_SOLUTION
bool "Realtek Wireless Device Driver Support"
esp_common_exit();
}
+#include <linux/rfkill-wlan.h>
+extern int get_wifi_chip_type(void);
+
int rockchip_wifi_init_module_esp8089(void)
{
-
- return esp_init();
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ int type = get_wifi_chip_type();
+ if (type != WIFI_ESP8089) return 0;
+#endif
+ return esp_init();
}
void rockchip_wifi_exit_module_esp8089(void)
{
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ int type = get_wifi_chip_type();
+ if (type != WIFI_ESP8089) return;
+#endif
esp_exit();
-
}
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+late_initcall(rockchip_wifi_init_module_esp8089);
+module_exit(rockchip_wifi_exit_module_esp8089);
+#else
EXPORT_SYMBOL(rockchip_wifi_init_module_esp8089);
EXPORT_SYMBOL(rockchip_wifi_exit_module_esp8089);
-
+#endif
//module_init(esp_init);
//module_exit(esp_exit);
return NOTIFY_DONE;
}
+#include <linux/rfkill-wlan.h>
+extern int get_wifi_chip_type(void);
extern char WIFI_MODULE_NAME[];
extern char RKWIFI_DRV_VERSION[];
int rockchip_wifi_init_module_rkwifi(void)
{
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ int type = get_wifi_chip_type();
+ if (type > WIFI_AP6XXX_SERIES) return 0;
+#endif
printk("=======================================================\n");
printk("==== Launching Wi-Fi driver! (Powered by Rockchip) ====\n");
printk("=======================================================\n");
void rockchip_wifi_exit_module_rkwifi(void)
{
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ int type = get_wifi_chip_type();
+ if (type > WIFI_AP6XXX_SERIES) return;
+#endif
printk("=======================================================\n");
printk("== Dis-launching Wi-Fi driver! (Powered by Rockchip) ==\n");
printk("=======================================================\n");
dhd_module_exit();
}
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+late_initcall(rockchip_wifi_init_module_rkwifi);
+module_exit(rockchip_wifi_exit_module_rkwifi);
+#else
EXPORT_SYMBOL(rockchip_wifi_init_module_rkwifi);
EXPORT_SYMBOL(rockchip_wifi_exit_module_rkwifi);
+#endif
//#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
//#if defined(CONFIG_DEFERRED_INITCALLS)
//deferred_module_init(dhd_module_init);
#include "wifi_version.h"
#include <linux/rfkill-wlan.h>
+extern int get_wifi_chip_type(void);
int rockchip_wifi_init_module_rtkwifi(void)
{
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ int type = get_wifi_chip_type();
+ if (type < WIFI_AP6XXX_SERIES || type == WIFI_ESP8089) return 0;
+#endif
printk("\n");
printk("=======================================================\n");
printk("==== Launching Wi-Fi driver! (Powered by Rockchip) ====\n");
void rockchip_wifi_exit_module_rtkwifi(void)
{
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ int type = get_wifi_chip_type();
+ if (type < WIFI_AP6XXX_SERIES || type == WIFI_ESP8089) return;
+#endif
printk("\n");
printk("=======================================================\n");
printk("==== Dislaunching Wi-Fi driver! (Powered by Rockchip) ====\n");
rockchip_wifi_power(0);
}
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+late_initcall(rockchip_wifi_init_module_rtkwifi);
+module_exit(rockchip_wifi_exit_module_rtkwifi);
+#else
EXPORT_SYMBOL(rockchip_wifi_init_module_rtkwifi);
EXPORT_SYMBOL(rockchip_wifi_exit_module_rtkwifi);
+#endif
//module_init(rtw_drv_entry);
//module_exit(rtw_drv_halt);
#include "wifi_version.h"
#include <linux/rfkill-wlan.h>
+extern int get_wifi_chip_type(void);
int rockchip_wifi_init_module_rtkwifi(void)
{
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ int type = get_wifi_chip_type();
+ if (type < WIFI_AP6XXX_SERIES || type == WIFI_ESP8089) return 0;
+#endif
printk("\n");
printk("=======================================================\n");
printk("==== Launching Wi-Fi driver! (Powered by Rockchip) ====\n");
void rockchip_wifi_exit_module_rtkwifi(void)
{
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ int type = get_wifi_chip_type();
+ if (type < WIFI_AP6XXX_SERIES || type == WIFI_ESP8089) return;
+#endif
printk("\n");
printk("=======================================================\n");
printk("==== Dislaunching Wi-Fi driver! (Powered by Rockchip) ====\n");
rockchip_wifi_power(0);
}
-#ifdef CONFIG_RTL8189ES
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+late_initcall(rockchip_wifi_init_module_rtkwifi);
+module_exit(rockchip_wifi_exit_module_rtkwifi);
+#else
EXPORT_SYMBOL(rockchip_wifi_init_module_rtkwifi);
EXPORT_SYMBOL(rockchip_wifi_exit_module_rtkwifi);
-#else
-module_init(rockchip_wifi_init_module_rtkwifi);
-module_exit(rockchip_wifi_exit_module_rtkwifi);
#endif
//module_init(rtw_drv_entry);
//module_exit(rtw_drv_halt);
#include "wifi_version.h"
#include <linux/rfkill-wlan.h>
+extern int get_wifi_chip_type(void);
int rockchip_wifi_init_module_rtkwifi(void)
{
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ int type = get_wifi_chip_type();
+ if (type < WIFI_AP6XXX_SERIES || type == WIFI_ESP8089) return 0;
+#endif
printk("\n");
printk("=======================================================\n");
printk("==== Launching Wi-Fi driver! (Powered by Rockchip) ====\n");
void rockchip_wifi_exit_module_rtkwifi(void)
{
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ int type = get_wifi_chip_type();
+ if (type < WIFI_AP6XXX_SERIES || type == WIFI_ESP8089) return;
+#endif
printk("\n");
printk("=======================================================\n");
printk("==== Dislaunching Wi-Fi driver! (Powered by Rockchip) ====\n");
rockchip_wifi_power(0);
}
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+late_initcall(rockchip_wifi_init_module_rtkwifi);
+module_exit(rockchip_wifi_exit_module_rtkwifi);
+#else
EXPORT_SYMBOL(rockchip_wifi_init_module_rtkwifi);
EXPORT_SYMBOL(rockchip_wifi_exit_module_rtkwifi);
+#endif
//module_init(rtw_drv_entry);
//module_exit(rtw_drv_halt);
#include "wifi_version.h"
#include <linux/rfkill-wlan.h>
+extern int get_wifi_chip_type(void);
int rockchip_wifi_init_module_rtkwifi(void)
{
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ int type = get_wifi_chip_type();
+ if (type < WIFI_AP6XXX_SERIES || type == WIFI_ESP8089) return 0;
+#endif
printk("\n");
printk("=======================================================\n");
printk("==== Launching Wi-Fi driver! (Powered by Rockchip) ====\n");
void rockchip_wifi_exit_module_rtkwifi(void)
{
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ int type = get_wifi_chip_type();
+ if (type < WIFI_AP6XXX_SERIES || type == WIFI_ESP8089) return;
+#endif
printk("\n");
printk("=======================================================\n");
printk("==== Dislaunching Wi-Fi driver! (Powered by Rockchip) ====\n");
rockchip_wifi_power(0);
}
-#ifdef CONFIG_RTL8192DU
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+late_initcall(rockchip_wifi_init_module_rtkwifi);
+module_exit(rockchip_wifi_exit_module_rtkwifi);
+#else
EXPORT_SYMBOL(rockchip_wifi_init_module_rtkwifi);
EXPORT_SYMBOL(rockchip_wifi_exit_module_rtkwifi);
-#else
-module_init(rockchip_wifi_init_module_rtkwifi);
-module_exit(rockchip_wifi_exit_module_rtkwifi);
#endif
//module_init(rtw_drv_entry);
//module_exit(rtw_drv_halt);
#include "wifi_version.h"
#include <linux/rfkill-wlan.h>
+extern int get_wifi_chip_type(void);
int rockchip_wifi_init_module_rtkwifi(void)
{
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ int type = get_wifi_chip_type();
+ if (type < WIFI_AP6XXX_SERIES || type == WIFI_ESP8089) return 0;
+#endif
printk("\n");
printk("=======================================================\n");
printk("==== Launching Wi-Fi driver! (Powered by Rockchip) ====\n");
void rockchip_wifi_exit_module_rtkwifi(void)
{
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ int type = get_wifi_chip_type();
+ if (type < WIFI_AP6XXX_SERIES || type == WIFI_ESP8089) return;
+#endif
printk("\n");
printk("=======================================================\n");
printk("==== Dislaunching Wi-Fi driver! (Powered by Rockchip) ====\n");
rockchip_wifi_power(0);
}
-#ifdef CONFIG_RTL8723AU
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+late_initcall(rockchip_wifi_init_module_rtkwifi);
+module_exit(rockchip_wifi_exit_module_rtkwifi);
+#else
EXPORT_SYMBOL(rockchip_wifi_init_module_rtkwifi);
EXPORT_SYMBOL(rockchip_wifi_exit_module_rtkwifi);
-#else
-module_init(rockchip_wifi_init_module_rtkwifi);
-module_exit(rockchip_wifi_exit_module_rtkwifi);
#endif
//module_init(rtw_drv_entry);
//module_exit(rtw_drv_halt);
#endif //CONFIG_PLATFORM_INTEL_BYT
#include "wifi_version.h"
-
+#include <linux/rfkill-wlan.h>
+extern int get_wifi_chip_type(void);
extern int rockchip_wifi_power(int on);
extern int rockchip_wifi_set_carddetect(int val);
int rockchip_wifi_init_module_rtkwifi(void)
{
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ int type = get_wifi_chip_type();
+ if (type < WIFI_AP6XXX_SERIES || type == WIFI_ESP8089) return 0;
+#endif
printk("\n");
printk("=======================================================\n");
printk("==== Launching Wi-Fi driver! (Powered by Rockchip) ====\n");
void rockchip_wifi_exit_module_rtkwifi(void)
{
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ int type = get_wifi_chip_type();
+ if (type < WIFI_AP6XXX_SERIES || type == WIFI_ESP8089) return;
+#endif
printk("\n");
printk("=======================================================\n");
printk("==== Dislaunching Wi-Fi driver! (Powered by Rockchip) ====\n");
rockchip_wifi_power(0);
}
-#ifdef CONFIG_RTL8723BS_VQ0
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+late_initcall(rockchip_wifi_init_module_rtkwifi);
+module_exit(rockchip_wifi_exit_module_rtkwifi);
+#else
EXPORT_SYMBOL(rockchip_wifi_init_module_rtkwifi);
EXPORT_SYMBOL(rockchip_wifi_exit_module_rtkwifi);
-#else
-module_init(rockchip_wifi_init_module_rtkwifi);
-module_exit(rockchip_wifi_exit_module_rtkwifi);
#endif
//module_init(rtw_drv_entry);
//module_exit(rtw_drv_halt);
#endif //CONFIG_PLATFORM_INTEL_BYT
#include "wifi_version.h"
-
+#include <linux/rfkill-wlan.h>
extern int rockchip_wifi_power(int on);
extern int rockchip_wifi_set_carddetect(int val);
-
-
-
+extern int get_wifi_chip_type(void);
int rockchip_wifi_init_module_rtkwifi(void)
{
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ int type = get_wifi_chip_type();
+ if (type < WIFI_AP6XXX_SERIES || type == WIFI_ESP8089) return 0;
+#endif
printk("\n");
printk("=======================================================\n");
printk("==== Launching Wi-Fi driver! (Powered by Rockchip) ====\n");
void rockchip_wifi_exit_module_rtkwifi(void)
{
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ int type = get_wifi_chip_type();
+ if (type < WIFI_AP6XXX_SERIES || type == WIFI_ESP8089) return;
+#endif
printk("\n");
printk("=======================================================\n");
printk("==== Dislaunching Wi-Fi driver! (Powered by Rockchip) ====\n");
rockchip_wifi_power(0);
}
-#ifdef CONFIG_RTL8723BS
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+late_initcall(rockchip_wifi_init_module_rtkwifi);
+module_exit(rockchip_wifi_exit_module_rtkwifi);
+#else
EXPORT_SYMBOL(rockchip_wifi_init_module_rtkwifi);
EXPORT_SYMBOL(rockchip_wifi_exit_module_rtkwifi);
-#else
-module_init(rockchip_wifi_init_module_rtkwifi);
-module_exit(rockchip_wifi_exit_module_rtkwifi);
#endif
//module_init(rtw_drv_entry);
//module_exit(rtw_drv_halt);
}
#include "wifi_version.h"
+#include <linux/rfkill-wlan.h>
+extern int get_wifi_chip_type(void);
//extern int wifi_activate_usb(void);
//extern int wifi_deactivate_usb(void);
extern int rockchip_wifi_power(int on);
int rockchip_wifi_init_module_rtkwifi(void)
{
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ int type = get_wifi_chip_type();
+ if (type < WIFI_AP6XXX_SERIES || type == WIFI_ESP8089) return 0;
+#endif
printk("\n");
printk("=======================================================\n");
printk("==== Launching Wi-Fi driver! (Powered by Rockchip) ====\n");
void rockchip_wifi_exit_module_rtkwifi(void)
{
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ int type = get_wifi_chip_type();
+ if (type < WIFI_AP6XXX_SERIES || type == WIFI_ESP8089) return;
+#endif
printk("\n");
printk("=======================================================\n");
printk("==== Dislaunching Wi-Fi driver! (Powered by Rockchip) ====\n");
// wifi_deactivate_usb();
}
-
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+late_initcall(rockchip_wifi_init_module_rtkwifi);
+module_exit(rockchip_wifi_exit_module_rtkwifi);
+#else
EXPORT_SYMBOL(rockchip_wifi_init_module_rtkwifi);
EXPORT_SYMBOL(rockchip_wifi_exit_module_rtkwifi);
+#endif
//module_init(rtw_drv_entry);
//module_exit(rtw_drv_halt);
#include "wifi_version.h"
#include <linux/rfkill-wlan.h>
+extern int get_wifi_chip_type(void);
int rockchip_wifi_init_module_rtkwifi(void)
{
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ int type = get_wifi_chip_type();
+ if (type < WIFI_AP6XXX_SERIES || type == WIFI_ESP8089) return 0;
+#endif
printk("\n");
printk("=======================================================\n");
printk("==== Launching Wi-Fi driver! (Powered by Rockchip) ====\n");
void rockchip_wifi_exit_module_rtkwifi(void)
{
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ int type = get_wifi_chip_type();
+ if (type < WIFI_AP6XXX_SERIES || type == WIFI_ESP8089) return;
+#endif
printk("\n");
printk("=======================================================\n");
printk("==== Dislaunching Wi-Fi driver! (Powered by Rockchip) ====\n");
rockchip_wifi_power(0);
}
-#ifdef CONFIG_RTL8812AU
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+late_initcall(rockchip_wifi_init_module_rtkwifi);
+module_exit(rockchip_wifi_exit_module_rtkwifi);
+#else
EXPORT_SYMBOL(rockchip_wifi_init_module_rtkwifi);
EXPORT_SYMBOL(rockchip_wifi_exit_module_rtkwifi);
-#else
-module_init(rockchip_wifi_init_module_rtkwifi);
-module_exit(rockchip_wifi_exit_module_rtkwifi);
#endif
//module_init(rtw_drv_entry);
//module_exit(rtw_drv_halt);
static int wifi_init_exit_module(int enable)
{
int ret = 0;
+
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+#else
int type = get_wifi_chip_type();
//#ifdef CONFIG_RKWIFI
if (type < WIFI_AP6XXX_SERIES) {
return ret;
}
//#endif
-
+#endif
return ret;
}
static CLASS_ATTR(chip, 0664, wifi_chip_read, NULL);
static CLASS_ATTR(power, 0660, NULL, wifi_power_write);
static CLASS_ATTR(driver, 0660, NULL, wifi_driver_write);
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+static CLASS_ATTR(preload, 0660, NULL, NULL);
+#endif
int rkwifi_sysif_init(void)
{
ret = class_create_file(rkwifi_class, &class_attr_chip);
ret = class_create_file(rkwifi_class, &class_attr_power);
ret = class_create_file(rkwifi_class, &class_attr_driver);
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ ret = class_create_file(rkwifi_class, &class_attr_preload);
+#endif
sema_init(&driver_sem, 1);
return 0;
class_remove_file(rkwifi_class, &class_attr_chip);
class_remove_file(rkwifi_class, &class_attr_power);
class_remove_file(rkwifi_class, &class_attr_driver);
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+ class_remove_file(rkwifi_class, &class_attr_preload);
+#endif
class_destroy(rkwifi_class);
rkwifi_class = NULL;