From 4c57c6047a5d9e442601e997648d9d2b157ab07f Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Fri, 12 Jul 2013 10:54:26 -0500 Subject: [PATCH] rtl8188eu: Remove configuration variables *ANDROID* and associated dead code Signed-off-by: Larry Finger --- core/rtw_pwrctrl.c | 56 ++------------------------- include/drv_conf.h | 9 +---- include/osdep_service.h | 2 - include/rtw_pwrctrl.h | 9 +---- os_dep/ioctl_linux.c | 86 +---------------------------------------- os_dep/os_intfs.c | 2 - os_dep/osdep_service.c | 16 +------- os_dep/usb_intf.c | 4 +- 8 files changed, 12 insertions(+), 172 deletions(-) diff --git a/core/rtw_pwrctrl.c b/core/rtw_pwrctrl.c index 95b2b87..9a846f6 100644 --- a/core/rtw_pwrctrl.c +++ b/core/rtw_pwrctrl.c @@ -1275,10 +1275,10 @@ _func_enter_; pwrctrlpriv->rtw_workqueue = create_singlethread_workqueue("rtw_workqueue"); #endif /* CONFIG_RESUME_IN_WORKQUEUE */ - #if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER) + #if defined(CONFIG_HAS_EARLYSUSPEND) pwrctrlpriv->early_suspend.suspend = NULL; rtw_register_early_suspend(pwrctrlpriv); - #endif /* CONFIG_HAS_EARLYSUSPEND || CONFIG_ANDROID_POWER */ + #endif /* CONFIG_HAS_EARLYSUSPEND */ _func_exit_; @@ -1303,9 +1303,9 @@ _func_enter_; #endif - #if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER) + #if defined(CONFIG_HAS_EARLYSUSPEND) rtw_unregister_early_suspend(pwrctrlpriv); - #endif /* CONFIG_HAS_EARLYSUSPEND || CONFIG_ANDROID_POWER */ + #endif /* CONFIG_HAS_EARLYSUSPEND */ _free_pwrlock(&pwrctrlpriv->lock); @@ -1387,54 +1387,6 @@ void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv) } #endif /* CONFIG_HAS_EARLYSUSPEND */ -#ifdef CONFIG_ANDROID_POWER -extern int rtw_resume_process(PADAPTER padapter); -static void rtw_early_suspend(android_early_suspend_t *h) -{ - struct pwrctrl_priv *pwrpriv = container_of(h, struct pwrctrl_priv, early_suspend); - DBG_88E("%s\n",__func__); - - /* jeff: do nothing but set do_late_resume to false */ - pwrpriv->do_late_resume = false; -} - -static void rtw_late_resume(android_early_suspend_t *h) -{ - struct pwrctrl_priv *pwrpriv = container_of(h, struct pwrctrl_priv, early_suspend); - _adapter *adapter = container_of(pwrpriv, _adapter, pwrctrlpriv); - - DBG_88E("%s\n",__func__); - if (pwrpriv->do_late_resume) { - rtw_resume_process(adapter); - pwrpriv->do_late_resume = false; - } -} - -void rtw_register_early_suspend(struct pwrctrl_priv *pwrpriv) -{ - DBG_88E("%s\n", __func__); - - /* jeff: set the early suspend level before blank screen, so we wll do late resume after scree is lit */ - pwrpriv->early_suspend.level = ANDROID_EARLY_SUSPEND_LEVEL_BLANK_SCREEN - 20; - pwrpriv->early_suspend.suspend = rtw_early_suspend; - pwrpriv->early_suspend.resume = rtw_late_resume; - android_register_early_suspend(&pwrpriv->early_suspend); -} - -void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv) -{ - DBG_88E("%s\n", __func__); - - pwrpriv->do_late_resume = false; - - if (pwrpriv->early_suspend.suspend) - android_unregister_early_suspend(&pwrpriv->early_suspend); - - pwrpriv->early_suspend.suspend = NULL; - pwrpriv->early_suspend.resume = NULL; -} -#endif /* CONFIG_ANDROID_POWER */ - u8 rtw_interface_ps_func(_adapter *padapter,HAL_INTF_PS_FUNC efunc_id,u8* val) { u8 bResult = true; diff --git a/include/drv_conf.h b/include/drv_conf.h index be3472c..dd65254 100644 --- a/include/drv_conf.h +++ b/include/drv_conf.h @@ -26,14 +26,9 @@ #undef CONFIG_RESUME_IN_WORKQUEUE #endif -#if defined(CONFIG_ANDROID_POWER) && defined (CONFIG_RESUME_IN_WORKQUEUE) - #warning "You have CONFIG_ANDROID_POWER enabled in your system, we disable CONFIG_RESUME_IN_WORKQUEUE automatically" - #undef CONFIG_RESUME_IN_WORKQUEUE -#endif - #ifdef CONFIG_RESUME_IN_WORKQUEUE //this can be removed, because there is no case for this... - #if !defined( CONFIG_WAKELOCK) && !defined(CONFIG_ANDROID_POWER) - #error "enable CONFIG_RESUME_IN_WORKQUEUE without CONFIG_WAKELOCK or CONFIG_ANDROID_POWER will suffer from the danger of wifi's unfunctionality..." + #if !defined( CONFIG_WAKELOCK) + #error "enable CONFIG_RESUME_IN_WORKQUEUE without CONFIG_WAKELOCK will suffer from the danger of wifi's unfunctionality..." #error "If you still want to enable CONFIG_RESUME_IN_WORKQUEUE in this case, mask this preprossor checking and GOOD LUCK..." #endif #endif diff --git a/include/osdep_service.h b/include/osdep_service.h index d52e368..b4ebe23 100644 --- a/include/osdep_service.h +++ b/include/osdep_service.h @@ -562,8 +562,6 @@ __inline static u32 bitshift(u32 bitmask) // Suspend lock prevent system from going suspend #ifdef CONFIG_WAKELOCK #include -#elif defined(CONFIG_ANDROID_POWER) -#include #endif extern void rtw_suspend_lock_init(void); diff --git a/include/rtw_pwrctrl.h b/include/rtw_pwrctrl.h index 6964b88..48d951b 100644 --- a/include/rtw_pwrctrl.h +++ b/include/rtw_pwrctrl.h @@ -273,11 +273,6 @@ struct pwrctrl_priv u8 do_late_resume; #endif //CONFIG_HAS_EARLYSUSPEND - #ifdef CONFIG_ANDROID_POWER - android_early_suspend_t early_suspend; - u8 do_late_resume; - #endif - #ifdef CONFIG_INTEL_PROXIM u8 stored_power_mgnt; #endif @@ -344,11 +339,11 @@ void LPS_Leave(PADAPTER padapter); void rtw_resume_in_workqueue(struct pwrctrl_priv *pwrpriv); #endif //CONFIG_RESUME_IN_WORKQUEUE -#if defined(CONFIG_HAS_EARLYSUSPEND ) || defined(CONFIG_ANDROID_POWER) +#if defined(CONFIG_HAS_EARLYSUSPEND ) #define rtw_is_earlysuspend_registered(pwrpriv) (pwrpriv)->early_suspend.suspend void rtw_register_early_suspend(struct pwrctrl_priv *pwrpriv); void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv); -#endif //CONFIG_HAS_EARLYSUSPEND || CONFIG_ANDROID_POWER +#endif //CONFIG_HAS_EARLYSUSPEND u8 rtw_interface_ps_func(_adapter *padapter,HAL_INTF_PS_FUNC efunc_id,u8* val); void rtw_set_ips_deny(_adapter *padapter, u32 ms); diff --git a/os_dep/ioctl_linux.c b/os_dep/ioctl_linux.c index dc9b125..10319ba 100644 --- a/os_dep/ioctl_linux.c +++ b/os_dep/ioctl_linux.c @@ -1914,11 +1914,7 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a, } #endif //CONFIG_P2P - wait_status = _FW_UNDER_SURVEY - #ifndef CONFIG_ANDROID - |_FW_UNDER_LINKING - #endif - ; + wait_status = _FW_UNDER_SURVEY | _FW_UNDER_LINKING; while (check_fwstate(pmlmepriv, wait_status) == true) { @@ -2709,7 +2705,6 @@ static int rtw_wx_set_auth(struct net_device *dev, } case IW_AUTH_80211_AUTH_ALG: - #if defined(CONFIG_ANDROID) || 1 /* * It's the starting point of a link layer connection using wpa_supplicant */ @@ -2720,7 +2715,6 @@ static int rtw_wx_set_auth(struct net_device *dev, rtw_indicate_disconnect(padapter); rtw_free_assoc_resources(padapter, 1); } - #endif ret = wpa_set_auth_algs(dev, (u32)param->value); break; case IW_AUTH_WPA_ENABLED: @@ -7809,80 +7803,6 @@ static int rtw_wx_set_priv(struct net_device *dev, goto FREE_EXT; } -#ifdef CONFIG_ANDROID - //DBG_88E("rtw_wx_set_priv: %s req=%s\n", dev->name, ext); - - i = rtw_android_cmdstr_to_num(ext); - - switch (i) { - case ANDROID_WIFI_CMD_START : - indicate_wx_custom_event(padapter, "START"); - break; - case ANDROID_WIFI_CMD_STOP : - indicate_wx_custom_event(padapter, "STOP"); - break; - case ANDROID_WIFI_CMD_RSSI : - { - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); - struct wlan_network *pcur_network = &pmlmepriv->cur_network; - - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { - sprintf(ext, "%s rssi %d", pcur_network->network.Ssid.Ssid, padapter->recvpriv.rssi); - } else { - sprintf(ext, "OK"); - } - } - break; - case ANDROID_WIFI_CMD_LINKSPEED : - { - u16 mbps = rtw_get_cur_max_rate(padapter)/10; - sprintf(ext, "LINKSPEED %d", mbps); - } - break; - case ANDROID_WIFI_CMD_MACADDR : - sprintf(ext, "MACADDR = %pM", (dev->dev_addr)); - break; - case ANDROID_WIFI_CMD_SCAN_ACTIVE : - { - //rtw_set_scan_mode(padapter, SCAN_ACTIVE); - sprintf(ext, "OK"); - } - break; - case ANDROID_WIFI_CMD_SCAN_PASSIVE : - { - //rtw_set_scan_mode(padapter, SCAN_PASSIVE); - sprintf(ext, "OK"); - } - break; - - case ANDROID_WIFI_CMD_COUNTRY : - { - char country_code[10]; - sscanf(ext, "%*s %s", country_code); - rtw_set_country(padapter, country_code); - sprintf(ext, "OK"); - } - break; - default : - #ifdef CONFIG_DEBUG_RTW_WX_SET_PRIV - DBG_88E("%s: %s unknowned req=%s\n", __func__, - dev->name, ext_dbg); - #endif - - sprintf(ext, "OK"); - - } - - if (copy_to_user(dwrq->pointer, ext, min(dwrq->length, (u16)(strlen(ext)+1)))) - ret = -EFAULT; - - #ifdef CONFIG_DEBUG_RTW_WX_SET_PRIV - DBG_88E("%s: %s req=%s rep=%s dwrq->length=%d, strlen(ext)+1=%d\n", __func__, - dev->name, ext_dbg ,ext, dwrq->length, (u16)(strlen(ext)+1)); - #endif -#endif //end of CONFIG_ANDROID - - FREE_EXT: rtw_vmfree(ext, len); @@ -7890,11 +7810,7 @@ FREE_EXT: rtw_vmfree(ext_dbg, len); #endif - //DBG_88E("rtw_wx_set_priv: (SIOCSIWPRIV) %s ret=%d\n", - // dev->name, ret); - return ret; - } static int rtw_pm_set(struct net_device *dev, diff --git a/os_dep/os_intfs.c b/os_dep/os_intfs.c index 129f5bb..fd08841 100644 --- a/os_dep/os_intfs.c +++ b/os_dep/os_intfs.c @@ -1647,7 +1647,6 @@ static int netdev_close(struct net_device *pnetdev) rtw_netif_stop_queue(pnetdev); } -#ifndef CONFIG_ANDROID //s2. LeaveAllPowerSaveMode(padapter); rtw_disassoc_cmd(padapter, 500, false); @@ -1657,7 +1656,6 @@ static int netdev_close(struct net_device *pnetdev) rtw_free_assoc_resources(padapter, 1); //s2-4. rtw_free_network_queue(padapter,true); -#endif // Close LED rtw_led_control(padapter, LED_CTL_POWER_OFF); } diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index 72b139e..9981e20 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -331,18 +331,12 @@ void rtw_yield_os(void) #ifdef CONFIG_WAKELOCK static struct wake_lock rtw_suspend_lock; -#elif defined(CONFIG_ANDROID_POWER) -static android_suspend_lock_t rtw_suspend_lock ={ - .name = RTW_SUSPEND_LOCK_NAME -}; #endif inline void rtw_suspend_lock_init(void) { #ifdef CONFIG_WAKELOCK wake_lock_init(&rtw_suspend_lock, WAKE_LOCK_SUSPEND, RTW_SUSPEND_LOCK_NAME); - #elif defined(CONFIG_ANDROID_POWER) - android_init_suspend_lock(&rtw_suspend_lock); #endif } @@ -350,8 +344,6 @@ inline void rtw_suspend_lock_uninit(void) { #ifdef CONFIG_WAKELOCK wake_lock_destroy(&rtw_suspend_lock); - #elif defined(CONFIG_ANDROID_POWER) - android_uninit_suspend_lock(&rtw_suspend_lock); #endif } @@ -359,11 +351,9 @@ inline void rtw_lock_suspend(void) { #ifdef CONFIG_WAKELOCK wake_lock(&rtw_suspend_lock); - #elif defined(CONFIG_ANDROID_POWER) - android_lock_suspend(&rtw_suspend_lock); #endif - #if defined(CONFIG_WAKELOCK) || defined(CONFIG_ANDROID_POWER) + #if defined(CONFIG_WAKELOCK) //DBG_88E("####%s: suspend_lock_count:%d####\n", __func__, rtw_suspend_lock.stat.count); #endif } @@ -372,8 +362,6 @@ inline void rtw_unlock_suspend(void) { #ifdef CONFIG_WAKELOCK wake_unlock(&rtw_suspend_lock); - #elif defined(CONFIG_ANDROID_POWER) - android_unlock_suspend(&rtw_suspend_lock); #endif } @@ -382,8 +370,6 @@ inline void rtw_lock_suspend_timeout(long timeout) { #ifdef CONFIG_WAKELOCK wake_lock_timeout(&rtw_suspend_lock, timeout); - #elif defined(CONFIG_ANDROID_POWER) - android_lock_suspend_auto_expire(&rtw_suspend_lock, timeout); #endif } #endif //CONFIG_WOWLAN diff --git a/os_dep/usb_intf.c b/os_dep/usb_intf.c index 5efa3d2..136f712 100644 --- a/os_dep/usb_intf.c +++ b/os_dep/usb_intf.c @@ -760,7 +760,7 @@ static int rtw_resume(struct usb_interface *pusb_intf) } else { #ifdef CONFIG_RESUME_IN_WORKQUEUE rtw_resume_in_workqueue(pwrpriv); -#elif defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER) +#elif defined(CONFIG_HAS_EARLYSUSPEND) #ifdef CONFIG_WOWLAN if (rtw_is_earlysuspend_registered(pwrpriv) && !padapter->pwrctrlpriv.wowlan_mode) { @@ -1457,7 +1457,7 @@ _func_enter_; padapter->hw_init_completed = false; }*/ -#if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER) +#if defined(CONFIG_HAS_EARLYSUSPEND) rtw_unregister_early_suspend(&padapter->pwrctrlpriv); #endif