rtl8188eu: Remove CONFIG_AUTOSUSPEND - not defined

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2013-07-21 20:55:51 -05:00
parent 5175f81cb1
commit 6d47834466
8 changed files with 17 additions and 423 deletions

View file

@ -2294,13 +2294,6 @@ _func_enter_;
psetkeyparm->keyid = (u8)keyid;/* 0~3 */ psetkeyparm->keyid = (u8)keyid;/* 0~3 */
psetkeyparm->set_tx = set_tx; psetkeyparm->set_tx = set_tx;
pmlmepriv->key_mask |= BIT(psetkeyparm->keyid); pmlmepriv->key_mask |= BIT(psetkeyparm->keyid);
#ifdef CONFIG_AUTOSUSPEND
if ( true == adapter->pwrctrlpriv.bInternalAutoSuspend)
{
adapter->pwrctrlpriv.wepkeymask = pmlmepriv->key_mask;
DBG_88E("....AutoSuspend pwrctrlpriv.wepkeymask(%x)\n",adapter->pwrctrlpriv.wepkeymask);
}
#endif
DBG_88E("==> rtw_set_key algorithm(%x),keyid(%x),key_mask(%x)\n",psetkeyparm->algorithm,psetkeyparm->keyid,pmlmepriv->key_mask); DBG_88E("==> rtw_set_key algorithm(%x),keyid(%x),key_mask(%x)\n",psetkeyparm->algorithm,psetkeyparm->keyid,pmlmepriv->key_mask);
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("\n rtw_set_key: psetkeyparm->algorithm=%d psetkeyparm->keyid=(u8)keyid=%d\n",psetkeyparm->algorithm, keyid)); RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("\n rtw_set_key: psetkeyparm->algorithm=%d psetkeyparm->keyid=(u8)keyid=%d\n",psetkeyparm->algorithm, keyid));

View file

