Commit 181d1dff authored by Mike McCormack's avatar Mike McCormack Committed by Greg Kroah-Hartman

staging: rtl8192e: Move RfOffReason to r8192e_priv struct

Signed-off-by: default avatarMike McCormack <mikem@ring3k.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 4559854d
......@@ -1988,7 +1988,6 @@ struct ieee80211_device {
RT_PS_MODE dot11PowerSaveMode; // Power save mode configured.
bool actscanning;
bool beinretry;
RT_RF_CHANGE_SOURCE RfOffReason;
bool is_set_key;
//11n spec related I wonder if These info structure need to be moved out of ieee80211_device
......
......@@ -645,11 +645,11 @@ MgntActSet_RF_State(
switch(StateToSet)
{
case eRfOn:
priv->ieee80211->RfOffReason &= (~ChangeSource);
priv->RfOffReason &= (~ChangeSource);
if(! priv->ieee80211->RfOffReason)
if (!priv->RfOffReason)
{
priv->ieee80211->RfOffReason = 0;
priv->RfOffReason = 0;
bActionAllowed = true;
......@@ -659,37 +659,37 @@ MgntActSet_RF_State(
}
}
else
RT_TRACE(COMP_POWER, "MgntActSet_RF_State - eRfon reject pMgntInfo->RfOffReason= 0x%x, ChangeSource=0x%X\n", priv->ieee80211->RfOffReason, ChangeSource);
RT_TRACE(COMP_POWER, "MgntActSet_RF_State - eRfon reject pMgntInfo->RfOffReason= 0x%x, ChangeSource=0x%X\n", priv->RfOffReason, ChangeSource);
break;
case eRfOff:
if (priv->ieee80211->RfOffReason > RF_CHANGE_BY_IPS)
if (priv->RfOffReason > RF_CHANGE_BY_IPS)
{
// Disconnect to current BSS when radio off. Asked by QuanTa.
MgntDisconnect(dev, disas_lv_ss);
}
priv->ieee80211->RfOffReason |= ChangeSource;
priv->RfOffReason |= ChangeSource;
bActionAllowed = true;
break;
case eRfSleep:
priv->ieee80211->RfOffReason |= ChangeSource;
priv->RfOffReason |= ChangeSource;
bActionAllowed = true;
break;
}
if (bActionAllowed)
{
RT_TRACE(COMP_POWER, "MgntActSet_RF_State(): Action is allowed.... StateToSet(%d), RfOffReason(%#X)\n", StateToSet, priv->ieee80211->RfOffReason);
RT_TRACE(COMP_POWER, "MgntActSet_RF_State(): Action is allowed.... StateToSet(%d), RfOffReason(%#X)\n", StateToSet, priv->RfOffReason);
// Config HW to the specified mode.
SetRFPowerState8190(dev, StateToSet);
}
else
{
RT_TRACE(COMP_POWER, "MgntActSet_RF_State(): Action is rejected.... StateToSet(%d), ChangeSource(%#X), RfOffReason(%#X)\n", StateToSet, ChangeSource, priv->ieee80211->RfOffReason);
RT_TRACE(COMP_POWER, "MgntActSet_RF_State(): Action is rejected.... StateToSet(%d), ChangeSource(%#X), RfOffReason(%#X)\n", StateToSet, ChangeSource, priv->RfOffReason);
}
// Release RF spinlock
......
......@@ -931,6 +931,7 @@ typedef struct r8192_priv
char CCKPresentAttentuation;
// Use to calculate PWBD.
RT_RF_POWER_STATE eRFPowerState;
RT_RF_CHANGE_SOURCE RfOffReason;
u8 bCckHighPower;
long undecorated_smoothed_pwdb;
long undecorated_smoothed_cck_adc_pwdb[4];
......
......@@ -1946,7 +1946,7 @@ static void rtl8192_init_priv_variable(struct net_device* dev)
priv->bDisableNormalResetCheck = false;
priv->force_reset = false;
//added by amy for power save
priv->ieee80211->RfOffReason = 0;
priv->RfOffReason = 0;
priv->bHwRfOffAction = 0;
priv->ieee80211->PowerSaveControl.bInactivePs = true;
priv->ieee80211->PowerSaveControl.bIPSModeBackup = false;
......@@ -2834,21 +2834,21 @@ static RT_STATUS rtl8192_adapter_start(struct net_device *dev)
#ifdef ENABLE_IPS
{
if(priv->ieee80211->RfOffReason > RF_CHANGE_BY_PS)
if(priv->RfOffReason > RF_CHANGE_BY_PS)
{ // H/W or S/W RF OFF before sleep.
RT_TRACE((COMP_INIT|COMP_RF|COMP_POWER), "%s(): Turn off RF for RfOffReason(%d)\n", __FUNCTION__,priv->ieee80211->RfOffReason);
MgntActSet_RF_State(dev, eRfOff, priv->ieee80211->RfOffReason);
RT_TRACE((COMP_INIT|COMP_RF|COMP_POWER), "%s(): Turn off RF for RfOffReason(%d)\n", __FUNCTION__,priv->RfOffReason);
MgntActSet_RF_State(dev, eRfOff, priv->RfOffReason);
}
else if(priv->ieee80211->RfOffReason >= RF_CHANGE_BY_IPS)
else if(priv->RfOffReason >= RF_CHANGE_BY_IPS)
{ // H/W or S/W RF OFF before sleep.
RT_TRACE((COMP_INIT|COMP_RF|COMP_POWER), "%s(): Turn off RF for RfOffReason(%d)\n", __FUNCTION__,priv->ieee80211->RfOffReason);
MgntActSet_RF_State(dev, eRfOff, priv->ieee80211->RfOffReason);
RT_TRACE((COMP_INIT|COMP_RF|COMP_POWER), "%s(): Turn off RF for RfOffReason(%d)\n", __FUNCTION__, priv->RfOffReason);
MgntActSet_RF_State(dev, eRfOff, priv->RfOffReason);
}
else
{
RT_TRACE((COMP_INIT|COMP_RF|COMP_POWER), "%s(): RF-ON \n",__FUNCTION__);
priv->eRFPowerState = eRfOn;
priv->ieee80211->RfOffReason = 0;
priv->RfOffReason = 0;
}
}
#endif
......@@ -3254,7 +3254,7 @@ IPSLeave(struct net_device *dev)
if (pPSC->bInactivePs)
{
rtState = priv->eRFPowerState;
if (rtState != eRfOn && !pPSC->bSwRfProcessing && priv->ieee80211->RfOffReason <= RF_CHANGE_BY_IPS)
if (rtState != eRfOn && !pPSC->bSwRfProcessing && priv->RfOffReason <= RF_CHANGE_BY_IPS)
{
RT_TRACE(COMP_POWER, "IPSLeave(): Turn on RF.\n");
pPSC->eInactivePowerState = eRfOn;
......@@ -3282,7 +3282,7 @@ void ieee80211_ips_leave_wq(struct net_device *dev)
if(priv->ieee80211->PowerSaveControl.bInactivePs){
if(rtState == eRfOff){
if(priv->ieee80211->RfOffReason > RF_CHANGE_BY_IPS)
if(priv->RfOffReason > RF_CHANGE_BY_IPS)
{
RT_TRACE(COMP_ERR, "%s(): RF is OFF.\n",__FUNCTION__);
return;
......@@ -3479,7 +3479,7 @@ static int _rtl8192_up(struct net_device *dev)
RT_TRACE(COMP_INIT, "start adapter finished\n");
if (priv->eRFPowerState != eRfOn)
MgntActSet_RF_State(dev, eRfOn, priv->ieee80211->RfOffReason);
MgntActSet_RF_State(dev, eRfOn, priv->RfOffReason);
if(priv->ieee80211->state != IEEE80211_LINKED)
ieee80211_softmac_start_protocol(priv->ieee80211);
......@@ -5048,7 +5048,7 @@ void setKey( struct net_device *dev,
rtState = priv->eRFPowerState;
if(priv->ieee80211->PowerSaveControl.bInactivePs){
if(rtState == eRfOff){
if(priv->ieee80211->RfOffReason > RF_CHANGE_BY_IPS)
if(priv->RfOffReason > RF_CHANGE_BY_IPS)
{
RT_TRACE(COMP_ERR, "%s(): RF is OFF.\n",__FUNCTION__);
//up(&priv->wx_sem);
......
......@@ -222,7 +222,7 @@ static int r8192_wx_set_mode(struct net_device *dev, struct iw_request_info *a,
if(priv->ieee80211->PowerSaveControl.bInactivePs){
if(rtState == eRfOff){
if(priv->ieee80211->RfOffReason > RF_CHANGE_BY_IPS)
if(priv->RfOffReason > RF_CHANGE_BY_IPS)
{
RT_TRACE(COMP_ERR, "%s(): RF is OFF.\n",__FUNCTION__);
up(&priv->wx_sem);
......@@ -408,7 +408,7 @@ static int r8192_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
if(priv->ieee80211->state != IEEE80211_LINKED){
if(priv->ieee80211->PowerSaveControl.bInactivePs){
if(rtState == eRfOff){
if(priv->ieee80211->RfOffReason > RF_CHANGE_BY_IPS)
if(priv->RfOffReason > RF_CHANGE_BY_IPS)
{
RT_TRACE(COMP_ERR, "%s(): RF is OFF.\n",__FUNCTION__);
up(&priv->wx_sem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment