rtl8188eu: Remove configuration variables *ANDROID* and associated dead code

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2013-07-12 10:54:26 -05:00
parent acda213bd2
commit 4c57c6047a
8 changed files with 12 additions and 172 deletions

View file

@ -1275,10 +1275,10 @@ _func_enter_;
pwrctrlpriv->rtw_workqueue = create_singlethread_workqueue("rtw_workqueue"); pwrctrlpriv->rtw_workqueue = create_singlethread_workqueue("rtw_workqueue");
#endif /* CONFIG_RESUME_IN_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; pwrctrlpriv->early_suspend.suspend = NULL;
rtw_register_early_suspend(pwrctrlpriv); rtw_register_early_suspend(pwrctrlpriv);
#endif /* CONFIG_HAS_EARLYSUSPEND || CONFIG_ANDROID_POWER */ #endif /* CONFIG_HAS_EARLYSUSPEND */
_func_exit_; _func_exit_;
@ -1303,9 +1303,9 @@ _func_enter_;
#endif #endif
#if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER) #if defined(CONFIG_HAS_EARLYSUSPEND)
rtw_unregister_early_suspend(pwrctrlpriv); rtw_unregister_early_suspend(pwrctrlpriv);
#endif /* CONFIG_HAS_EARLYSUSPEND || CONFIG_ANDROID_POWER */ #endif /* CONFIG_HAS_EARLYSUSPEND */
_free_pwrlock(&pwrctrlpriv->lock); _free_pwrlock(&pwrctrlpriv->lock);
@ -1387,54 +1387,6 @@ void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv)
} }
#endif /* CONFIG_HAS_EARLYSUSPEND */ #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 rtw_interface_ps_func(_adapter *padapter,HAL_INTF_PS_FUNC efunc_id,u8* val)
{ {
u8 bResult = true; u8 bResult = true;

View file

@ -26,14 +26,9 @@
#undef CONFIG_RESUME_IN_WORKQUEUE #undef CONFIG_RESUME_IN_WORKQUEUE
#endif #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... #ifdef CONFIG_RESUME_IN_WORKQUEUE //this can be removed, because there is no case for this...
#if !defined( CONFIG_WAKELOCK) && !defined(CONFIG_ANDROID_POWER) #if !defined( CONFIG_WAKELOCK)
#error "enable CONFIG_RESUME_IN_WORKQUEUE without CONFIG_WAKELOCK or CONFIG_ANDROID_POWER will suffer from the danger of wifi's unfunctionality..." #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..." #error "If you still want to enable CONFIG_RESUME_IN_WORKQUEUE in this case, mask this preprossor checking and GOOD LUCK..."
#endif #endif
#endif #endif

View file

@ -562,8 +562,6 @@ __inline static u32 bitshift(u32 bitmask)
// Suspend lock prevent system from going suspend // Suspend lock prevent system from going suspend
#ifdef CONFIG_WAKELOCK #ifdef CONFIG_WAKELOCK
#include <linux/wakelock.h> #include <linux/wakelock.h>
#elif defined(CONFIG_ANDROID_POWER)
#include <linux/android_power.h>
#endif #endif
extern void rtw_suspend_lock_init(void); extern void rtw_suspend_lock_init(void);

View file

@ -273,11 +273,6 @@ struct pwrctrl_priv
u8 do_late_resume; u8 do_late_resume;
#endif //CONFIG_HAS_EARLYSUSPEND #endif //CONFIG_HAS_EARLYSUSPEND
#ifdef CONFIG_ANDROID_POWER
android_early_suspend_t early_suspend;
u8 do_late_resume;
#endif
#ifdef CONFIG_INTEL_PROXIM #ifdef CONFIG_INTEL_PROXIM
u8 stored_power_mgnt; u8 stored_power_mgnt;
#endif #endif
@ -344,11 +339,11 @@ void LPS_Leave(PADAPTER padapter);
void rtw_resume_in_workqueue(struct pwrctrl_priv *pwrpriv); void rtw_resume_in_workqueue(struct pwrctrl_priv *pwrpriv);
#endif //CONFIG_RESUME_IN_WORKQUEUE #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 #define rtw_is_earlysuspend_registered(pwrpriv) (pwrpriv)->early_suspend.suspend
void rtw_register_early_suspend(struct pwrctrl_priv *pwrpriv); void rtw_register_early_suspend(struct pwrctrl_priv *pwrpriv);
void rtw_unregister_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); u8 rtw_interface_ps_func(_adapter *padapter,HAL_INTF_PS_FUNC efunc_id,u8* val);
void rtw_set_ips_deny(_adapter *padapter, u32 ms); void rtw_set_ips_deny(_adapter *padapter, u32 ms);

View file

@ -1914,11 +1914,7 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
} }
#endif //CONFIG_P2P #endif //CONFIG_P2P
wait_status = _FW_UNDER_SURVEY wait_status = _FW_UNDER_SURVEY | _FW_UNDER_LINKING;
#ifndef CONFIG_ANDROID
|_FW_UNDER_LINKING
#endif
;
while (check_fwstate(pmlmepriv, wait_status) == true) 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: case IW_AUTH_80211_AUTH_ALG:
#if defined(CONFIG_ANDROID) || 1
/* /*
* It's the starting point of a link layer connection using wpa_supplicant * 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_indicate_disconnect(padapter);
rtw_free_assoc_resources(padapter, 1); rtw_free_assoc_resources(padapter, 1);
} }
#endif
ret = wpa_set_auth_algs(dev, (u32)param->value); ret = wpa_set_auth_algs(dev, (u32)param->value);
break; break;
case IW_AUTH_WPA_ENABLED: case IW_AUTH_WPA_ENABLED:
@ -7809,80 +7803,6 @@ static int rtw_wx_set_priv(struct net_device *dev,
goto FREE_EXT; 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: FREE_EXT:
rtw_vmfree(ext, len); rtw_vmfree(ext, len);
@ -7890,11 +7810,7 @@ FREE_EXT:
rtw_vmfree(ext_dbg, len); rtw_vmfree(ext_dbg, len);
#endif #endif
//DBG_88E("rtw_wx_set_priv: (SIOCSIWPRIV) %s ret=%d\n",
// dev->name, ret);
return ret; return ret;
} }
static int rtw_pm_set(struct net_device *dev, static int rtw_pm_set(struct net_device *dev,

View file

@ -1647,7 +1647,6 @@ static int netdev_close(struct net_device *pnetdev)
rtw_netif_stop_queue(pnetdev); rtw_netif_stop_queue(pnetdev);
} }
#ifndef CONFIG_ANDROID
//s2. //s2.
LeaveAllPowerSaveMode(padapter); LeaveAllPowerSaveMode(padapter);
rtw_disassoc_cmd(padapter, 500, false); rtw_disassoc_cmd(padapter, 500, false);
@ -1657,7 +1656,6 @@ static int netdev_close(struct net_device *pnetdev)
rtw_free_assoc_resources(padapter, 1); rtw_free_assoc_resources(padapter, 1);
//s2-4. //s2-4.
rtw_free_network_queue(padapter,true); rtw_free_network_queue(padapter,true);
#endif
// Close LED // Close LED
rtw_led_control(padapter, LED_CTL_POWER_OFF); rtw_led_control(padapter, LED_CTL_POWER_OFF);
} }

View file

@ -331,18 +331,12 @@ void rtw_yield_os(void)
#ifdef CONFIG_WAKELOCK #ifdef CONFIG_WAKELOCK
static struct wake_lock rtw_suspend_lock; 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 #endif
inline void rtw_suspend_lock_init(void) inline void rtw_suspend_lock_init(void)
{ {
#ifdef CONFIG_WAKELOCK #ifdef CONFIG_WAKELOCK
wake_lock_init(&rtw_suspend_lock, WAKE_LOCK_SUSPEND, RTW_SUSPEND_LOCK_NAME); 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 #endif
} }
@ -350,8 +344,6 @@ inline void rtw_suspend_lock_uninit(void)
{ {
#ifdef CONFIG_WAKELOCK #ifdef CONFIG_WAKELOCK
wake_lock_destroy(&rtw_suspend_lock); wake_lock_destroy(&rtw_suspend_lock);
#elif defined(CONFIG_ANDROID_POWER)
android_uninit_suspend_lock(&rtw_suspend_lock);
#endif #endif
} }
@ -359,11 +351,9 @@ inline void rtw_lock_suspend(void)
{ {
#ifdef CONFIG_WAKELOCK #ifdef CONFIG_WAKELOCK
wake_lock(&rtw_suspend_lock); wake_lock(&rtw_suspend_lock);
#elif defined(CONFIG_ANDROID_POWER)
android_lock_suspend(&rtw_suspend_lock);
#endif #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); //DBG_88E("####%s: suspend_lock_count:%d####\n", __func__, rtw_suspend_lock.stat.count);
#endif #endif
} }
@ -372,8 +362,6 @@ inline void rtw_unlock_suspend(void)
{ {
#ifdef CONFIG_WAKELOCK #ifdef CONFIG_WAKELOCK
wake_unlock(&rtw_suspend_lock); wake_unlock(&rtw_suspend_lock);
#elif defined(CONFIG_ANDROID_POWER)
android_unlock_suspend(&rtw_suspend_lock);
#endif #endif
} }
@ -382,8 +370,6 @@ inline void rtw_lock_suspend_timeout(long timeout)
{ {
#ifdef CONFIG_WAKELOCK #ifdef CONFIG_WAKELOCK
wake_lock_timeout(&rtw_suspend_lock, timeout); wake_lock_timeout(&rtw_suspend_lock, timeout);
#elif defined(CONFIG_ANDROID_POWER)
android_lock_suspend_auto_expire(&rtw_suspend_lock, timeout);
#endif #endif
} }
#endif //CONFIG_WOWLAN #endif //CONFIG_WOWLAN

View file

@ -760,7 +760,7 @@ static int rtw_resume(struct usb_interface *pusb_intf)
} else { } else {
#ifdef CONFIG_RESUME_IN_WORKQUEUE #ifdef CONFIG_RESUME_IN_WORKQUEUE
rtw_resume_in_workqueue(pwrpriv); rtw_resume_in_workqueue(pwrpriv);
#elif defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER) #elif defined(CONFIG_HAS_EARLYSUSPEND)
#ifdef CONFIG_WOWLAN #ifdef CONFIG_WOWLAN
if (rtw_is_earlysuspend_registered(pwrpriv) && if (rtw_is_earlysuspend_registered(pwrpriv) &&
!padapter->pwrctrlpriv.wowlan_mode) { !padapter->pwrctrlpriv.wowlan_mode) {
@ -1457,7 +1457,7 @@ _func_enter_;
padapter->hw_init_completed = false; 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); rtw_unregister_early_suspend(&padapter->pwrctrlpriv);
#endif #endif