@ -125,11 +125,6 @@ int ips_leave(_adapter * padapter)
return result; return result;
} }
#ifdef CONFIG_AUTOSUSPEND
extern void autosuspend_enter(_adapter* padapter);
extern int autoresume_enter(_adapter* padapter);
#endif
static bool rtw_pwr_unassociated_idle(_adapter *adapter) static bool rtw_pwr_unassociated_idle(_adapter *adapter)
{ {
_adapter *buddy = adapter->pbuddy_adapter; _adapter *buddy = adapter->pbuddy_adapter;
@ -197,52 +192,24 @@ void rtw_ps_processor(_adapter*padapter)
/* DBG_88E("==> fw report state(0x%x)\n",rtw_read8(padapter,0x1ca)); */ /* DBG_88E("==> fw report state(0x%x)\n",rtw_read8(padapter,0x1ca)); */
if (padapter->pwrctrlpriv.bHWPwrPindetect) if (padapter->pwrctrlpriv.bHWPwrPindetect)
{ {
#ifdef CONFIG_AUTOSUSPEND rfpwrstate = RfOnOffDetect(padapter);
if (padapter->registrypriv.usbss_enable) DBG_88E("@@@@- #2 %s==> rfstate:%s\n",__func__,(rfpwrstate==rf_on)?"rf_on":"rf_off");
if (rfpwrstate!= pwrpriv->rf_pwrstate)
{ {
if (pwrpriv->rf_pwrstate == rf_on) if (rfpwrstate == rf_off)
{ {
if (padapter->net_closed == true) pwrpriv->change_rfpwrstate = rf_off;
pwrpriv->ps_flag = true; pwrpriv->brfoffbyhw = true;
padapter->bCardDisableWOHSM = true;
rfpwrstate = RfOnOffDetect(padapter); rtw_hw_suspend(padapter );
DBG_88E("@@@@- #1 %s==> rfstate:%s\n",__func__,(rfpwrstate==rf_on)?"rf_on":"rf_off");
if (rfpwrstate!= pwrpriv->rf_pwrstate)
{
if (rfpwrstate == rf_off)
{
pwrpriv->change_rfpwrstate = rf_off;
pwrpriv->bkeepfwalive = true;
pwrpriv->brfoffbyhw = true;
autosuspend_enter(padapter);
}
}
} }
} else
else
#endif /* CONFIG_AUTOSUSPEND */
{
rfpwrstate = RfOnOffDetect(padapter);
DBG_88E("@@@@- #2 %s==> rfstate:%s\n",__func__,(rfpwrstate==rf_on)?"rf_on":"rf_off");
if (rfpwrstate!= pwrpriv->rf_pwrstate)
{ {
if (rfpwrstate == rf_off) pwrpriv->change_rfpwrstate = rf_on;
{ rtw_hw_resume(padapter );
pwrpriv->change_rfpwrstate = rf_off;
pwrpriv->brfoffbyhw = true;
padapter->bCardDisableWOHSM = true;
rtw_hw_suspend(padapter );
}
else
{
pwrpriv->change_rfpwrstate = rf_on;
rtw_hw_resume(padapter );
}
DBG_88E("current rf_pwrstate(%s)\n",(pwrpriv->rf_pwrstate == rf_off)?"rf_off":"rf_on");
} }
DBG_88E("current rf_pwrstate(%s)\n",(pwrpriv->rf_pwrstate == rf_off)?"rf_off":"rf_on");
} }
pwrpriv->pwr_state_check_cnts ++; pwrpriv->pwr_state_check_cnts ++;
} }
@ -256,45 +223,9 @@ void rtw_ps_processor(_adapter*padapter)
if ((pwrpriv->rf_pwrstate == rf_on) && ((pwrpriv->pwr_state_check_cnts%4)==0)) if ((pwrpriv->rf_pwrstate == rf_on) && ((pwrpriv->pwr_state_check_cnts%4)==0))
{ {
DBG_88E("==>%s .fw_state(%x)\n",__func__,get_fwstate(pmlmepriv)); DBG_88E("==>%s .fw_state(%x)\n",__func__,get_fwstate(pmlmepriv));
#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
#else
pwrpriv->change_rfpwrstate = rf_off; pwrpriv->change_rfpwrstate = rf_off;
#endif
#ifdef CONFIG_AUTOSUSPEND
if (padapter->registrypriv.usbss_enable)
{
if (pwrpriv->bHWPwrPindetect)
pwrpriv->bkeepfwalive = true;
if (padapter->net_closed == true) ips_enter(padapter);
pwrpriv->ps_flag = true;
#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
if (true==pwrpriv->bInternalAutoSuspend) {
DBG_88E("<==%s .pwrpriv->bInternalAutoSuspend)(%x)\n",__func__,pwrpriv->bInternalAutoSuspend);
} else {
pwrpriv->change_rfpwrstate = rf_off;
padapter->bCardDisableWOHSM = true;
DBG_88E("<==%s .pwrpriv->bInternalAutoSuspend)(%x) call autosuspend_enter\n",__func__,pwrpriv->bInternalAutoSuspend);
autosuspend_enter(padapter);
}
#else
padapter->bCardDisableWOHSM = true;
autosuspend_enter(padapter);
#endif /* if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND) */
}
else if (pwrpriv->bHWPwrPindetect)
{
}
else
#endif /* CONFIG_AUTOSUSPEND */
{
#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
pwrpriv->change_rfpwrstate = rf_off;
#endif /* defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND) */
ips_enter(padapter);
}
} }
exit: exit:
rtw_set_pwr_state_check_timer(&padapter->pwrctrlpriv); rtw_set_pwr_state_check_timer(&padapter->pwrctrlpriv);
@ -603,23 +534,6 @@ _func_enter_;
p2p_ps_wk_cmd(Adapter, P2P_PS_DISABLE, enqueue); p2p_ps_wk_cmd(Adapter, P2P_PS_DISABLE, enqueue);
rtw_lps_ctrl_wk_cmd(Adapter, LPS_CTRL_LEAVE, enqueue); rtw_lps_ctrl_wk_cmd(Adapter, LPS_CTRL_LEAVE, enqueue);
} else {
if (Adapter->pwrctrlpriv.rf_pwrstate== rf_off)
{
#ifdef CONFIG_AUTOSUSPEND
if (Adapter->registrypriv.usbss_enable)
{
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
usb_disable_autosuspend(adapter_to_dvobj(Adapter)->pusbdev);
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,22) && LINUX_VERSION_CODE<=KERNEL_VERSION(2,6,34))
adapter_to_dvobj(Adapter)->pusbdev->autosuspend_disabled = Adapter->bDisableAutosuspend;/* autosuspend disabled by the user */
#endif
}
else
#endif
{
}
}
} }
_func_exit_; _func_exit_;
@ -646,10 +560,6 @@ _func_enter_;
pwrctrlpriv->bInSuspend = false; pwrctrlpriv->bInSuspend = false;
pwrctrlpriv->bkeepfwalive = false; pwrctrlpriv->bkeepfwalive = false;
#ifdef CONFIG_AUTOSUSPEND
pwrctrlpriv->pwr_state_check_interval = (pwrctrlpriv->bHWPwrPindetect) ?1000:2000;
#endif
pwrctrlpriv->LpsIdleCount = 0; pwrctrlpriv->LpsIdleCount = 0;
if (padapter->registrypriv.mp_mode == 1) if (padapter->registrypriv.mp_mode == 1)
pwrctrlpriv->power_mgnt =PS_MODE_ACTIVE ; pwrctrlpriv->power_mgnt =PS_MODE_ACTIVE ;
@ -745,58 +655,18 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
/* I think this should be check in IPS, LPS, autosuspend functions... */ /* I think this should be check in IPS, LPS, autosuspend functions... */
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
{ {
#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
if (true==pwrpriv->bInternalAutoSuspend){
if (0==pwrpriv->autopm_cnt){
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
if (usb_autopm_get_interface(adapter_to_dvobj(padapter)->pusbintf) < 0)
{
DBG_88E( "can't get autopm:\n");
}
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
usb_autopm_disable(adapter_to_dvobj(padapter)->pusbintf);
#else
usb_autoresume_device(adapter_to_dvobj(padapter)->pusbdev, 1);
#endif
pwrpriv->autopm_cnt++;
}
#endif /* if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND) */
ret = _SUCCESS; ret = _SUCCESS;
goto exit; goto exit;
#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
}
#endif /* if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND) */
} }
if (rf_off == pwrpriv->rf_pwrstate ) if (rf_off == pwrpriv->rf_pwrstate )
{ {
#ifdef CONFIG_AUTOSUSPEND DBG_88E("%s call ips_leave....\n",__func__);
if (pwrpriv->brfoffbyhw==true) if (_FAIL == ips_leave(padapter))
{ {
DBG_88E("hw still in rf_off state ...........\n"); DBG_88E("======> ips_leave fail.............\n");
ret = _FAIL; ret = _FAIL;
goto exit; goto exit;
} }
else if (padapter->registrypriv.usbss_enable)
{
DBG_88E("%s call autoresume_enter....\n",__func__);
if (_FAIL == autoresume_enter(padapter))
{
DBG_88E("======> autoresume fail.............\n");
ret = _FAIL;
goto exit;
}
}
else
#endif
{
DBG_88E("%s call ips_leave....\n",__func__);
if (_FAIL == ips_leave(padapter))
{
DBG_88E("======> ips_leave fail.............\n");
ret = _FAIL;
goto exit;
}
}
} }
/* TODO: the following checking need to be merged... */ /* TODO: the following checking need to be merged... */

