From 181d1dff582a10c0af2adf9f5f06ac17dbdeae8a Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Thu, 3 Mar 2011 22:41:53 +0900 Subject: [PATCH] staging: rtl8192e: Move RfOffReason to r8192e_priv struct Signed-off-by: Mike McCormack Signed-off-by: Greg Kroah-Hartman --- .../staging/rtl8192e/ieee80211/ieee80211.h | 1 - drivers/staging/rtl8192e/r8190_rtl8256.c | 18 +++++++------- drivers/staging/rtl8192e/r8192E.h | 1 + drivers/staging/rtl8192e/r8192E_core.c | 24 +++++++++---------- drivers/staging/rtl8192e/r8192E_wx.c | 4 ++-- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211.h b/drivers/staging/rtl8192e/ieee80211/ieee80211.h index 8d2b5758d32f..f0627b1fd964 100644 --- a/drivers/staging/rtl8192e/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192e/ieee80211/ieee80211.h @@ -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 diff --git a/drivers/staging/rtl8192e/r8190_rtl8256.c b/drivers/staging/rtl8192e/r8190_rtl8256.c index 14d62bfc3455..ed45bcdb8367 100644 --- a/drivers/staging/rtl8192e/r8190_rtl8256.c +++ b/drivers/staging/rtl8192e/r8190_rtl8256.c @@ -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 diff --git a/drivers/staging/rtl8192e/r8192E.h b/drivers/staging/rtl8192e/r8192E.h index 59cdfc7cce5c..a5c85e5e972e 100644 --- a/drivers/staging/rtl8192e/r8192E.h +++ b/drivers/staging/rtl8192e/r8192E.h @@ -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]; diff --git a/drivers/staging/rtl8192e/r8192E_core.c b/drivers/staging/rtl8192e/r8192E_core.c index 5e25353dbc53..9b40168cd2dd 100644 --- a/drivers/staging/rtl8192e/r8192E_core.c +++ b/drivers/staging/rtl8192e/r8192E_core.c @@ -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); diff --git a/drivers/staging/rtl8192e/r8192E_wx.c b/drivers/staging/rtl8192e/r8192E_wx.c index 280a1b720c34..cf6e231d5600 100644 --- a/drivers/staging/rtl8192e/r8192E_wx.c +++ b/drivers/staging/rtl8192e/r8192E_wx.c @@ -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); -- 2.20.1