wifi: renew patch drivers/net/wireless
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / wifi_launcher / wlan.c
1 /*
2  * Just a wifi driver hooker.
3  *
4  * Yongle Lai @ 2009-05-10 @ Rockchip
5  */
6
7 #include <linux/init.h>
8 #include <linux/module.h>
9 #include <linux/kernel.h>
10
11 MODULE_LICENSE("Dual BSD/GPL");
12
13 #ifdef CONFIG_MODVERSIONS
14 #define MODVERSIONS
15 #include <linux/modversions.h>
16 #endif 
17
18 //#define OLD_WIFI_IFACE
19
20 #ifdef OLD_WIFI_IFACE
21 extern int mv88w8686_if_sdio_init_module(void);
22 extern void mv88w8686_if_sdio_exit_module(void);
23 #else
24 extern int rockchip_wifi_init_module(void);
25 extern void rockchip_wifi_exit_module(void);
26 #endif
27
28 static int wifi_launcher_init(void) 
29 {
30   int ret;
31
32   printk("=======================================================\n");
33   printk("==== Launching Wi-Fi driver! (Powered by Rockchip) ====\n");
34   printk("=======================================================\n");
35
36 #ifdef OLD_WIFI_IFACE
37   ret = mv88w8686_if_sdio_init_module();
38   if (ret) /* Try again */
39         ret = mv88w8686_if_sdio_init_module();
40 #else
41   ret = rockchip_wifi_init_module();
42   //if (ret) /* Try again */
43   //    ret = rockchip_wifi_init_module();
44 #endif
45
46   return ret;
47 }
48
49 static void wifi_launcher_exit(void) 
50 {
51   printk("=======================================================\n");
52   printk("== Dis-launching Wi-Fi driver! (Powered by Rockchip) ==\n");
53   printk("=======================================================\n");
54
55 #ifdef OLD_WIFI_IFACE
56   mv88w8686_if_sdio_exit_module();
57 #else
58   rockchip_wifi_exit_module();
59 #endif
60 }
61
62 module_init(wifi_launcher_init);
63 module_exit(wifi_launcher_exit);
64