View file

@ -3458,19 +3458,6 @@ static void rtl8188eu_init_default_value(_adapter * padapter)
static u8 rtl8188eu_ps_func(PADAPTER Adapter,HAL_INTF_PS_FUNC efunc_id, u8 *val) static u8 rtl8188eu_ps_func(PADAPTER Adapter,HAL_INTF_PS_FUNC efunc_id, u8 *val)
{ {
u8 bResult = true; u8 bResult = true;
switch (efunc_id){
#if defined(CONFIG_AUTOSUSPEND)
case HAL_USB_SELECT_SUSPEND:
{
u8 bfwpoll = *(( u8*)val);
}
break;
#endif /* CONFIG_AUTOSUSPEND */
default:
break;
}
return bResult; return bResult;
} }

View file

@ -330,10 +330,6 @@ struct _ADAPTER{
// The driver will show the current P2P status when the upper application reads it. // The driver will show the current P2P status when the upper application reads it.
u8 bShowGetP2PState; u8 bShowGetP2PState;
#endif #endif
#ifdef CONFIG_AUTOSUSPEND
u8 bDisableAutosuspend;
#endif
_adapter *pbuddy_adapter; _adapter *pbuddy_adapter;
_mutex *hw_init_mutex; _mutex *hw_init_mutex;

View file

@ -70,12 +70,6 @@
#endif #endif
typedef struct urb * PURB; typedef struct urb * PURB;
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,22))
#ifdef CONFIG_USB_SUSPEND
#define CONFIG_AUTOSUSPEND 1
#endif
#endif
typedef struct semaphore _sema; typedef struct semaphore _sema;
typedef spinlock_t _lock; typedef spinlock_t _lock;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))

View file

@ -281,9 +281,6 @@ int ips_leave(_adapter * padapter);
void rtw_ps_processor(_adapter*padapter); void rtw_ps_processor(_adapter*padapter);
#ifdef CONFIG_AUTOSUSPEND
int autoresume_enter(_adapter* padapter);
#endif
rt_rf_power_state RfOnOffDetect( PADAPTER pAdapter ); rt_rf_power_state RfOnOffDetect( PADAPTER pAdapter );
s32 LPS_RF_ON_check(PADAPTER padapter, u32 delay_ms); s32 LPS_RF_ON_check(PADAPTER padapter, u32 delay_ms);

View file

@ -659,9 +659,6 @@ _func_enter_;
registry_par->bAcceptAddbaReq = (u8)rtw_AcceptAddbaReq; registry_par->bAcceptAddbaReq = (u8)rtw_AcceptAddbaReq;
registry_par->antdiv_cfg = (u8)rtw_antdiv_cfg; registry_par->antdiv_cfg = (u8)rtw_antdiv_cfg;
registry_par->antdiv_type = (u8)rtw_antdiv_type; registry_par->antdiv_type = (u8)rtw_antdiv_type;
#ifdef CONFIG_AUTOSUSPEND
registry_par->usbss_enable = (u8)rtw_enusbss;//0:disable,1:enable
#endif
registry_par->hwpdn_mode = (u8)rtw_hwpdn_mode;//0:disable,1:enable,2:by EFUSE config registry_par->hwpdn_mode = (u8)rtw_hwpdn_mode;//0:disable,1:enable,2:by EFUSE config
registry_par->hwpwrp_detect = (u8)rtw_hwpwrp_detect;//0:disable,1:enable registry_par->hwpwrp_detect = (u8)rtw_hwpwrp_detect;//0:disable,1:enable
registry_par->hw_wps_pbc = (u8)rtw_hw_wps_pbc; registry_par->hw_wps_pbc = (u8)rtw_hw_wps_pbc;
@ -997,12 +994,6 @@ u8 rtw_reset_drv_sw(_adapter *padapter)
_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY |_FW_UNDER_LINKING); _clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY |_FW_UNDER_LINKING);
#ifdef CONFIG_AUTOSUSPEND
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,22) && LINUX_VERSION_CODE<=KERNEL_VERSION(2,6,34))
adapter_to_dvobj(padapter)->pusbdev->autosuspend_disabled = 1;//autosuspend disabled by the user
#endif
#endif
rtw_hal_sreset_reset_value(padapter); rtw_hal_sreset_reset_value(padapter);
pwrctrlpriv->pwr_state_check_cnts = 0; pwrctrlpriv->pwr_state_check_cnts = 0;

View file

