From 8cb23d8f915a5871ecb2ff673ebb46368955246d Mon Sep 17 00:00:00 2001 From: kimocoder Date: Tue, 2 May 2023 01:28:48 +0200 Subject: [PATCH] Remove dead code associated with CONFIG_PLATFORM_INTEL_BYT --- Makefile | 1 - core/rtw_ieee80211.c | 38 -------------------- include/rtw_android.h | 5 --- os_dep/linux/ioctl_cfg80211.c | 1 - os_dep/linux/os_intfs.c | 68 ----------------------------------- os_dep/linux/rtw_android.c | 31 ---------------- 6 files changed, 144 deletions(-) diff --git a/Makefile b/Makefile index d41abc6..9141683 100755 --- a/Makefile +++ b/Makefile @@ -869,7 +869,6 @@ endif ifeq ($(CONFIG_PLATFORM_ANDROID_INTEL_X86), y) EXTRA_CFLAGS += -DCONFIG_PLATFORM_ANDROID_INTEL_X86 -EXTRA_CFLAGS += -DCONFIG_PLATFORM_INTEL_BYT EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT diff --git a/core/rtw_ieee80211.c b/core/rtw_ieee80211.c index 94e3d59..01bf7ff 100644 --- a/core/rtw_ieee80211.c +++ b/core/rtw_ieee80211.c @@ -14,9 +14,6 @@ *****************************************************************************/ #define _IEEE80211_C -#ifdef CONFIG_PLATFORM_INTEL_BYT - #include -#endif #include @@ -1551,35 +1548,6 @@ u8 convert_ip_addr(u8 hch, u8 mch, u8 lch) return (key_char2num(hch) * 100) + (key_char2num(mch) * 10) + key_char2num(lch); } -#ifdef CONFIG_PLATFORM_INTEL_BYT -#define MAC_ADDRESS_LEN 12 - -int rtw_get_mac_addr_intel(unsigned char *buf) -{ - int ret = 0; - int i; - struct file *fp = NULL; - mm_segment_t oldfs; - unsigned char c_mac[MAC_ADDRESS_LEN]; - char fname[] = "/config/wifi/mac.txt"; - int jj, kk; - - RTW_INFO("%s Enter\n", __FUNCTION__); - - ret = rtw_retrieve_from_file(fname, c_mac, MAC_ADDRESS_LEN); - if (ret < MAC_ADDRESS_LEN) - return -1; - - for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 2) - buf[jj] = key_2char2num(c_mac[kk], c_mac[kk + 1]); - - RTW_INFO("%s: read from file mac address: "MAC_FMT"\n", - __FUNCTION__, MAC_ARG(buf)); - - return 0; -} -#endif /* CONFIG_PLATFORM_INTEL_BYT */ - /* * Description: * rtw_check_invalid_mac_address: @@ -1653,12 +1621,6 @@ void rtw_macaddr_cfg(u8 *out, const u8 *hw_mac_addr) goto err_chk; } - /* platform specified */ -#ifdef CONFIG_PLATFORM_INTEL_BYT - if (rtw_get_mac_addr_intel(mac) == 0) - goto err_chk; -#endif - /* Use the mac address stored in the Efuse */ if (hw_mac_addr) { _rtw_memcpy(mac, hw_mac_addr, ETH_ALEN); diff --git a/include/rtw_android.h b/include/rtw_android.h index f9d6b49..9df6246 100644 --- a/include/rtw_android.h +++ b/include/rtw_android.h @@ -103,11 +103,6 @@ static inline void rtw_android_wifictrl_func_del(void) {} #endif /* defined(RTW_ENABLE_WIFI_CONTROL_FUNC) */ #ifdef CONFIG_GPIO_WAKEUP -#ifdef CONFIG_PLATFORM_INTEL_BYT -int wifi_configure_gpio(void); -#endif /* CONFIG_PLATFORM_INTEL_BYT */ void wifi_free_gpio(unsigned int gpio); #endif /* CONFIG_GPIO_WAKEUP */ - - #endif /* __RTW_ANDROID_H__ */ diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 49052fd..d7d9a98 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -10374,7 +10374,6 @@ int rtw_wdev_alloc(_adapter *padapter, struct wiphy *wiphy) pwdev_priv->rssi_monitor_min = 0; #endif - exit: return ret; } diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index 8aa7a21..6d28013 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -734,9 +734,6 @@ MODULE_PARM_DESC(rtw_dynamic_soml_delay, "SOML training delay"); int _netdev_open(struct net_device *pnetdev); int netdev_open(struct net_device *pnetdev); static int netdev_close(struct net_device *pnetdev); -#ifdef CONFIG_PLATFORM_INTEL_BYT -extern int rtw_sdio_set_power(int on); -#endif /* CONFIG_PLATFORM_INTEL_BYT */ #ifdef CONFIG_MCC_MODE /* enable MCC mode or not */ @@ -2704,32 +2701,6 @@ int _netdev_vir_if_open(struct net_device *pnetdev) if (!primary_padapter) goto _netdev_virtual_iface_open_error; -#ifdef CONFIG_PLATFORM_INTEL_BYT - if (padapter->bup == _FALSE) { - u8 mac[ETH_ALEN]; - - /* get mac address from primary_padapter */ - if (primary_padapter->bup == _FALSE) - rtw_macaddr_cfg(adapter_mac_addr(primary_padapter), get_hal_mac_addr(primary_padapter)); - - _rtw_memcpy(mac, adapter_mac_addr(primary_padapter), ETH_ALEN); - - /* - * If the BIT1 is 0, the address is universally administered. - * If it is 1, the address is locally administered - */ - mac[0] |= BIT(1); - - _rtw_memcpy(adapter_mac_addr(padapter), mac, ETH_ALEN); - -#ifdef CONFIG_MI_WITH_MBSSID_CAM - rtw_mbid_camid_alloc(padapter, adapter_mac_addr(padapter)); -#endif - rtw_init_wifidirect_addrs(padapter, adapter_mac_addr(padapter), adapter_mac_addr(padapter)); - dev_addr_set(pnetdev, adapter_mac_addr(padapter)); - } -#endif /*CONFIG_PLATFORM_INTEL_BYT*/ - if (primary_padapter->bup == _FALSE || !rtw_is_hw_init_completed(primary_padapter)) _netdev_open(primary_padapter->pnetdev); @@ -3457,10 +3428,6 @@ int _netdev_open(struct net_device *pnetdev) padapter->netif_up = _TRUE; -#ifdef CONFIG_PLATFORM_INTEL_BYT - rtw_sdio_set_power(1); -#endif /* CONFIG_PLATFORM_INTEL_BYT */ - #ifdef CONFIG_AUTOSUSPEND if (pwrctrlpriv->ps_flag == _TRUE) { padapter->net_closed = _FALSE; @@ -3469,15 +3436,6 @@ int _netdev_open(struct net_device *pnetdev) #endif if (padapter->bup == _FALSE) { -#ifdef CONFIG_PLATFORM_INTEL_BYT - rtw_macaddr_cfg(adapter_mac_addr(padapter), get_hal_mac_addr(padapter)); -#ifdef CONFIG_MI_WITH_MBSSID_CAM - rtw_mbid_camid_alloc(padapter, adapter_mac_addr(padapter)); -#endif - rtw_init_wifidirect_addrs(padapter, adapter_mac_addr(padapter), adapter_mac_addr(padapter)); - dev_addr_set(pnetdev, adapter_mac_addr(padapter)); -#endif /* CONFIG_PLATFORM_INTEL_BYT */ - rtw_clr_surprise_removed(padapter); rtw_clr_drv_stopped(padapter); @@ -3520,11 +3478,6 @@ int _netdev_open(struct net_device *pnetdev) padapter->bup = _TRUE; pwrctrlpriv->bips_processing = _FALSE; -#ifdef CONFIG_PLATFORM_INTEL_BYT -#ifdef CONFIG_BT_COEXIST - rtw_btcoex_IpsNotify(padapter, IPS_NONE); -#endif /* CONFIG_BT_COEXIST */ -#endif /* CONFIG_PLATFORM_INTEL_BYT */ } padapter->net_closed = _FALSE; @@ -3863,7 +3816,6 @@ static int netdev_close(struct net_device *pnetdev) #endif /* CONFIG_BT_COEXIST_SOCKET_TRX */ RTW_INFO(FUNC_NDEV_FMT" , bup=%d\n", FUNC_NDEV_ARG(pnetdev), padapter->bup); -#ifndef CONFIG_PLATFORM_INTEL_BYT #ifdef CONFIG_AUTOSUSPEND if (pwrctl->bInternalAutoSuspend == _TRUE) { /* rtw_pwr_wakeup(padapter); */ @@ -3936,26 +3888,6 @@ static int netdev_close(struct net_device *pnetdev) else RTW_INFO("CONFIG_BT_COEXIST: VIRTUAL_ADAPTER\n"); #endif /* CONFIG_BT_COEXIST_SOCKET_TRX */ -#else /* !CONFIG_PLATFORM_INTEL_BYT */ - - if (pwrctl->bInSuspend == _TRUE) { - RTW_INFO("+871x_drv - drv_close, bInSuspend=%d\n", pwrctl->bInSuspend); - return 0; - } - - rtw_scan_abort(padapter); /* stop scanning process before wifi is going to down */ -#ifdef CONFIG_IOCTL_CFG80211 - rtw_cfg80211_wait_scan_req_empty(padapter, 200); -#endif - - RTW_INFO("netdev_close, bips_processing=%d\n", pwrctl->bips_processing); - while (pwrctl->bips_processing == _TRUE) /* waiting for ips_processing done before call rtw_dev_unload() */ - rtw_msleep_os(1); - - rtw_dev_unload(padapter); - rtw_sdio_set_power(0); - -#endif /* !CONFIG_PLATFORM_INTEL_BYT */ RTW_INFO("-871x_drv - drv_close, bup=%d\n", padapter->bup); diff --git a/os_dep/linux/rtw_android.c b/os_dep/linux/rtw_android.c index 65e9797..480ea83 100644 --- a/os_dep/linux/rtw_android.c +++ b/os_dep/linux/rtw_android.c @@ -1113,13 +1113,9 @@ static int wifi_probe(struct platform_device *pdev) (int)wifi_irqres->start, wifi_wake_gpio); if (wifi_wake_gpio > 0) { -#ifdef CONFIG_PLATFORM_INTEL_BYT - wifi_configure_gpio(); -#else /* CONFIG_PLATFORM_INTEL_BYT */ gpio_request(wifi_wake_gpio, "oob_irq"); gpio_direction_input(wifi_wake_gpio); oob_irq = gpio_to_irq(wifi_wake_gpio); -#endif /* CONFIG_PLATFORM_INTEL_BYT */ RTW_INFO("%s oob_irq:%d\n", __func__, oob_irq); } else if (wifi_irqres) { oob_irq = wifi_irqres->start; @@ -1302,34 +1298,7 @@ static void wifi_del_dev(void) #endif /* defined(RTW_ENABLE_WIFI_CONTROL_FUNC) */ #ifdef CONFIG_GPIO_WAKEUP -#ifdef CONFIG_PLATFORM_INTEL_BYT -int wifi_configure_gpio(void) -{ - if (gpio_request(oob_gpio, "oob_irq")) { - RTW_INFO("## %s Cannot request GPIO\n", __FUNCTION__); - return -1; - } - gpio_export(oob_gpio, 0); - if (gpio_direction_input(oob_gpio)) { - RTW_INFO("## %s Cannot set GPIO direction input\n", __FUNCTION__); - return -1; - } - oob_irq = gpio_to_irq(oob_gpio); - if (oob_irq < 0) { - RTW_INFO("## %s Cannot convert GPIO to IRQ\n", __FUNCTION__); - return -1; - } - - RTW_INFO("## %s OOB_IRQ=%d\n", __FUNCTION__, oob_irq); - - return 0; -} -#endif /* CONFIG_PLATFORM_INTEL_BYT */ void wifi_free_gpio(unsigned int gpio) { -#ifdef CONFIG_PLATFORM_INTEL_BYT - if (gpio) - gpio_free(gpio); -#endif /* CONFIG_PLATFORM_INTEL_BYT */ } #endif /* CONFIG_GPIO_WAKEUP */