support different wifi bt chip auto compatible
authorhwg <hwg@rock-chips.com>
Sat, 28 Feb 2015 06:05:32 +0000 (14:05 +0800)
committerhwg <hwg@rock-chips.com>
Sat, 28 Feb 2015 06:05:32 +0000 (14:05 +0800)
 like auto recognize rtl8188eu, ap6210, esp8089 in android

20 files changed:
arch/arm/configs/rockchip_defconfig [changed mode: 0644->0755]
drivers/mmc/host/rk_sdmmc.c
drivers/net/wireless/Kconfig
drivers/net/wireless/rockchip_wlan/esp8089/Kconfig
drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/Makefile [changed mode: 0644->0755]
drivers/net/wireless/rockchip_wlan/rkwifi/rk_wifi_config.c [changed mode: 0644->0755]
drivers/net/wireless/rockchip_wlan/rtl8188eu/Kconfig
drivers/net/wireless/rockchip_wlan/rtl8189es/Makefile
drivers/net/wireless/rockchip_wlan/rtl8189es/os_dep/linux/sdio_intf.c
drivers/net/wireless/rockchip_wlan/rtl8192du/os_dep/linux/usb_intf.c
drivers/net/wireless/rockchip_wlan/rtl8723au/Makefile
drivers/net/wireless/rockchip_wlan/rtl8723au/os_dep/linux/usb_intf.c
drivers/net/wireless/rockchip_wlan/rtl8723bs-vq0/os_dep/linux/sdio_intf.c
drivers/net/wireless/rockchip_wlan/rtl8723bs/Makefile
drivers/net/wireless/rockchip_wlan/rtl8723bs/os_dep/linux/sdio_intf.c
drivers/net/wireless/rockchip_wlan/rtl8723bu/os_dep/linux/usb_intf.c
drivers/net/wireless/rockchip_wlan/rtl8812au/os_dep/linux/usb_intf.c
drivers/net/wireless/rockchip_wlan/wifi_sys/rkwifi_sys_iface.c
include/linux/rfkill-wlan.h
net/rfkill/rfkill-wlan.c

old mode 100644 (file)
new mode 100755 (executable)
index 7d88cf9..1db7429
@@ -204,6 +204,7 @@ CONFIG_BT_BNEP=y
 CONFIG_BT_BNEP_MC_FILTER=y
 CONFIG_BT_BNEP_PROTO_FILTER=y
 CONFIG_BT_HIDP=y
+CONFIG_BT_RTKBTUSB=y
 CONFIG_BT_HCIUART=y
 CONFIG_BT_HCIUART_H4=y
 CONFIG_BT_HCIUART_LL=y
@@ -294,6 +295,13 @@ CONFIG_USB_NET_INT51X1=y
 CONFIG_USB_IPHETH=y
 CONFIG_USB_SIERRA_NET=y
 CONFIG_RTL8188EU=y
+CONFIG_RTL8189ES=m
+CONFIG_RTL8192DU=m
+CONFIG_RTL8723AU=m
+CONFIG_RTL8723BU=m
+CONFIG_RTL8723BS=m
+CONFIG_RTL8723BS_VQ0=m
+CONFIG_RTL8812AU=m
 CONFIG_ESP8089=y
 CONFIG_RKWIFI=y
 CONFIG_AP6335=y
index 6b00c666b81a3faadf6ce0ca910dafcafd081b12..b7d1175a6c66da0092c678b77654310b7f032e79 100755 (executable)
@@ -4114,7 +4114,7 @@ extern int get_wifi_chip_type(void);
 int dw_mci_suspend(struct dw_mci *host)
 {
        if((host->mmc->restrict_caps & RESTRICT_CARD_TYPE_SDIO) &&
-               (get_wifi_chip_type() == WIFI_ESP8089 || get_wifi_chip_type() == WIFI_RTKWIFI))
+               (get_wifi_chip_type() == WIFI_ESP8089 || get_wifi_chip_type() > WIFI_AP6XXX_SERIES))
                return 0;
 
         if(host->vmmc)
@@ -4148,7 +4148,7 @@ int dw_mci_resume(struct dw_mci *host)
         struct dw_mci_slot *slot;
 
        if((host->mmc->restrict_caps & RESTRICT_CARD_TYPE_SDIO) &&
-               (get_wifi_chip_type() == WIFI_ESP8089 || get_wifi_chip_type() == WIFI_RTKWIFI))
+               (get_wifi_chip_type() == WIFI_ESP8089 || get_wifi_chip_type() > WIFI_AP6XXX_SERIES))
                return 0;
 
 