@ -148,9 +148,6 @@ static struct rtw_usb_drv rtl8188e_usb_drv = {
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22)) #if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22))
.usbdrv.reset_resume = rtw_resume, .usbdrv.reset_resume = rtw_resume,
#endif #endif
#ifdef CONFIG_AUTOSUSPEND
.usbdrv.supports_autosuspend = 1,
#endif
}; };
static struct rtw_usb_drv *usb_drv = &rtl8188e_usb_drv; static struct rtw_usb_drv *usb_drv = &rtl8188e_usb_drv;
@ -640,23 +637,11 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
goto exit; goto exit;
} }
if (pwrpriv->bInternalAutoSuspend )
{
#ifdef CONFIG_AUTOSUSPEND
// The FW command register update must after MAC and FW init ready.
if ((padapter->bFWReady) && ( padapter->pwrctrlpriv.bHWPwrPindetect ) && (padapter->registrypriv.usbss_enable ))
{
u8 bOpen = true;
rtw_interface_ps_func(padapter,HAL_USB_SELECT_SUSPEND,&bOpen);
}
#endif
}
pwrpriv->bInSuspend = true; pwrpriv->bInSuspend = true;
rtw_cancel_all_timer(padapter); rtw_cancel_all_timer(padapter);
LeaveAllPowerSaveMode(padapter); LeaveAllPowerSaveMode(padapter);
_enter_pwrlock(&pwrpriv->lock); _enter_pwrlock(&pwrpriv->lock);
//padapter->net_closed = true;
//s1. //s1.
if (pnetdev) if (pnetdev)
{ {
@ -692,17 +677,10 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
rtw_indicate_disconnect(padapter); rtw_indicate_disconnect(padapter);
//s2-3. //s2-3.
rtw_free_assoc_resources(padapter, 1); rtw_free_assoc_resources(padapter, 1);
#ifdef CONFIG_AUTOSUSPEND
if (!pwrpriv->bInternalAutoSuspend )
#endif
//s2-4. //s2-4.
rtw_free_network_queue(padapter, true); rtw_free_network_queue(padapter, true);
rtw_dev_unload(padapter); rtw_dev_unload(padapter);
#ifdef CONFIG_AUTOSUSPEND
pwrpriv->rf_pwrstate = rf_off;
pwrpriv->bips_processing = false;
#endif
_exit_pwrlock(&pwrpriv->lock); _exit_pwrlock(&pwrpriv->lock);
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
@ -755,25 +733,6 @@ int rtw_resume_process(_adapter *padapter)
} }
_enter_pwrlock(&pwrpriv->lock); _enter_pwrlock(&pwrpriv->lock);
#ifdef CONFIG_BT_COEXIST
#ifdef CONFIG_AUTOSUSPEND
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,32))
DBG_88E("%s...pm_usage_cnt(%d) pwrpriv->bAutoResume=%x. ....\n",__func__,atomic_read(&(adapter_to_dvobj(padapter)->pusbintf->pm_usage_cnt)),pwrpriv->bAutoResume);
pm_cnt=atomic_read(&(adapter_to_dvobj(padapter)->pusbintf->pm_usage_cnt));
#else
DBG_88E("...pm_usage_cnt(%d).....\n", adapter_to_dvobj(padapter)->pusbintf->pm_usage_cnt);
pm_cnt = adapter_to_dvobj(padapter)->pusbintf->pm_usage_cnt;
#endif
DBG_88E("pwrpriv->bAutoResume (%x)\n",pwrpriv->bAutoResume );
if ( true == pwrpriv->bAutoResume ){
pwrpriv->bInternalAutoSuspend = false;
pwrpriv->bAutoResume=false;
DBG_88E("pwrpriv->bAutoResume (%x) pwrpriv->bInternalAutoSuspend(%x)\n",pwrpriv->bAutoResume,pwrpriv->bInternalAutoSuspend );
}
#endif //#ifdef CONFIG_AUTOSUSPEND
#endif //#ifdef CONFIG_BT_COEXIST
rtw_reset_drv_sw(padapter); rtw_reset_drv_sw(padapter);
pwrpriv->bkeepfwalive = false; pwrpriv->bkeepfwalive = false;
@ -784,50 +743,6 @@ int rtw_resume_process(_adapter *padapter)
netif_device_attach(pnetdev); netif_device_attach(pnetdev);
netif_carrier_on(pnetdev); netif_carrier_on(pnetdev);
#ifdef CONFIG_AUTOSUSPEND
if (pwrpriv->bInternalAutoSuspend )
{
#ifdef CONFIG_AUTOSUSPEND
// The FW command register update must after MAC and FW init ready.
if ((padapter->bFWReady) && ( padapter->pwrctrlpriv.bHWPwrPindetect ) && (padapter->registrypriv.usbss_enable ))
{
//rtl8192c_set_FwSelectSuspend_cmd(padapter,false ,500);//note fw to support hw power down ping detect
u8 bOpen = false;
rtw_interface_ps_func(padapter,HAL_USB_SELECT_SUSPEND,&bOpen);
}
#endif
#ifdef CONFIG_BT_COEXIST
DBG_88E("pwrpriv->bAutoResume (%x)\n",pwrpriv->bAutoResume );
if ( true == pwrpriv->bAutoResume ){
pwrpriv->bInternalAutoSuspend = false;
pwrpriv->bAutoResume=false;
DBG_88E("pwrpriv->bAutoResume (%x) pwrpriv->bInternalAutoSuspend(%x)\n",pwrpriv->bAutoResume,pwrpriv->bInternalAutoSuspend );
}
#else //#ifdef CONFIG_BT_COEXIST
pwrpriv->bInternalAutoSuspend = false;
#endif //#ifdef CONFIG_BT_COEXIST
pwrpriv->brfoffbyhw = false;
{
DBG_88E("enc_algorithm(%x),wepkeymask(%x)\n",
padapter->securitypriv.dot11PrivacyAlgrthm,pwrpriv->wepkeymask);
if ( (_WEP40_ == padapter->securitypriv.dot11PrivacyAlgrthm) ||
(_WEP104_ == padapter->securitypriv.dot11PrivacyAlgrthm))
{
sint keyid;
for (keyid=0;keyid<4;keyid++){
if (pwrpriv->wepkeymask & BIT(keyid)) {
if (keyid == padapter->securitypriv.dot11PrivacyKeyIndex)
rtw_set_key(padapter,&padapter->securitypriv, keyid, 1);
else
rtw_set_key(padapter,&padapter->securitypriv, keyid, 0);
}
}
}
}
}
#endif
_exit_pwrlock(&pwrpriv->lock); _exit_pwrlock(&pwrpriv->lock);
if ( padapter->pid[1]!=0) { if ( padapter->pid[1]!=0) {
@ -848,128 +763,6 @@ exit:
return ret; return ret;
} }
#ifdef CONFIG_AUTOSUSPEND
void autosuspend_enter(_adapter* padapter)
{
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
struct dvobj_priv *dvobj = adapter_to_dvobj(padapter);
DBG_88E("==>autosuspend_enter...........\n");
pwrpriv->bInternalAutoSuspend = true;
pwrpriv->bips_processing = true;
if (rf_off == pwrpriv->change_rfpwrstate )
{
#ifndef CONFIG_BT_COEXIST
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
usb_enable_autosuspend(dvobj->pusbdev);
#else
dvobj->pusbdev->autosuspend_disabled = 0;//autosuspend disabled by the user
#endif
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
usb_autopm_put_interface(dvobj->pusbintf);
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
usb_autopm_enable(dvobj->pusbintf);
#else
usb_autosuspend_device(dvobj->pusbdev, 1);
#endif
#else //#ifndef CONFIG_BT_COEXIST
if (1==pwrpriv->autopm_cnt){
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
usb_enable_autosuspend(dvobj->pusbdev);
#else
dvobj->pusbdev->autosuspend_disabled = 0;//autosuspend disabled by the user
#endif
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
usb_autopm_put_interface(dvobj->pusbintf);
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
usb_autopm_enable(dvobj->pusbintf);
#else
usb_autosuspend_device(dvobj->pusbdev, 1);
#endif
pwrpriv->autopm_cnt --;
}
else
DBG_88E("0!=pwrpriv->autopm_cnt[%d] didn't usb_autopm_put_interface\n", pwrpriv->autopm_cnt);
#endif //#ifndef CONFIG_BT_COEXIST
}
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,32))
DBG_88E("...pm_usage_cnt(%d).....\n", atomic_read(&(dvobj->pusbintf->pm_usage_cnt)));
#else
DBG_88E("...pm_usage_cnt(%d).....\n", dvobj->pusbintf->pm_usage_cnt);
#endif
}
int autoresume_enter(_adapter* padapter)
{
int result = _SUCCESS;
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
struct security_priv* psecuritypriv=&(padapter->securitypriv);
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct dvobj_priv *dvobj = adapter_to_dvobj(padapter);
DBG_88E("====> autoresume_enter\n");
if (rf_off == pwrpriv->rf_pwrstate )
{
pwrpriv->ps_flag = false;
#ifndef CONFIG_BT_COEXIST
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
if (usb_autopm_get_interface(dvobj->pusbintf) < 0)
{
DBG_88E( "can't get autopm: %d\n", result);
result = _FAIL;
goto error_exit;
}
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
usb_autopm_disable(dvobj->pusbintf);
#else
usb_autoresume_device(dvobj->pusbdev, 1);
#endif
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,32))
DBG_88E("...pm_usage_cnt(%d).....\n", atomic_read(&(dvobj->pusbintf->pm_usage_cnt)));
#else
DBG_88E("...pm_usage_cnt(%d).....\n", dvobj->pusbintf->pm_usage_cnt);
#endif
#else //#ifndef CONFIG_BT_COEXIST
pwrpriv->bAutoResume=true;
if (0==pwrpriv->autopm_cnt){
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
if (usb_autopm_get_interface(dvobj->pusbintf) < 0)
{
DBG_88E( "can't get autopm: %d\n", result);
result = _FAIL;
goto error_exit;
}
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
usb_autopm_disable(dvobj->pusbintf);
#else
usb_autoresume_device(dvobj->pusbdev, 1);
#endif
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,32))
DBG_88E("...pm_usage_cnt(%d).....\n", atomic_read(&(dvobj->pusbintf->pm_usage_cnt)));
#else
DBG_88E("...pm_usage_cnt(%d).....\n", dvobj->pusbintf->pm_usage_cnt);
#endif
pwrpriv->autopm_cnt++;
}
else
DBG_88E("0!=pwrpriv->autopm_cnt[%d] didn't usb_autopm_get_interface\n",pwrpriv->autopm_cnt);
#endif //#ifndef CONFIG_BT_COEXIST
}
DBG_88E("<==== autoresume_enter\n");
error_exit:
return result;
}
#endif
/* /*
* drv_init() - a device potentially for us * drv_init() - a device potentially for us
* *
@ -1046,33 +839,6 @@ static _adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
#endif #endif
#endif #endif
#ifdef CONFIG_AUTOSUSPEND
if ( padapter->registrypriv.power_mgnt != PS_MODE_ACTIVE )
{
if (padapter->registrypriv.usbss_enable ){ /* autosuspend (2s delay) */
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,38))
dvobj->pusbdev->dev.power.autosuspend_delay = 0 * HZ;//15 * HZ; idle-delay time
#else
dvobj->pusbdev->autosuspend_delay = 0 * HZ;//15 * HZ; idle-delay time
#endif
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
usb_enable_autosuspend(dvobj->pusbdev);
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,22) && LINUX_VERSION_CODE<=KERNEL_VERSION(2,6,34))
padapter->bDisableAutosuspend = dvobj->pusbdev->autosuspend_disabled ;
dvobj->pusbdev->autosuspend_disabled = 0;//autosuspend disabled by the user
#endif
//usb_autopm_get_interface(adapter_to_dvobj(padapter)->pusbintf );//init pm_usage_cnt ,let it start from 1
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,32))
DBG_88E("%s...pm_usage_cnt(%d).....\n",__func__,atomic_read(&(dvobj->pusbintf ->pm_usage_cnt)));
#else
DBG_88E("%s...pm_usage_cnt(%d).....\n",__func__,dvobj->pusbintf ->pm_usage_cnt);
#endif
}
}
#endif
//2012-07-11 Move here to prevent the 8723AS-VAU BT auto suspend influence //2012-07-11 Move here to prevent the 8723AS-VAU BT auto suspend influence
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33)) #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
if (usb_autopm_get_interface(pusb_intf) < 0) if (usb_autopm_get_interface(pusb_intf) < 0)