From: hwg Date: Sat, 28 Feb 2015 06:05:32 +0000 (+0800) Subject: support different wifi bt chip auto compatible X-Git-Tag: firefly_0821_release~4263^2~36 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=7e92f35bdf9a64dcaf127e2170b7abeb79fa8c9b;p=firefly-linux-kernel-4.4.55.git support different wifi bt chip auto compatible like auto recognize rtl8188eu, ap6210, esp8089 in android --- diff --git a/arch/arm/configs/rockchip_defconfig b/arch/arm/configs/rockchip_defconfig old mode 100644 new mode 100755 index 7d88cf9d7bc7..1db7429ec0d5 --- a/arch/arm/configs/rockchip_defconfig +++ b/arch/arm/configs/rockchip_defconfig @@ -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 diff --git a/drivers/mmc/host/rk_sdmmc.c b/drivers/mmc/host/rk_sdmmc.c index 6b00c666b81a..b7d1175a6c66 100755 --- a/drivers/mmc/host/rk_sdmmc.c +++ b/drivers/mmc/host/rk_sdmmc.c @@ -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; diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig index 94c07fe4a96e..a8b40006b7d7 100755 --- a/drivers/net/wireless/Kconfig +++ b/drivers/net/wireless/Kconfig @@ -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" diff --git a/drivers/net/wireless/rockchip_wlan/esp8089/Kconfig b/drivers/net/wireless/rockchip_wlan/esp8089/Kconfig index f8bdee84eaf6..399189a8362c 100755 --- a/drivers/net/wireless/rockchip_wlan/esp8089/Kconfig +++ b/drivers/net/wireless/rockchip_wlan/esp8089/Kconfig @@ -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 diff --git a/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/Makefile b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/Makefile old mode 100644 new mode 100755 index 1893be4ad7cc..d9e8600c602c --- a/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/Makefile +++ b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/Makefile @@ -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 diff --git a/drivers/net/wireless/rockchip_wlan/rkwifi/rk_wifi_config.c b/drivers/net/wireless/rockchip_wlan/rkwifi/rk_wifi_config.c old mode 100644 new mode 100755 index 67ac0f887196..dce8eb14b396 --- a/drivers/net/wireless/rockchip_wlan/rkwifi/rk_wifi_config.c +++ b/drivers/net/wireless/rockchip_wlan/rkwifi/rk_wifi_config.c @@ -10,6 +10,7 @@ */ #include #include +#include /* * Set Firmware Path @@ -17,22 +18,20 @@ #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"); diff --git a/drivers/net/wireless/rockchip_wlan/rtl8188eu/Kconfig b/drivers/net/wireless/rockchip_wlan/rtl8188eu/Kconfig index 013175c374b2..c8148ed9fc43 100755 --- a/drivers/net/wireless/rockchip_wlan/rtl8188eu/Kconfig +++ b/drivers/net/wireless/rockchip_wlan/rtl8188eu/Kconfig @@ -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 diff --git a/drivers/net/wireless/rockchip_wlan/rtl8189es/Makefile b/drivers/net/wireless/rockchip_wlan/rtl8189es/Makefile index 3d07385a66f1..905d5da1000a 100755 --- a/drivers/net/wireless/rockchip_wlan/rtl8189es/Makefile +++ b/drivers/net/wireless/rockchip_wlan/rtl8189es/Makefile @@ -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) diff --git a/drivers/net/wireless/rockchip_wlan/rtl8189es/os_dep/linux/sdio_intf.c b/drivers/net/wireless/rockchip_wlan/rtl8189es/os_dep/linux/sdio_intf.c index c72e7bc02b81..381e5616b5bc 100755 --- a/drivers/net/wireless/rockchip_wlan/rtl8189es/os_dep/linux/sdio_intf.c +++ b/drivers/net/wireless/rockchip_wlan/rtl8189es/os_dep/linux/sdio_intf.c @@ -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); diff --git a/drivers/net/wireless/rockchip_wlan/rtl8192du/os_dep/linux/usb_intf.c b/drivers/net/wireless/rockchip_wlan/rtl8192du/os_dep/linux/usb_intf.c index 240b6bfa30d5..b38fb8d31521 100644 --- a/drivers/net/wireless/rockchip_wlan/rtl8192du/os_dep/linux/usb_intf.c +++ b/drivers/net/wireless/rockchip_wlan/rtl8192du/os_dep/linux/usb_intf.c @@ -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); diff --git a/drivers/net/wireless/rockchip_wlan/rtl8723au/Makefile b/drivers/net/wireless/rockchip_wlan/rtl8723au/Makefile index 680ad384f724..77d4badb9b41 100755 --- a/drivers/net/wireless/rockchip_wlan/rtl8723au/Makefile +++ b/drivers/net/wireless/rockchip_wlan/rtl8723au/Makefile @@ -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) diff --git a/drivers/net/wireless/rockchip_wlan/rtl8723au/os_dep/linux/usb_intf.c b/drivers/net/wireless/rockchip_wlan/rtl8723au/os_dep/linux/usb_intf.c index 282262b22e38..fd2f2bae67bf 100755 --- a/drivers/net/wireless/rockchip_wlan/rtl8723au/os_dep/linux/usb_intf.c +++ b/drivers/net/wireless/rockchip_wlan/rtl8723au/os_dep/linux/usb_intf.c @@ -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); diff --git a/drivers/net/wireless/rockchip_wlan/rtl8723bs-vq0/os_dep/linux/sdio_intf.c b/drivers/net/wireless/rockchip_wlan/rtl8723bs-vq0/os_dep/linux/sdio_intf.c index 957dc9bcad05..5192bd64c2a2 100755 --- a/drivers/net/wireless/rockchip_wlan/rtl8723bs-vq0/os_dep/linux/sdio_intf.c +++ b/drivers/net/wireless/rockchip_wlan/rtl8723bs-vq0/os_dep/linux/sdio_intf.c @@ -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); diff --git a/drivers/net/wireless/rockchip_wlan/rtl8723bs/Makefile b/drivers/net/wireless/rockchip_wlan/rtl8723bs/Makefile index 8fb5ca2aeeeb..1dbd023aac6b 100755 --- a/drivers/net/wireless/rockchip_wlan/rtl8723bs/Makefile +++ b/drivers/net/wireless/rockchip_wlan/rtl8723bs/Makefile @@ -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) diff --git a/drivers/net/wireless/rockchip_wlan/rtl8723bs/os_dep/linux/sdio_intf.c b/drivers/net/wireless/rockchip_wlan/rtl8723bs/os_dep/linux/sdio_intf.c index 98d873c6faab..3d5fe53a5811 100755 --- a/drivers/net/wireless/rockchip_wlan/rtl8723bs/os_dep/linux/sdio_intf.c +++ b/drivers/net/wireless/rockchip_wlan/rtl8723bs/os_dep/linux/sdio_intf.c @@ -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); diff --git a/drivers/net/wireless/rockchip_wlan/rtl8723bu/os_dep/linux/usb_intf.c b/drivers/net/wireless/rockchip_wlan/rtl8723bu/os_dep/linux/usb_intf.c index b5dbac4d4406..790f9799c365 100755 --- a/drivers/net/wireless/rockchip_wlan/rtl8723bu/os_dep/linux/usb_intf.c +++ b/drivers/net/wireless/rockchip_wlan/rtl8723bu/os_dep/linux/usb_intf.c @@ -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); diff --git a/drivers/net/wireless/rockchip_wlan/rtl8812au/os_dep/linux/usb_intf.c b/drivers/net/wireless/rockchip_wlan/rtl8812au/os_dep/linux/usb_intf.c index 8ac500d46d43..b98005011e90 100755 --- a/drivers/net/wireless/rockchip_wlan/rtl8812au/os_dep/linux/usb_intf.c +++ b/drivers/net/wireless/rockchip_wlan/rtl8812au/os_dep/linux/usb_intf.c @@ -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); diff --git a/drivers/net/wireless/rockchip_wlan/wifi_sys/rkwifi_sys_iface.c b/drivers/net/wireless/rockchip_wlan/wifi_sys/rkwifi_sys_iface.c index 9465a4f7f1af..795d4b8407d0 100755 --- a/drivers/net/wireless/rockchip_wlan/wifi_sys/rkwifi_sys_iface.c +++ b/drivers/net/wireless/rockchip_wlan/wifi_sys/rkwifi_sys_iface.c @@ -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; } diff --git a/include/linux/rfkill-wlan.h b/include/linux/rfkill-wlan.h index 17257c9cb14b..e891d7b9cd76 100755 --- a/include/linux/rfkill-wlan.h +++ b/include/linux/rfkill-wlan.h @@ -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, }; diff --git a/net/rfkill/rfkill-wlan.c b/net/rfkill/rfkill-wlan.c index 6cf15eb72b19..ff5dd1620ee6 100755 --- a/net/rfkill/rfkill-wlan.c +++ b/net/rfkill/rfkill-wlan.c @@ -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;