index 94c07fe4a96e45c399078c11674f721838813980..a8b40006b7d74c6a0cb69a5b4197de9761954cfb 100755 (executable)
@@ -25,30 +25,16 @@ if WLAN
 #        bool "rda 5990p"
 #        ---help---
 #          rda5990P fm bt wifi
-           
-menuconfig RTL_WIRELESS_SOLUTION
-    bool "Realtek Wireless Device Driver Support"
-    default y
-
-if RTL_WIRELESS_SOLUTION
-choice
-    prompt "Realtek WiFi Device Driver Support"
-    default RTL8188EU
-
-    config RTL_WIFI_NONE
-    bool "No Realtek WiFi"
 
 source "drivers/net/wireless/rockchip_wlan/rtl8188eu/Kconfig"
 source "drivers/net/wireless/rockchip_wlan/rtl8189es/Kconfig"
-source "drivers/net/wireless/rockchip_wlan/rtl8192cu/Kconfig"
+#source "drivers/net/wireless/rockchip_wlan/rtl8192cu/Kconfig"
 source "drivers/net/wireless/rockchip_wlan/rtl8192du/Kconfig"
 source "drivers/net/wireless/rockchip_wlan/rtl8723au/Kconfig"
 source "drivers/net/wireless/rockchip_wlan/rtl8723bu/Kconfig"
 source "drivers/net/wireless/rockchip_wlan/rtl8723bs/Kconfig"
 source "drivers/net/wireless/rockchip_wlan/rtl8723bs-vq0/Kconfig"
 source "drivers/net/wireless/rockchip_wlan/rtl8812au/Kconfig"
-endchoice
-endif
 
 #source "drivers/net/wireless/rockchip_wlan/mt5931/Kconfig"
 source "drivers/net/wireless/rockchip_wlan/esp8089/Kconfig"
index f8bdee84eaf6eeb72caea5ae6de145d0ceca1b66..399189a8362cb9f95c298cf5b0fd1c2815521fd9 100755 (executable)
@@ -9,14 +9,14 @@ config ESP8089
       ---help---
         Espressif 8089 sdio Wi-Fi support
        
-  config BK3515A_COMBO
-         depends on ESP8089
-         select WIRELESS_EXT
-         select WEXT_PRIV
-         select CFG80211
-         select MAC80211
-         select NL80211_TESTMODE
-         bool "Espressif 8089 sdio Wi-Fi combo with BK3515A bluetooth"
-         ---help---
-           RK Wi-Fi+BT+[GPS optional] Combo module support
+#  config BK3515A_COMBO
+#        depends on ESP8089
+#        select WIRELESS_EXT
+#        select WEXT_PRIV
+#        select CFG80211
+#        select MAC80211
+#        select NL80211_TESTMODE
+#        bool "Espressif 8089 sdio Wi-Fi combo with BK3515A bluetooth"
+#        ---help---
+#          RK Wi-Fi+BT+[GPS optional] Combo module support
 
old mode 100644 (file)
new mode 100755 (executable)
index 1893be4..d9e8600
@@ -36,7 +36,7 @@ $(MODULE_NAME)-y += $(DHDOFILES)
 
 DHDCFLAGS += -DCUSTOMER_HW
 
-DHDCFLAGS += -DSTATIC_WL_PRIV_STRUCT -DCONFIG_DHD_USE_STATIC_BUF -DENHANCED_STATIC_BUF 
+#DHDCFLAGS += -DSTATIC_WL_PRIV_STRUCT -DCONFIG_DHD_USE_STATIC_BUF -DENHANCED_STATIC_BUF 
 
 ifeq ($(CONFIG_BCMDHD_OOB),y)
 DHDCFLAGS += -DOOB_INTR_ONLY -DHW_OOB -DCUSTOMER_OOB
old mode 100644 (file)
new mode 100755 (executable)
index 67ac0f8..dce8eb1
@@ -10,6 +10,7 @@
  */
 #include <linux/module.h>
 #include <linux/kernel.h>
