From 3bfe3630da7088b104c069437770b552b61f5925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= Date: Wed, 25 Nov 2020 07:10:35 +0100 Subject: [PATCH 111/389] 8723cs: Make the driver compile and probe, drop rockchip platform code Signed-off-by: Ondrej Jirman --- drivers/staging/rtl8723cs/Kconfig | 7 ++- drivers/staging/rtl8723cs/Makefile | 22 +++---- .../staging/rtl8723cs/core/rtw_ieee80211.c | 5 +- drivers/staging/rtl8723cs/hal/phydm/phydm.mk | 4 +- .../rtl8723cs/hal/phydm/sd4_phydm_2_kernel.mk | 2 +- .../rtl8723cs/os_dep/linux/sdio_intf.c | 57 +------------------ .../staging/rtl8723cs/platform/platform_ops.c | 4 +- 7 files changed, 26 insertions(+), 75 deletions(-) diff --git a/drivers/staging/rtl8723cs/Kconfig b/drivers/staging/rtl8723cs/Kconfig index 78e5f124ca80..9b2e6ad9dbbc 100644 --- a/drivers/staging/rtl8723cs/Kconfig +++ b/drivers/staging/rtl8723cs/Kconfig @@ -1,5 +1,8 @@ # SPDX-License-Identifier: GPL-2.0 config RTL8723CS - tristate "Realtek 8723C SDIO or SPI WiFi" - ---help--- + tristate "Realtek RTL8723CS SDIO or SPI WiFi driver (2020)" + depends on WLAN && MMC && CFG80211 + select WIRELESS_EXT + select WEXT_PRIV + help Help message of RTL8723CS diff --git a/drivers/staging/rtl8723cs/Makefile b/drivers/staging/rtl8723cs/Makefile index f6a05d0213a6..7105db9b41fe 100644 --- a/drivers/staging/rtl8723cs/Makefile +++ b/drivers/staging/rtl8723cs/Makefile @@ -21,7 +21,7 @@ ifeq ($(GCC_VER_49),1) EXTRA_CFLAGS += -Wno-date-time # Fix compile error && warning on gcc 4.9 and later endif -EXTRA_CFLAGS += -I$(src)/include +EXTRA_CFLAGS += -I$(srctree)/$(src)/include EXTRA_LDFLAGS += --strip-debug @@ -202,7 +202,7 @@ CONFIG_CUSTOMER_HUAWEI_GENERAL = n CONFIG_DRVEXT_MODULE = n -export TopDIR ?= $(src) +export TopDIR ?= $(srctree)/$(src) ########### COMMON ################################# ifeq ($(CONFIG_GSPI_HCI), y) @@ -268,10 +268,10 @@ _HAL_INTFS_FILES := hal/hal_intf.o \ hal/led/hal_$(HCI_NAME)_led.o -EXTRA_CFLAGS += -I$(src)/platform +EXTRA_CFLAGS += -I$(srctree)/$(src)/platform _PLATFORM_FILES := platform/platform_ops.o -EXTRA_CFLAGS += -I$(src)/hal/btc +EXTRA_CFLAGS += -I$(srctree)/$(src)/hal/btc ########### HAL_RTL8188E ################################# ifeq ($(CONFIG_RTL8188E), y) @@ -2331,31 +2331,31 @@ endif ifneq ($(KERNELRELEASE),) ########### this part for *.mk ############################ -include $(src)/hal/phydm/phydm.mk +include $(srctree)/$(src)/hal/phydm/phydm.mk ########### HAL_RTL8822B ################################# ifeq ($(CONFIG_RTL8822B), y) -include $(src)/rtl8822b.mk +include $(srctree)/$(src)/rtl8822b.mk endif ########### HAL_RTL8821C ################################# ifeq ($(CONFIG_RTL8821C), y) -include $(src)/rtl8821c.mk +include $(srctree)/$(src)/rtl8821c.mk endif ########### HAL_RTL8822C ################################# ifeq ($(CONFIG_RTL8822C), y) -include $(src)/rtl8822c.mk +include $(srctree)/$(src)/rtl8822c.mk endif ########### HAL_RTL8814B ################################# ifeq ($(CONFIG_RTL8814B), y) -include $(src)/rtl8814b.mk +include $(srctree)/$(src)/rtl8814b.mk endif ########### HAL_RTL8723F ################################# ifeq ($(CONFIG_RTL8723F), y) -include $(src)/rtl8723f.mk +include $(srctree)/$(src)/rtl8723f.mk endif rtk_core := core/rtw_cmd.o \ @@ -2405,7 +2405,7 @@ ifeq ($(CONFIG_SDIO_HCI), y) rtk_core += core/rtw_sdio.o endif -EXTRA_CFLAGS += -I$(src)/core/crypto +EXTRA_CFLAGS += -I$(srctree)/$(src)/core/crypto rtk_core += \ core/crypto/aes-internal.o \ core/crypto/aes-internal-enc.o \ diff --git a/drivers/staging/rtl8723cs/core/rtw_ieee80211.c b/drivers/staging/rtl8723cs/core/rtw_ieee80211.c index 26d4d4bcff71..d37273216a31 100644 --- a/drivers/staging/rtl8723cs/core/rtw_ieee80211.c +++ b/drivers/staging/rtl8723cs/core/rtw_ieee80211.c @@ -18,7 +18,7 @@ #include #endif #include -#include +#include u8 RTW_WPA_OUI_TYPE[] = { 0x00, 0x50, 0xf2, 1 }; u16 RTW_WPA_VERSION = 1; @@ -1774,11 +1774,12 @@ void rtw_macaddr_cfg(u8 *out, const u8 *hw_mac_addr) _rtw_memcpy(mac, hw_mac_addr, ETH_ALEN); } + /* if (!rockchip_wifi_mac_addr(mac)) { printk("get mac address from flash=[%02x:%02x:%02x:%02x:%02x:%02x]\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); } - + */ err_chk: if (rtw_check_invalid_mac_address(mac, _TRUE) == _TRUE) { #if DEFAULT_RANDOM_MACADDR diff --git a/drivers/staging/rtl8723cs/hal/phydm/phydm.mk b/drivers/staging/rtl8723cs/hal/phydm/phydm.mk index 042db19d26ba..dcf919909781 100644 --- a/drivers/staging/rtl8723cs/hal/phydm/phydm.mk +++ b/drivers/staging/rtl8723cs/hal/phydm/phydm.mk @@ -1,4 +1,4 @@ -EXTRA_CFLAGS += -I$(src)/hal/phydm +EXTRA_CFLAGS += -I$(srctree)/$(src)/hal/phydm _PHYDM_FILES := hal/phydm/phydm_debug.o \ hal/phydm/phydm_antdiv.o\ @@ -245,4 +245,4 @@ _PHYDM_FILES += hal/phydm/$(RTL871X)/halhwimg8723f_bb.o\ hal/phydm/halrf/$(RTL871X)/halrf_dpk_8723f.o\ hal/phydm/halrf/$(RTL871X)/halrf_rfk_init_8723f.o\ hal/phydm/halrf/$(RTL871X)/halhwimg8723f_rf.o -endif \ No newline at end of file +endif diff --git a/drivers/staging/rtl8723cs/hal/phydm/sd4_phydm_2_kernel.mk b/drivers/staging/rtl8723cs/hal/phydm/sd4_phydm_2_kernel.mk index f11c6ac90bf5..09898476eded 100644 --- a/drivers/staging/rtl8723cs/hal/phydm/sd4_phydm_2_kernel.mk +++ b/drivers/staging/rtl8723cs/hal/phydm/sd4_phydm_2_kernel.mk @@ -1,4 +1,4 @@ -EXTRA_CFLAGS += -I$(src)/hal/phydm +EXTRA_CFLAGS += -I$(srctree)/$(src)/hal/phydm _PHYDM_FILES := hal/phydm/phydm_debug.o \ hal/phydm/phydm_interface.o\ diff --git a/drivers/staging/rtl8723cs/os_dep/linux/sdio_intf.c b/drivers/staging/rtl8723cs/os_dep/linux/sdio_intf.c index ac8ef8bce518..23964c5c64ff 100644 --- a/drivers/staging/rtl8723cs/os_dep/linux/sdio_intf.c +++ b/drivers/staging/rtl8723cs/os_dep/linux/sdio_intf.c @@ -1403,58 +1403,5 @@ int rtw_sdio_set_power(int on) } #endif /* CONFIG_PLATFORM_INTEL_BYT */ -#include -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"); - printk("=======================================================\n"); - printk("Realtek 8723CS SDIO WiFi driver (Powered by Rockchip,Ver %s) init.\n", DRIVERVERSION); - - rockchip_wifi_power(1); - rockchip_wifi_set_carddetect(1); - - return rtw_drv_entry(); -} - -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"); - printk("=======================================================\n"); - printk("Realtek 8723CS SDIO WiFi driver (Powered by Rockchip,Ver %s) init.\n", DRIVERVERSION); - - rtw_drv_halt(); - - rockchip_wifi_set_carddetect(0); - rockchip_wifi_power(0); -} -#ifdef CONFIG_WIFI_BUILD_MODULE -module_init(rockchip_wifi_init_module_rtkwifi); -module_exit(rockchip_wifi_exit_module_rtkwifi); -#else -#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 -#endif -//module_init(rtw_drv_entry); -//module_exit(rtw_drv_halt); - +module_init(rtw_drv_entry); +module_exit(rtw_drv_halt); diff --git a/drivers/staging/rtl8723cs/platform/platform_ops.c b/drivers/staging/rtl8723cs/platform/platform_ops.c index c281dcb8f121..de08abc00759 100644 --- a/drivers/staging/rtl8723cs/platform/platform_ops.c +++ b/drivers/staging/rtl8723cs/platform/platform_ops.c @@ -18,13 +18,13 @@ * 0: power on successfully * others: power on failed */ -#include +#include extern unsigned int oob_irq; int platform_wifi_power_on(void) { int ret = 0; - oob_irq = rockchip_wifi_get_oob_irq(); + //oob_irq = rockchip_wifi_get_oob_irq(); return ret; } -- 2.35.3