diff --git a/Makefile b/Makefile index 44f9e45..6574892 100755 --- a/Makefile +++ b/Makefile @@ -296,7 +296,6 @@ _HAL_INTFS_FILES := hal/hal_intf.o \ EXTRA_CFLAGS += -I$(src)/platform -_PLATFORM_FILES := platform/platform_ops.o EXTRA_CFLAGS += -I$(src)/hal/btc @@ -1358,7 +1357,6 @@ EXTRA_CFLAGS += -DCONFIG_RADIO_WORK ifeq ($(CONFIG_SDIO_HCI), y) EXTRA_CFLAGS += -DCONFIG_PLATFORM_OPS -_PLATFORM_FILES += platform/platform_arm_act_sdio.o endif ARCH := arm @@ -1381,10 +1379,8 @@ EXTRA_CFLAGS += -DCONFIG_RADIO_WORK ifeq ($(CONFIG_USB_HCI), y) EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_TX -_PLATFORM_FILES += platform/platform_ARM_SUNxI_usb.o endif ifeq ($(CONFIG_SDIO_HCI), y) -_PLATFORM_FILES += platform/platform_ARM_SUN50IW1P1_sdio.o endif ARCH := arm64 @@ -1530,7 +1526,6 @@ ifeq ($(CONFIG_PLATFORM_RTK_DMP), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DRTK_DMP_PLATFORM -DCONFIG_WIRELESS_EXT EXTRA_CFLAGS += -DCONFIG_PLATFORM_OPS ifeq ($(CONFIG_USB_HCI), y) -_PLATFORM_FILES += platform/platform_RTK_DMP_usb.o endif ARCH:=mips CROSS_COMPILE:=mipsel-linux- @@ -1725,12 +1720,10 @@ EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT EXTRA_CFLAGS += -DCONFIG_PLATFORM_OPS ifeq ($(CONFIG_USB_HCI), y) EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_TX -_PLATFORM_FILES += platform/platform_ARM_SUNxI_usb.o endif ifeq ($(CONFIG_SDIO_HCI), y) # default setting for A10-EVB mmc0 #EXTRA_CFLAGS += -DCONFIG_WITS_EVB_V13 -_PLATFORM_FILES += platform/platform_ARM_SUNxI_sdio.o endif ARCH := arm @@ -1753,12 +1746,10 @@ EXTRA_CFLAGS += -DCONFIG_QOS_OPTIMIZATION EXTRA_CFLAGS += -DCONFIG_PLATFORM_OPS ifeq ($(CONFIG_USB_HCI), y) EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_TX -_PLATFORM_FILES += platform/platform_ARM_SUNxI_usb.o endif ifeq ($(CONFIG_SDIO_HCI), y) # default setting for A31-EVB mmc0 EXTRA_CFLAGS += -DCONFIG_A31_EVB -_PLATFORM_FILES += platform/platform_ARM_SUNnI_sdio.o endif ARCH := arm @@ -1785,10 +1776,8 @@ EXTRA_CFLAGS += -DCONFIG_QOS_OPTIMIZATION EXTRA_CFLAGS += -DCONFIG_PLATFORM_OPS ifeq ($(CONFIG_USB_HCI), y) EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_TX -_PLATFORM_FILES += platform/platform_ARM_SUNxI_usb.o endif ifeq ($(CONFIG_SDIO_HCI), y) -_PLATFORM_FILES += platform/platform_ARM_SUNnI_sdio.o endif ARCH := arm @@ -1815,10 +1804,8 @@ EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT EXTRA_CFLAGS += -DCONFIG_PLATFORM_OPS ifeq ($(CONFIG_USB_HCI), y) EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_TX -_PLATFORM_FILES += platform/platform_ARM_SUNxI_usb.o endif ifeq ($(CONFIG_SDIO_HCI), y) -_PLATFORM_FILES += platform/platform_ARM_SUNnI_sdio.o endif ARCH := arm @@ -1845,10 +1832,8 @@ EXTRA_CFLAGS += -DCONFIG_RADIO_WORK EXTRA_CFLAGS += -DCONFIG_PLATFORM_OPS ifeq ($(CONFIG_USB_HCI), y) EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_TX -_PLATFORM_FILES += platform/platform_ARM_SUNxI_usb.o endif ifeq ($(CONFIG_SDIO_HCI), y) -_PLATFORM_FILES += platform/platform_ARM_SUNnI_sdio.o endif ARCH := arm @@ -1969,7 +1954,6 @@ EXTRA_CFLAGS += -DSOFTAP_PS_DURATION=50 endif ifeq ($(CONFIG_SDIO_HCI), y) EXTRA_CFLAGS += -DCONFIG_PLATFORM_OPS -_PLATFORM_FILES += platform/platform_sprd_sdio.o endif endif @@ -1985,7 +1969,6 @@ EXTRA_CFLAGS += -DSOFTAP_PS_DURATION=50 endif ifeq ($(CONFIG_SDIO_HCI), y) EXTRA_CFLAGS += -DCONFIG_PLATFORM_OPS -_PLATFORM_FILES += platform/platform_sprd_sdio.o endif endif @@ -1995,7 +1978,6 @@ EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT EXTRA_CFLAGS += -DCONFIG_PLATFORM_OPS ifeq ($(CONFIG_SDIO_HCI), y) -_PLATFORM_FILES += platform/platform_ARM_WMT_sdio.o endif ARCH := arm CROSS_COMPILE := /home/android_sdk/WonderMedia/wm8880-android4.4/toolchain/arm_201103_gcc4.5.2/mybin/arm_1103_le- @@ -2041,7 +2023,6 @@ EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_TX #_PLATFORM_FILES += platform/platform_ARM_SUNxI_usb.o endif ifeq ($(CONFIG_SDIO_HCI), y) -_PLATFORM_FILES += platform/platform_ARM_SUNnI_sdio.o endif ARCH := arm @@ -2173,7 +2154,6 @@ EXTRA_CFLAGS += -DCONFIG_RADIO_WORK ifeq ($(CONFIG_SDIO_HCI), y) EXTRA_CFLAGS += -DCONFIG_PLATFORM_OPS -_PLATFORM_FILES += platform/platform_aml_s905_sdio.o endif ARCH ?= arm64 @@ -2303,7 +2283,6 @@ $(MODULE_NAME)-y += $(_OS_INTFS_FILES) $(MODULE_NAME)-y += $(_HAL_INTFS_FILES) $(MODULE_NAME)-y += $(_PHYDM_FILES) $(MODULE_NAME)-y += $(_BTC_FILES) -$(MODULE_NAME)-y += $(_PLATFORM_FILES) $(MODULE_NAME)-$(CONFIG_MP_INCLUDED) += core/rtw_mp.o diff --git a/core/rtw_cmd.c b/core/rtw_cmd.c index 2205bf2..776c36f 100644 --- a/core/rtw_cmd.c +++ b/core/rtw_cmd.c @@ -3259,7 +3259,7 @@ static void dynamic_update_bcn_check(_adapter *padapter) if (_FALSE != ATOMIC_READ(&pmlmepriv->olbc) && _FALSE != ATOMIC_READ(&pmlmepriv->olbc_ht)) { - + if (rtw_ht_operation_update(padapter) > 0) { update_beacon(padapter, _HT_CAPABILITY_IE_, NULL, _FALSE); update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, _TRUE); diff --git a/hal/rtl8812a/rtl8812a_hal_init.c b/hal/rtl8812a/rtl8812a_hal_init.c index f0521aa..03d8915 100644 --- a/hal/rtl8812a/rtl8812a_hal_init.c +++ b/hal/rtl8812a/rtl8812a_hal_init.c @@ -3392,13 +3392,6 @@ static void read_chip_version_8812a(PADAPTER Adapter) /* value32 = rtw_read32(Adapter, REG_GPIO_OUTSTS); */ pHalData->version_id.ROMVer = 0; /* ROM code version. */ - /* For multi-function consideration. Added by Roger, 2010.10.06. */ - //pHalData->MultiFunc = RT_MULTI_FUNC_NONE; - //value32 = rtw_read32(Adapter, REG_MULTI_FUNC_CTRL); - //pHalData->MultiFunc |= ((value32 & WL_FUNC_EN) ? RT_MULTI_FUNC_WIFI : 0); - //pHalData->MultiFunc |= ((value32 & BT_FUNC_EN) ? RT_MULTI_FUNC_BT : 0); - //pHalData->PolarityCtl = ((value32 & WL_HWPDN_SL) ? RT_POLARITY_HIGH_ACT : RT_POLARITY_LOW_ACT); - rtw_hal_config_rftype(Adapter); #if 1 dump_chip_info(pHalData->version_id); diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index 6bc9fad..9afa510 100644 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -31,7 +31,6 @@ extern int rtw_ht_enable; #endif - #define RTL_IOCTL_WPA_SUPPLICANT (SIOCIWFIRSTPRIV+30) #define SCAN_ITEM_SIZE 768 diff --git a/os_dep/linux/usb_intf.c b/os_dep/linux/usb_intf.c index 43ee15e..ac7ef35 100644 --- a/os_dep/linux/usb_intf.c +++ b/os_dep/linux/usb_intf.c @@ -17,8 +17,6 @@ #include #include -#include - #ifndef CONFIG_USB_HCI #error "CONFIG_USB_HCI shall be on!\n" #endif @@ -1664,7 +1662,6 @@ static int __init rtw_drv_entry(void) RTW_PRINT(DRV_NAME" BT-Coex version = %s\n", BTCOEXVERSION); #endif /* BTCOEXVERSION */ - ret = platform_wifi_power_on(); if (ret != 0) { RTW_INFO("%s: power on failed!!(%d)\n", __FUNCTION__, ret); ret = -1; @@ -1702,8 +1699,6 @@ static void __exit rtw_drv_halt(void) usb_deregister(&usb_drv.usbdrv); - platform_wifi_power_off(); - rtw_suspend_lock_uninit(); rtw_ndev_notifier_unregister(); rtw_inetaddr_notifier_unregister(); diff --git a/platform/platform_ARM_SUN50IW1P1_sdio.c b/platform/platform_ARM_SUN50IW1P1_sdio.c deleted file mode 100644 index 2586455..0000000 --- a/platform/platform_ARM_SUN50IW1P1_sdio.c +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2013 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -/* - * Description: - * This file can be applied to following platforms: - * CONFIG_PLATFORM_ARM_SUN50IW1P1 - */ -#include -#ifdef CONFIG_GPIO_WAKEUP -#include -#endif - -#ifdef CONFIG_MMC -#if defined(CONFIG_PLATFORM_ARM_SUN50IW1P1) -extern void sunxi_mmc_rescan_card(unsigned ids); -extern void sunxi_wlan_set_power(int on); -extern int sunxi_wlan_get_bus_index(void); -extern int sunxi_wlan_get_oob_irq(void); -extern int sunxi_wlan_get_oob_irq_flags(void); -#endif -#ifdef CONFIG_GPIO_WAKEUP -extern unsigned int oob_irq; -#endif -#endif /* CONFIG_MMC */ - -/* - * Return: - * 0: power on successfully - * others: power on failed - */ -int platform_wifi_power_on(void) -{ - int ret = 0; - -#ifdef CONFIG_MMC - { - -#if defined(CONFIG_PLATFORM_ARM_SUN50IW1P1) - int wlan_bus_index = sunxi_wlan_get_bus_index(); - if (wlan_bus_index < 0) - return wlan_bus_index; - - sunxi_wlan_set_power(1); - mdelay(100); - sunxi_mmc_rescan_card(wlan_bus_index); -#endif - RTW_INFO("%s: power up, rescan card.\n", __FUNCTION__); - -#ifdef CONFIG_GPIO_WAKEUP -#if defined(CONFIG_PLATFORM_ARM_SUN50IW1P1) - oob_irq = sunxi_wlan_get_oob_irq(); -#endif -#endif /* CONFIG_GPIO_WAKEUP */ - } -#endif /* CONFIG_MMC */ - - return ret; -} - -void platform_wifi_power_off(void) -{ -#ifdef CONFIG_MMC -#if defined(CONFIG_PLATFORM_ARM_SUN50IW1P1) - int wlan_bus_index = sunxi_wlan_get_bus_index(); - if (wlan_bus_index < 0) - return; - - sunxi_mmc_rescan_card(wlan_bus_index); - mdelay(100); - sunxi_wlan_set_power(0); -#endif - RTW_INFO("%s: remove card, power off.\n", __FUNCTION__); -#endif /* CONFIG_MMC */ -} diff --git a/platform/platform_ARM_SUNnI_sdio.c b/platform/platform_ARM_SUNnI_sdio.c deleted file mode 100644 index 8a52aa9..0000000 --- a/platform/platform_ARM_SUNnI_sdio.c +++ /dev/null @@ -1,130 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2013 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -/* - * Description: - * This file can be applied to following platforms: - * CONFIG_PLATFORM_ARM_SUN6I - * CONFIG_PLATFORM_ARM_SUN7I - * CONFIG_PLATFORM_ARM_SUN8I - */ -#include -#include -#ifdef CONFIG_GPIO_WAKEUP -#include -#endif - -#ifdef CONFIG_MMC -static int sdc_id = -1; -static signed int gpio_eint_wlan = -1; -static u32 eint_wlan_handle = 0; - -#if defined(CONFIG_PLATFORM_ARM_SUN6I) || defined(CONFIG_PLATFORM_ARM_SUN7I) -extern void sw_mci_rescan_card(unsigned id, unsigned insert); -#elif defined(CONFIG_PLATFORM_ARM_SUN8I) -extern void sunxi_mci_rescan_card(unsigned id, unsigned insert); -#endif - -#ifdef CONFIG_PLATFORM_ARM_SUN8I_W5P1 -extern int get_rf_mod_type(void); -#else -extern int wifi_pm_get_mod_type(void); -#endif - -extern void wifi_pm_power(int on); -#ifdef CONFIG_GPIO_WAKEUP -extern unsigned int oob_irq; -#endif -#endif /* CONFIG_MMC */ - -/* - * Return: - * 0: power on successfully - * others: power on failed - */ -int platform_wifi_power_on(void) -{ - int ret = 0; - -#ifdef CONFIG_MMC - { - script_item_u val; - script_item_value_type_e type; - -#ifdef CONFIG_PLATFORM_ARM_SUN8I_W5P1 - unsigned int mod_sel = get_rf_mod_type(); -#else - unsigned int mod_sel = wifi_pm_get_mod_type(); -#endif - - type = script_get_item("wifi_para", "wifi_sdc_id", &val); - if (SCIRPT_ITEM_VALUE_TYPE_INT != type) { - RTW_INFO("get wifi_sdc_id failed\n"); - ret = -1; - } else { - sdc_id = val.val; - RTW_INFO("----- %s sdc_id: %d, mod_sel: %d\n", __FUNCTION__, sdc_id, mod_sel); - -#if defined(CONFIG_PLATFORM_ARM_SUN6I) || defined(CONFIG_PLATFORM_ARM_SUN7I) - sw_mci_rescan_card(sdc_id, 1); -#elif defined(CONFIG_PLATFORM_ARM_SUN8I) - sunxi_mci_rescan_card(sdc_id, 1); -#endif - mdelay(100); - wifi_pm_power(1); - - RTW_INFO("%s: power up, rescan card.\n", __FUNCTION__); - } - -#ifdef CONFIG_GPIO_WAKEUP -#ifdef CONFIG_PLATFORM_ARM_SUN8I_W5P1 - type = script_get_item("wifi_para", "wl_host_wake", &val); -#else -#ifdef CONFIG_RTL8723B - type = script_get_item("wifi_para", "rtl8723bs_wl_host_wake", &val); -#endif -#ifdef CONFIG_RTL8188E - type = script_get_item("wifi_para", "rtl8189es_host_wake", &val); -#endif -#endif /* CONFIG_PLATFORM_ARM_SUN8I_W5P1 */ - if (SCIRPT_ITEM_VALUE_TYPE_PIO != type) { - RTW_INFO("No definition of wake up host PIN\n"); - ret = -1; - } else { - gpio_eint_wlan = val.gpio.gpio; -#ifdef CONFIG_PLATFORM_ARM_SUN8I - oob_irq = gpio_to_irq(gpio_eint_wlan); -#endif - } -#endif /* CONFIG_GPIO_WAKEUP */ - } -#endif /* CONFIG_MMC */ - - return ret; -} - -void platform_wifi_power_off(void) -{ -#ifdef CONFIG_MMC -#if defined(CONFIG_PLATFORM_ARM_SUN6I) || defined(CONFIG_PLATFORM_ARM_SUN7I) - sw_mci_rescan_card(sdc_id, 0); -#elif defined(CONFIG_PLATFORM_ARM_SUN8I) - sunxi_mci_rescan_card(sdc_id, 0); -#endif - mdelay(100); - wifi_pm_power(0); - - RTW_INFO("%s: remove card, power off.\n", __FUNCTION__); -#endif /* CONFIG_MMC */ -} diff --git a/platform/platform_ARM_SUNxI_sdio.c b/platform/platform_ARM_SUNxI_sdio.c deleted file mode 100644 index 795b7e7..0000000 --- a/platform/platform_ARM_SUNxI_sdio.c +++ /dev/null @@ -1,90 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2013 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -#include - -#ifdef CONFIG_MMC_SUNXI_POWER_CONTROL -#ifdef CONFIG_WITS_EVB_V13 - #define SDIOID 0 -#else /* !CONFIG_WITS_EVB_V13 */ - #define SDIOID (CONFIG_CHIP_ID == 1123 ? 3 : 1) -#endif /* !CONFIG_WITS_EVB_V13 */ - -#define SUNXI_SDIO_WIFI_NUM_RTL8189ES 10 -extern void sunximmc_rescan_card(unsigned id, unsigned insert); -extern int mmc_pm_get_mod_type(void); -extern int mmc_pm_gpio_ctrl(char *name, int level); -/* - * rtl8189es_shdn = port:PH09<1><0> - * rtl8189es_wakeup = port:PH10<1><1> - * rtl8189es_vdd_en = port:PH11<1><0> - * rtl8189es_vcc_en = port:PH12<1><0> - */ - -int rtl8189es_sdio_powerup(void) -{ - mmc_pm_gpio_ctrl("rtl8189es_vdd_en", 1); - udelay(100); - mmc_pm_gpio_ctrl("rtl8189es_vcc_en", 1); - udelay(50); - mmc_pm_gpio_ctrl("rtl8189es_shdn", 1); - return 0; -} - -int rtl8189es_sdio_poweroff(void) -{ - mmc_pm_gpio_ctrl("rtl8189es_shdn", 0); - mmc_pm_gpio_ctrl("rtl8189es_vcc_en", 0); - mmc_pm_gpio_ctrl("rtl8189es_vdd_en", 0); - return 0; -} -#endif /* CONFIG_MMC_SUNXI_POWER_CONTROL */ - -/* - * Return: - * 0: power on successfully - * others: power on failed - */ -int platform_wifi_power_on(void) -{ - int ret = 0; -#ifdef CONFIG_MMC_SUNXI_POWER_CONTROL - unsigned int mod_sel = mmc_pm_get_mod_type(); -#endif /* CONFIG_MMC_SUNXI_POWER_CONTROL */ - - -#ifdef CONFIG_MMC_SUNXI_POWER_CONTROL - if (mod_sel == SUNXI_SDIO_WIFI_NUM_RTL8189ES) { - rtl8189es_sdio_powerup(); - sunximmc_rescan_card(SDIOID, 1); - printk("[rtl8189es] %s: power up, rescan card.\n", __FUNCTION__); - } else { - ret = -1; - printk("[rtl8189es] %s: mod_sel = %d is incorrect.\n", __FUNCTION__, mod_sel); - } -#endif /* CONFIG_MMC_SUNXI_POWER_CONTROL */ - - return ret; -} - -void platform_wifi_power_off(void) -{ -#ifdef CONFIG_MMC_SUNXI_POWER_CONTROL - sunximmc_rescan_card(SDIOID, 0); -#ifdef CONFIG_RTL8188E - rtl8189es_sdio_poweroff(); - printk("[rtl8189es] %s: remove card, power off.\n", __FUNCTION__); -#endif /* CONFIG_RTL8188E */ -#endif /* CONFIG_MMC_SUNXI_POWER_CONTROL */ -} diff --git a/platform/platform_ARM_SUNxI_usb.c b/platform/platform_ARM_SUNxI_usb.c deleted file mode 100644 index 9c2abc4..0000000 --- a/platform/platform_ARM_SUNxI_usb.c +++ /dev/null @@ -1,136 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2013 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -/* - * Description: - * This file can be applied to following platforms: - * CONFIG_PLATFORM_ARM_SUNXI Series platform - * - */ - -#include -#include - -#ifdef CONFIG_PLATFORM_ARM_SUNxI -extern int sw_usb_disable_hcd(__u32 usbc_no); -extern int sw_usb_enable_hcd(__u32 usbc_no); -static int usb_wifi_host = 2; -#endif - -#if defined(CONFIG_PLATFORM_ARM_SUN6I) || defined(CONFIG_PLATFORM_ARM_SUN7I) -extern int sw_usb_disable_hcd(__u32 usbc_no); -extern int sw_usb_enable_hcd(__u32 usbc_no); -extern void wifi_pm_power(int on); -static script_item_u item; -#endif - -#ifdef CONFIG_PLATFORM_ARM_SUN8I -extern int sunxi_usb_disable_hcd(__u32 usbc_no); -extern int sunxi_usb_enable_hcd(__u32 usbc_no); -extern void wifi_pm_power(int on); -static script_item_u item; -#endif - - -int platform_wifi_power_on(void) -{ - int ret = 0; - -#ifdef CONFIG_PLATFORM_ARM_SUNxI -#ifndef CONFIG_RTL8723A - { - /* ----------get usb_wifi_usbc_num------------- */ - ret = script_parser_fetch("usb_wifi_para", "usb_wifi_usbc_num", (int *)&usb_wifi_host, 64); - if (ret != 0) { - RTW_INFO("ERR: script_parser_fetch usb_wifi_usbc_num failed\n"); - ret = -ENOMEM; - goto exit; - } - RTW_INFO("sw_usb_enable_hcd: usbc_num = %d\n", usb_wifi_host); - sw_usb_enable_hcd(usb_wifi_host); - } -#endif /* CONFIG_RTL8723A */ -#endif /* CONFIG_PLATFORM_ARM_SUNxI */ - -#if defined(CONFIG_PLATFORM_ARM_SUN6I) || defined(CONFIG_PLATFORM_ARM_SUN7I) - { - script_item_value_type_e type; - - type = script_get_item("wifi_para", "wifi_usbc_id", &item); - if (SCIRPT_ITEM_VALUE_TYPE_INT != type) { - printk("ERR: script_get_item wifi_usbc_id failed\n"); - ret = -ENOMEM; - goto exit; - } - - printk("sw_usb_enable_hcd: usbc_num = %d\n", item.val); - wifi_pm_power(1); - mdelay(10); - -#if !(defined(CONFIG_RTL8723A)) && !(defined(CONFIG_RTL8723B)) - sw_usb_enable_hcd(item.val); -#endif - } -#endif /* defined(CONFIG_PLATFORM_ARM_SUN6I) || defined(CONFIG_PLATFORM_ARM_SUN7I) */ - -#if defined(CONFIG_PLATFORM_ARM_SUN8I) - { - script_item_value_type_e type; - - type = script_get_item("wifi_para", "wifi_usbc_id", &item); - if (SCIRPT_ITEM_VALUE_TYPE_INT != type) { - printk("ERR: script_get_item wifi_usbc_id failed\n"); - ret = -ENOMEM; - goto exit; - } - - printk("sw_usb_enable_hcd: usbc_num = %d\n", item.val); - wifi_pm_power(1); - mdelay(10); - -#if !(defined(CONFIG_RTL8723A)) && !(defined(CONFIG_RTL8723B)) - sunxi_usb_enable_hcd(item.val); -#endif - } -#endif /* CONFIG_PLATFORM_ARM_SUN8I */ - -exit: - return ret; -} - -void platform_wifi_power_off(void) -{ - -#ifdef CONFIG_PLATFORM_ARM_SUNxI -#ifndef CONFIG_RTL8723A - RTW_INFO("sw_usb_disable_hcd: usbc_num = %d\n", usb_wifi_host); - sw_usb_disable_hcd(usb_wifi_host); -#endif /* ifndef CONFIG_RTL8723A */ -#endif /* CONFIG_PLATFORM_ARM_SUNxI */ - -#if defined(CONFIG_PLATFORM_ARM_SUN6I) || defined(CONFIG_PLATFORM_ARM_SUN7I) - #if !(defined(CONFIG_RTL8723A)) && !(defined(CONFIG_RTL8723B)) - sw_usb_disable_hcd(item.val); - #endif - wifi_pm_power(0); -#endif /* defined(CONFIG_PLATFORM_ARM_SUN6I) || defined(CONFIG_PLATFORM_ARM_SUN7I) */ - -#if defined(CONFIG_PLATFORM_ARM_SUN8I) - #if !(defined(CONFIG_RTL8723A)) && !(defined(CONFIG_RTL8723B)) - sunxi_usb_disable_hcd(item.val); - #endif - wifi_pm_power(0); -#endif /* defined(CONFIG_PLATFORM_ARM_SUN8I) */ - -} diff --git a/platform/platform_ARM_WMT_sdio.c b/platform/platform_ARM_WMT_sdio.c deleted file mode 100644 index d85002c..0000000 --- a/platform/platform_ARM_WMT_sdio.c +++ /dev/null @@ -1,46 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2013 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -#include -#include -#include - -extern void wmt_detect_sdio2(void); -extern void force_remove_sdio2(void); - -int platform_wifi_power_on(void) -{ - int err = 0; - err = gpio_request(WMT_PIN_GP62_SUSGPIO1, "wifi_chip_en"); - if (err < 0) { - printk("request gpio for rtl8188eu failed!\n"); - return err; - } - gpio_direction_output(WMT_PIN_GP62_SUSGPIO1, 0);/* pull sus_gpio1 to 0 to open vcc_wifi. */ - printk("power on rtl8189.\n"); - msleep(500); - wmt_detect_sdio2(); - printk("[rtl8189es] %s: new card, power on.\n", __FUNCTION__); - return err; -} - -void platform_wifi_power_off(void) -{ - force_remove_sdio2(); - - gpio_direction_output(WMT_PIN_GP62_SUSGPIO1, 1);/* pull sus_gpio1 to 1 to close vcc_wifi. */ - printk("power off rtl8189.\n"); - gpio_free(WMT_PIN_GP62_SUSGPIO1); - printk("[rtl8189es] %s: remove card, power off.\n", __FUNCTION__); -} diff --git a/platform/platform_RTK_DMP_usb.c b/platform/platform_RTK_DMP_usb.c deleted file mode 100644 index cb740b2..0000000 --- a/platform/platform_RTK_DMP_usb.c +++ /dev/null @@ -1,30 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2013 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -#include - -int platform_wifi_power_on(void) -{ - int ret = 0; - u32 tmp; - tmp = readl((volatile unsigned int *)0xb801a608); - tmp &= 0xffffff00; - tmp |= 0x55; - writel(tmp, (volatile unsigned int *)0xb801a608); /* write dummy register for 1055 */ - return ret; -} - -void platform_wifi_power_off(void) -{ -} diff --git a/platform/platform_arm_act_sdio.c b/platform/platform_arm_act_sdio.c deleted file mode 100644 index ad7b6cf..0000000 --- a/platform/platform_arm_act_sdio.c +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2013 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -/* - * Description: - * This file can be applied to following platforms: - * CONFIG_PLATFORM_ACTIONS_ATM703X - */ -#include - -#ifdef CONFIG_PLATFORM_ACTIONS_ATM705X -extern int acts_wifi_init(void); -extern void acts_wifi_cleanup(void); -#endif - -/* - * Return: - * 0: power on successfully - * others: power on failed - */ -int platform_wifi_power_on(void) -{ - int ret = 0; - -#ifdef CONFIG_PLATFORM_ACTIONS_ATM705X - ret = acts_wifi_init(); - if (unlikely(ret < 0)) { - pr_err("%s Failed to register the power control driver.\n", __FUNCTION__); - goto exit; - } -#endif - -exit: - return ret; -} - -void platform_wifi_power_off(void) -{ -#ifdef CONFIG_PLATFORM_ACTIONS_ATM705X - acts_wifi_cleanup(); -#endif -} diff --git a/platform/platform_ops.c b/platform/platform_ops.c deleted file mode 100644 index 10766aa..0000000 --- a/platform/platform_ops.c +++ /dev/null @@ -1,32 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2013 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -#ifndef CONFIG_PLATFORM_OPS -/* - * Return: - * 0: power on successfully - * others: power on failed - */ -int platform_wifi_power_on(void) -{ - int ret = 0; - - - return ret; -} - -void platform_wifi_power_off(void) -{ -} -#endif /* !CONFIG_PLATFORM_OPS */ diff --git a/platform/platform_ops.h b/platform/platform_ops.h deleted file mode 100644 index 12caf3c..0000000 --- a/platform/platform_ops.h +++ /dev/null @@ -1,26 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2013 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -#ifndef __PLATFORM_OPS_H__ -#define __PLATFORM_OPS_H__ - -/* - * Return: - * 0: power on successfully - * others: power on failed - */ -int platform_wifi_power_on(void); -void platform_wifi_power_off(void); - -#endif /* __PLATFORM_OPS_H__ */ diff --git a/platform/platform_sprd_sdio.c b/platform/platform_sprd_sdio.c deleted file mode 100644 index 34061d0..0000000 --- a/platform/platform_sprd_sdio.c +++ /dev/null @@ -1,84 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2013 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -#include - -extern void sdhci_bus_scan(void); -#ifndef ANDROID_2X -extern int sdhci_device_attached(void); -#endif - -/* - * Return: - * 0: power on successfully - * others: power on failed - */ -int platform_wifi_power_on(void) -{ - int ret = 0; - - -#ifdef CONFIG_RTL8188E - rtw_wifi_gpio_wlan_ctrl(WLAN_POWER_ON); -#endif /* CONFIG_RTL8188E */ - - /* Pull up pwd pin, make wifi leave power down mode. */ - rtw_wifi_gpio_init(); - rtw_wifi_gpio_wlan_ctrl(WLAN_PWDN_ON); - -#if (MP_DRIVER == 1) && (defined(CONFIG_RTL8723A) || defined(CONFIG_RTL8723B)) - /* Pull up BT reset pin. */ - rtw_wifi_gpio_wlan_ctrl(WLAN_BT_PWDN_ON); -#endif - rtw_mdelay_os(5); - - sdhci_bus_scan(); -#ifdef CONFIG_RTL8723B - /* YJ,test,130305 */ - rtw_mdelay_os(1000); -#endif -#ifdef ANDROID_2X - rtw_mdelay_os(200); -#else /* !ANDROID_2X */ - if (1) { - int i = 0; - - for (i = 0; i <= 50; i++) { - msleep(10); - if (sdhci_device_attached()) - break; - printk("%s delay times:%d\n", __func__, i); - } - } -#endif /* !ANDROID_2X */ - - return ret; -} - -void platform_wifi_power_off(void) -{ - /* Pull down pwd pin, make wifi enter power down mode. */ - rtw_wifi_gpio_wlan_ctrl(WLAN_PWDN_OFF); - rtw_mdelay_os(5); - rtw_wifi_gpio_deinit(); - -#ifdef CONFIG_RTL8188E - rtw_wifi_gpio_wlan_ctrl(WLAN_POWER_OFF); -#endif /* CONFIG_RTL8188E */ - -#ifdef CONFIG_WOWLAN - if (mmc_host) - mmc_host->pm_flags &= ~MMC_PM_KEEP_POWER; -#endif /* CONFIG_WOWLAN */ -}