+#include <linux/rfkill-wlan.h>
 
 /* 
  * Set Firmware Path
  
 #define ANDROID_FW_PATH "/system/etc/firmware/"
 
+extern int get_wifi_chip_type(void);
 int rkwifi_set_firmware(char *fw, char *nvram)
 {
-#ifdef CONFIG_RK903
+    int chip = get_wifi_chip_type();
+    
+if (chip == WIFI_RK903) {
        sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_RK903b2.bin");
-#ifdef CONFIG_RKWIFI_26M
        sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_RK903_26M.cal");
-#endif
-#ifdef CONFIG_RKWIFI_37_4M     
-       sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_RK903.cal");
-#endif 
-#endif 
+}
 
-#ifdef CONFIG_RK901
+if (chip == WIFI_RK901) {
        sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_RK901.bin");
        sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_RK901.txt");
-#endif
+}
 
 #ifdef CONFIG_BCM4330
        sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_bcm4330.bin");
@@ -43,50 +42,45 @@ int rkwifi_set_firmware(char *fw, char *nvram)
 #endif
 #endif
 
-#ifdef CONFIG_AP6181
+if (chip == WIFI_AP6181) {
     sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_RK901.bin");
        sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_AP6181.txt");
-#endif
+}
 
-#ifdef CONFIG_AP6210
+if (chip == WIFI_AP6210) {
     sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_RK901.bin");
-#ifdef CONFIG_RKWIFI_26M
        sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_AP6210.txt");
-#endif
-#ifdef CONFIG_RKWIFI_24M
-       sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_AP6210_24M.txt");
-#endif
-#endif
+}
 
-#ifdef CONFIG_AP6234
+if (chip == WIFI_AP6234) {
     sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_bcm43341b0_ag.bin");
        sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_AP6234.txt");
-#endif
+}
 
-#ifdef CONFIG_AP6441
+if (chip == WIFI_AP6441) {
     sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_bcm43341b0_ag.bin");
        sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_AP6441.txt");
-#endif
+}
 
-#ifdef CONFIG_AP6335
+if (chip == WIFI_AP6335) {
     sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_bcm4339a0_ag.bin");
        sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_AP6335.txt");
-#endif
+}
 
-#ifdef CONFIG_AP6476
+if (chip == WIFI_AP6476) {
     sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_RK901.bin");
        sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_AP6476.txt");
-#endif
+}
 
-#ifdef CONFIG_AP6493
+if (chip == WIFI_AP6493) {
     sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_RK903.bin");
        sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_AP6493.txt");
-#endif
+}
 
-#ifdef CONFIG_AP6330
+if (chip == WIFI_AP6330) {
     sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_RK903_ag.bin");
        sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_AP6330.txt");
-#endif
+}
 
 #ifdef CONFIG_GB86302I
     sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_RK903_ag.bin");
index 013175c374b2f65c5f68c1fab9f2c5e144b623b9..c8148ed9fc438ac5a248cf1f11b0a5f773f84bee 100755 (executable)
@@ -1,6 +1,9 @@
 config RTL8188EU
-       tristate "Realtek 8188E USB WiFi"
-       depends on USB
+       tristate "Realtek 8188EU USB WiFi Support"
+    select WIRELESS_EXT
+    select WEXT_PRIV
+    select IEEE80211
+    default y
        ---help---
-         Help message of RTL8188EU
+         Help message of RTL8188EU & RTL8189ES
 
index 3d07385a66f187d4b14a59853f4717548d9328a6..905d5da1000ab06dff094b19e9dcc8476b04e8f2 100755 (executable)
@@ -1147,7 +1147,7 @@ endif
 ARCH := arm
 CROSS_COMPILE := /home/android_sdk/Rockchip/Rk3188/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
 KSRC := /home/android_sdk/Rockchip/Rk3188/kernel
-MODULE_NAME := wlan
+MODULE_NAME := 8189es
 endif
 
 ifeq ($(CONFIG_PLATFORM_ARM_RK3066), y)
index c72e7bc02b817b8be4f445175fecb6de2f38b196..381e5616b5bc8670f0cb8054e758299c1e27acef 100755 (executable)
@@ -1082,8 +1082,8 @@ void rockchip_wifi_exit_module_rtkwifi(void)
     rockchip_wifi_power(0);
 }
 
-EXPORT_SYMBOL(rockchip_wifi_init_module_rtkwifi);
-EXPORT_SYMBOL(rockchip_wifi_exit_module_rtkwifi);
+module_init(rockchip_wifi_init_module_rtkwifi);
+module_exit(rockchip_wifi_exit_module_rtkwifi);
 //module_init(rtw_drv_entry);
 //module_exit(rtw_drv_halt);
 
index 240b6bfa30d59603c50e7ec2225518d656e71c38..b38fb8d31521d8445cb1af4be5aa54a6be9a9221 100644 (file)
@@ -1670,8 +1670,8 @@ void rockchip_wifi_exit_module_rtkwifi(void)
     rockchip_wifi_power(0);
 }
 
-EXPORT_SYMBOL(rockchip_wifi_init_module_rtkwifi);
-EXPORT_SYMBOL(rockchip_wifi_exit_module_rtkwifi);
+module_init(rockchip_wifi_init_module_rtkwifi);
+module_exit(rockchip_wifi_exit_module_rtkwifi);
 //module_init(rtw_drv_entry);
 //module_exit(rtw_drv_halt);
 
index 680ad384f724239fa5a85a776be4ab71212c30bf..77d4badb9b4132fd9bf34d058e6fdef1db65f29f 100755 (executable)
@@ -637,7 +637,7 @@ endif
 ARCH := arm
 CROSS_COMPILE := /usr/src/release_fae_version/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
 KSRC := /usr/src/release_fae_version/kernel25_A7_281x
-MODULE_NAME := wlan
+MODULE_NAME := 8723au
 endif
 
 ifeq ($(CONFIG_PLATFORM_ARM_RK3066), y)
index 282262b22e38fbc8bb94ae879f8adf4b4e768acd..fd2f2bae67bf7cac551e07e68f78c6f8e285adf2 100755 (executable)
@@ -2182,8 +2182,8 @@ void rockchip_wifi_exit_module_rtkwifi(void)
     rockchip_wifi_power(0);
 }
 
-EXPORT_SYMBOL(rockchip_wifi_init_module_rtkwifi);
-EXPORT_SYMBOL(rockchip_wifi_exit_module_rtkwifi);
+module_init(rockchip_wifi_init_module_rtkwifi);
+module_exit(rockchip_wifi_exit_module_rtkwifi);
 //module_init(rtw_drv_entry);
 //module_exit(rtw_drv_halt);
 
index 957dc9bcad055eca490433d4cdbb822636ded96a..5192bd64c2a2f32d9d2658bf1fe911c8d6ee853b 100755 (executable)
@@ -1070,8 +1070,8 @@ void rockchip_wifi_exit_module_rtkwifi(void)
     rockchip_wifi_power(0);
 }
 
-EXPORT_SYMBOL(rockchip_wifi_init_module_rtkwifi);
-EXPORT_SYMBOL(rockchip_wifi_exit_module_rtkwifi);
+module_init(rockchip_wifi_init_module_rtkwifi);
+module_exit(rockchip_wifi_exit_module_rtkwifi);
 //module_init(rtw_drv_entry);
 //module_exit(rtw_drv_halt);
 
index 8fb5ca2aeeeba909aed69aefdbb2c98faaafaf96..1dbd023aac6b8228625f4324d310833e2690d1a9 100755 (executable)
@@ -1025,7 +1025,7 @@ EXTRA_CFLAGS += -DCONFIG_P2P_IPS
 ARCH := arm
 CROSS_COMPILE := /home/android_sdk/Rockchip/Rk3188/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
 KSRC := /home/android_sdk/Rockchip/Rk3188/kernel
-MODULE_NAME := wlan
+MODULE_NAME := 8723bs
 endif
 
 ifeq ($(CONFIG_PLATFORM_ARM_RK3066), y)
index 98d873c6faabca992364e4cd50131708e1c0056c..3d5fe53a58112b79085e4cfb7228eabbdd4c1514 100755 (executable)
@@ -975,8 +975,8 @@ void rockchip_wifi_exit_module_rtkwifi(void)
     rockchip_wifi_power(0);
 }
 
-EXPORT_SYMBOL(rockchip_wifi_init_module_rtkwifi);
-EXPORT_SYMBOL(rockchip_wifi_exit_module_rtkwifi);
+module_init(rockchip_wifi_init_module_rtkwifi);
+module_exit(rockchip_wifi_exit_module_rtkwifi);
 //module_init(rtw_drv_entry);
 //module_exit(rtw_drv_halt);
 
index b5dbac4d44062d9dafca1969062198323ab16233..790f9799c36552c1bc05f9c1bd4a5127aff00252 100755 (executable)
@@ -1782,8 +1782,8 @@ void rockchip_wifi_exit_module_rtkwifi(void)
     rockchip_wifi_power(0);
 }
 
-EXPORT_SYMBOL(rockchip_wifi_init_module_rtkwifi);
-EXPORT_SYMBOL(rockchip_wifi_exit_module_rtkwifi);
+module_init(rockchip_wifi_init_module_rtkwifi);
+module_exit(rockchip_wifi_exit_module_rtkwifi);
 
 //module_init(rtw_drv_entry);
 //module_exit(rtw_drv_halt);
index 8ac500d46d4378d4d8a122d822e52ee0e0eedfab..b98005011e9009ae708b58b884f01af45797d7cf 100755 (executable)
@@ -1777,8 +1777,8 @@ void rockchip_wifi_exit_module_rtkwifi(void)
     rockchip_wifi_power(0);
 }
 
-EXPORT_SYMBOL(rockchip_wifi_init_module_rtkwifi);
-EXPORT_SYMBOL(rockchip_wifi_exit_module_rtkwifi);
+module_init(rockchip_wifi_init_module_rtkwifi);
+module_exit(rockchip_wifi_exit_module_rtkwifi);
 //module_init(rtw_drv_entry);
 //module_exit(rtw_drv_halt);
 
index 9465a4f7f1af2258f4145dc6c3fa3a1091868e2d..795d4b8407d09efa3ff314d4bfc23f15f570d87d 100755 (executable)
@@ -17,148 +17,95 @@ static ssize_t wifi_chip_read(struct class *cls, struct class_attribute *attr, c
     int count = 0;
     int type = get_wifi_chip_type();
 
-if(type == WIFI_RTKWIFI) {
-#ifdef CONFIG_RTL8192CU
-    count = sprintf(_buf, "%s", "RTL8188CU");
-    printk("Current WiFi chip is RTL8188CU.\n");
-#endif
-
-#ifdef CONFIG_RTL8192DU
-    count = sprintf(_buf, "%s", "RTL8192DU");
-    printk("Current WiFi chip is RTL8192DU.\n");
-#endif
-
-#ifdef CONFIG_RTL8188EU
-    count = sprintf(_buf, "%s", "RTL8188EU");
-    printk("Current WiFi chip is RTL8188EU.\n");
-#endif
-
-#ifdef CONFIG_RTL8723AU
-    count = sprintf(_buf, "%s", "RTL8723AU");
-    printk("Current WiFi chip is RTL8723AU.\n");
-#endif
-
-#ifdef CONFIG_RTL8723BU
-    count = sprintf(_buf, "%s", "RTL8723BU");
-    printk("Current WiFi chip is RTL8723BU.\n");
-#endif
-
-#ifdef CONFIG_RTL8723BS
-    count = sprintf(_buf, "%s", "RTL8723BS");
-    printk("Current WiFi chip is RTL8723BS.\n");
-#endif
-
-#ifdef CONFIG_RTL8723BS_VQ0
-    count = sprintf(_buf, "%s", "RTL8723BS");
-    printk("Current WiFi chip is RTL8723BS.\n");
-#endif
-
-#ifdef CONFIG_RTL8189ES
-    count = sprintf(_buf, "%s", "RTL8189ES");
-    printk("Current WiFi chip is RTL8189ES.\n");
-#endif
-
-#ifdef CONFIG_RTL8812AU
-    count = sprintf(_buf, "%s", "RTL8812AU");
-    printk("Current WiFi chip is RTL8812AU.\n");
-#endif
-
-
-}
-
-if(type == WIFI_BCMWIFI) {
-#ifdef CONFIG_BCM4330
-    count = sprintf(_buf, "%s", "BCM4330");
-    printk("Current WiFi chip is BCM4330.\n");
-#endif
-
-#ifdef CONFIG_RK901
-    count = sprintf(_buf, "%s", "RK901");
-    printk("Current WiFi chip is RK901.\n");
-#endif
-
-#ifdef CONFIG_RK903
-    count = sprintf(_buf, "%s", "RK903");
-    printk("Current WiFi chip is RK903.\n");
-#endif
-
-#ifdef CONFIG_AP6181
-    count = sprintf(_buf, "%s", "RK901");
-    printk("Current WiFi chip is AP6181.\n");
-#endif
-
-#ifdef CONFIG_AP6210
-    count = sprintf(_buf, "%s", "RK901");
-    printk("Current WiFi chip is AP6210.\n");
-#endif
-
-#ifdef CONFIG_AP6234
-    count = sprintf(_buf, "%s", "AP6234");
-    printk("Current WiFi chip is AP6234.\n");
-#endif
-
-#ifdef CONFIG_AP6330
-    count = sprintf(_buf, "%s", "RK903");
-    printk("Current WiFi chip is AP6330.\n");
-#endif
-
-#ifdef CONFIG_AP6335
-    count = sprintf(_buf, "%s", "AP6335");
-    printk("Current WiFi chip is AP6335.\n");
-#endif
-
-#ifdef CONFIG_AP6441
-    count = sprintf(_buf, "%s", "AP6441");
-    printk("Current WiFi chip is AP6441.\n");
-#endif
-
-#ifdef CONFIG_AP6476
-    count = sprintf(_buf, "%s", "RK901");
-    printk("Current WiFi chip is AP6476.\n");
-#endif
-
-#ifdef CONFIG_AP6493
-    count = sprintf(_buf, "%s", "RK903");
-    printk("Current WiFi chip is AP6493.\n");
-#endif
-
-#ifdef CONFIG_GB86302I
-    count = sprintf(_buf, "%s", "RK903");
-    printk("Current WiFi chip is GB86302I.\n");
-#endif
-}
-
-#ifdef CONFIG_MTK_COMBO
-       count = sprintf(_buf, "%s", "MT6620");
-       printk("Current WiFi chip is MT6620.\n");
-#endif
-
-#ifdef CONFIG_MT5931
-    count = sprintf(_buf, "%s", "MT5931");
-    printk("Current WiFi chip is MT5931.\n");
-#endif
-
-#ifdef CONFIG_MT5931_MT6622
-    count = sprintf(_buf, "%s", "MT5931");
-    printk("Current WiFi chip is MT5931.\n");
-#endif
-
-#ifdef CONFIG_MTK_MT5931
-    count = sprintf(_buf, "%s", "MT5931");
-    printk("Current WiFi chip is MT5931.\n");
-#endif
-
-#ifdef CONFIG_MT7601
-    count = sprintf(_buf, "%s", "MT7601");
-    printk("Current WiFi chip is MT7601.\n");
-#endif
-
-if(type == WIFI_ESP8089) {
-#ifdef CONFIG_ESP8089
-    count = sprintf(_buf, "%s", "ESP8089");
-    printk("Current WiFi chip is ESP8089.\n");
-#endif
-}
+       if(type == WIFI_RK901) {
+           count = sprintf(_buf, "%s", "APRK901");
+           printk("Current WiFi chip is APRK901.\n");
+       }
+
+       if(type == WIFI_RK903) {
+           count = sprintf(_buf, "%s", "APRK903");
+           printk("Current WiFi chip is APRK903.\n");
+       }
+               
+       if(type == WIFI_AP6181) {
+           count = sprintf(_buf, "%s", "AP6181");
+           printk("Current WiFi chip is AP6181.\n");
+       }
+
+       if(type == WIFI_AP6210) {
+           count = sprintf(_buf, "%s", "AP6210");
+           printk("Current WiFi chip is AP6210.\n");
+       }
+       
+       if(type == WIFI_AP6234) {
+           count = sprintf(_buf, "%s", "AP6234");
+           printk("Current WiFi chip is AP6234.\n");
+       }
+       
+       if(type == WIFI_AP6330) {
+           count = sprintf(_buf, "%s", "AP6330");
+           printk("Current WiFi chip is AP6330.\n");
+       }
+       
+       if(type == WIFI_AP6335) {
+           count = sprintf(_buf, "%s", "AP6335");
+           printk("Current WiFi chip is AP6335.\n");
+       }
+
+       if(type == WIFI_AP6441) {
+           count = sprintf(_buf, "%s", "AP6441");
+           printk("Current WiFi chip is AP6441.\n");
+       }
+
+       if(type == WIFI_AP6476) {
+           count = sprintf(_buf, "%s", "AP6476");
+           printk("Current WiFi chip is AP6476.\n");
+       }
+
+       if(type == WIFI_AP6493) {
+           count = sprintf(_buf, "%s", "AP6493");
+           printk("Current WiFi chip is AP6493.\n");
+       }
+
+       if(type == WIFI_RTL8188EU) {
+           count = sprintf(_buf, "%s", "RTL8188EU");
+           printk("Current WiFi chip is RTL8188EU.\n");
+       }
+       
+       if(type == WIFI_RTL8723BS) {
+           count = sprintf(_buf, "%s", "RTL8723BS");
+           printk("Current WiFi chip is RTL8723BS.\n");
+       }
+
+       if(type == WIFI_RTL8723AS) {
+           count = sprintf(_buf, "%s", "RTL8723AS");
+           printk("Current WiFi chip is RTL8723AS.\n");
+       }       
+       
+       if(type == WIFI_RTL8723BS_VQ0) {
+           count = sprintf(_buf, "%s", "RTL8723BS_VQ0");
+           printk("Current WiFi chip is RTL8723BS_VQ0.\n");
+       }               
+       
+       if(type == WIFI_RTL8723BU) {
+           count = sprintf(_buf, "%s", "RTL8723BU");
+           printk("Current WiFi chip is RTL8723BU.\n");
+       }
+
+       if(type == WIFI_RTL8723AU) {
+           count = sprintf(_buf, "%s", "RTL8723AU");
+           printk("Current WiFi chip is RTL8723AU.\n");
+       }                                                       
+
+       if(type == WIFI_RTL8189ES) {
+           count = sprintf(_buf, "%s", "RTL8189ES");
+           printk("Current WiFi chip is RTL8189ES.\n");
+       }       
+
+       if(type == WIFI_ESP8089) {
+           count = sprintf(_buf, "%s", "ESP8089");
+           printk("Current WiFi chip is ESP8089.\n");
+       }
 
     return count;
 }
@@ -197,25 +144,25 @@ static int wifi_init_exit_module(int enable)
 {
     int ret = 0;
     int type = get_wifi_chip_type();
-#ifdef CONFIG_RKWIFI
-    if (type == WIFI_BCMWIFI) {
+//#ifdef CONFIG_RKWIFI
+    if (type < WIFI_AP6XXX_SERIES) {
         if (enable > 0)
             ret = rockchip_wifi_init_module_rkwifi();
         else
             rockchip_wifi_exit_module_rkwifi();
         return ret;
     }
-#endif
-#ifdef CONFIG_RTL_WIRELESS_SOLUTION
-    if (type == WIFI_RTKWIFI) {
+//#endif
+//#ifdef CONFIG_RTL_WIRELESS_SOLUTION
+    if (type < WIFI_RTL_SERIES) {
         if (enable > 0) 
             ret = rockchip_wifi_init_module_rtkwifi();
         else
             rockchip_wifi_exit_module_rtkwifi();
         return ret;
     }
-#endif
-#ifdef CONFIG_ESP8089
+//#endif
+//#ifdef CONFIG_ESP8089
     if (type == WIFI_ESP8089) {
         if (enable > 0)  
             ret = rockchip_wifi_init_module_esp8089();
@@ -223,16 +170,7 @@ static int wifi_init_exit_module(int enable)
             rockchip_wifi_exit_module_esp8089();
         return ret;
     }
-#endif
-
-#if !defined(CONFIG_RKWIFI) && !defined(CONFIG_RTL_WIRELESS_SOLUTION) && !defined(CONFIG_ESP8089)
-    if (type >= 0) {
-        if (enable > 0)
-            ret = rockchip_wifi_init_module();
-        else
-            rockchip_wifi_exit_module();
-    }
-#endif
+//#endif
 
     return ret;
 }
index 17257c9cb14b1e95ed0d4e1ce48973657ede939c..e891d7b9cd76baa8376ca57acc1199df63b1f251 100755 (executable)
@@ -42,8 +42,27 @@ struct rksdmmc_gpio_wifi_moudle {
 };
 
 enum {
-    WIFI_BCMWIFI,
-    WIFI_RTKWIFI,
+    WIFI_RK901,
+    WIFI_RK903,
+    WIFI_AP6181,
+    WIFI_AP6210,
+    WIFI_AP6234,
+    WIFI_AP6330,
+    WIFI_AP6335,
+    WIFI_AP6441,
+    WIFI_AP6476,
+    WIFI_AP6493,
+    WIFI_AP6XXX_SERIES,
+    WIFI_RTL8188EU,
+    WIFI_RTL8192DU,
+    WIFI_RTL8723AS,
+    WIFI_RTL8723BS,
+    WIFI_RTL8723BS_VQ0,
+    WIFI_RTL8723BU,
+    WIFI_RTL8723AU,
+    WIFI_RTL8189ES,
+    WIFI_RTL8812AU,
+    WIFI_RTL_SERIES,
     WIFI_ESP8089,
     TYPE_MAX,
 };
index 6cf15eb72b1936a291b8416c57830a586e083649..ff5dd1620ee66677546b6740888d6edcf82a4ca2 100755 (executable)
@@ -97,14 +97,48 @@ static char wifi_chip_type_string[64];
 int get_wifi_chip_type(void)
 {
     int type;
-    if (strcmp(wifi_chip_type_string, "bcmwifi") == 0) {
-        type = WIFI_BCMWIFI;
-    } else if (strcmp(wifi_chip_type_string, "rtkwifi") == 0) {
-        type = WIFI_RTKWIFI;
+    if (strcmp(wifi_chip_type_string, "ap6210") == 0) {
+        type = WIFI_AP6210;
+    } else if (strcmp(wifi_chip_type_string, "rk901") == 0) {
+        type = WIFI_RK901;    
+    } else if (strcmp(wifi_chip_type_string, "rk903") == 0) {
+        type = WIFI_RK903;  
+    } else if (strcmp(wifi_chip_type_string, "ap6181") == 0) {
+        type = WIFI_AP6181;
+    } else if (strcmp(wifi_chip_type_string, "ap6234") == 0) {
+        type = WIFI_AP6234;                            
+    } else if (strcmp(wifi_chip_type_string, "ap6330") == 0) {
+        type = WIFI_AP6330;
+    } else if (strcmp(wifi_chip_type_string, "ap6335") == 0) {
+        type = WIFI_AP6335;
+    } else if (strcmp(wifi_chip_type_string, "ap6441") == 0) {
+        type = WIFI_AP6441;
+    } else if (strcmp(wifi_chip_type_string, "ap6476") == 0) {
+        type = WIFI_AP6476;    
+    } else if (strcmp(wifi_chip_type_string, "ap6493") == 0) {
+        type = WIFI_AP6493;                    
+    } else if (strcmp(wifi_chip_type_string, "rtl8188eu") == 0) {
+        type = WIFI_RTL8188EU;
+    } else if (strcmp(wifi_chip_type_string, "rtl8192du") == 0) {
+        type = WIFI_RTL8192DU;
+    } else if (strcmp(wifi_chip_type_string, "rtl8723as") == 0) {
+        type = WIFI_RTL8723AS;        
+    } else if (strcmp(wifi_chip_type_string, "rtl8723bs_vq0") == 0) {
+        type = WIFI_RTL8723BS_VQ0;        
+    } else if (strcmp(wifi_chip_type_string, "rtl8723bs") == 0) {
+        type = WIFI_RTL8723BS;
+    } else if (strcmp(wifi_chip_type_string, "rtl8723au") == 0) {
+        type = WIFI_RTL8723AU;        
+    } else if (strcmp(wifi_chip_type_string, "rtl8723bu") == 0) {
+        type = WIFI_RTL8723BU;
+    } else if (strcmp(wifi_chip_type_string, "rtl8189es") == 0) {
+        type = WIFI_RTL8189ES;
+    } else if (strcmp(wifi_chip_type_string, "rtl8812au") == 0) {
+        type = WIFI_RTL8812AU;                        
     } else if (strcmp(wifi_chip_type_string, "esp8089") == 0) {
         type = WIFI_ESP8089;
     } else {
-        type = TYPE_MAX;
+        type = WIFI_AP6210;
     }
     return type;
 }
@@ -115,7 +149,7 @@ EXPORT_SYMBOL(get_wifi_chip_type);
  * Broadcom Wifi Static Memory
  * 
  **********************************************************/
-#ifdef CONFIG_RKWIFI
+#if 0//def CONFIG_RKWIFI
 #define BCM_STATIC_MEMORY_SUPPORT 1
 #else
 #define BCM_STATIC_MEMORY_SUPPORT 0
@@ -450,7 +484,8 @@ int rockchip_wifi_set_carddetect(int val)
        chip = get_wifi_chip_type();
 
        /*  irq_type : 0, oob; 1, cap-sdio-irq */
-       if (chip == WIFI_BCMWIFI)
+       if (!strncmp(wifi_chip_type_string, "ap", 2) ||
+               !strncmp(wifi_chip_type_string, "rk", 2))
                irq_type = 0;
        else
                irq_type = 1;