staging: rtl8192e: Move RfOffReason to r8192e_priv struct
authorMike McCormack <mikem@ring3k.org>
Thu, 3 Mar 2011 13:41:53 +0000 (22:41 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 7 Mar 2011 21:31:41 +0000 (13:31 -0800)
Signed-off-by: Mike McCormack <mikem@ring3k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/rtl8192e/ieee80211/ieee80211.h
drivers/staging/rtl8192e/r8190_rtl8256.c
drivers/staging/rtl8192e/r8192E.h
drivers/staging/rtl8192e/r8192E_core.c
drivers/staging/rtl8192e/r8192E_wx.c

index 8d2b5758d32f4ecfc323fdd434e28c265900c799..f0627b1fd9649b5a0f1d76a9f74c4345a6bcc527 100644 (file)
@@ -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
 
index 14d62bfc3455c1544590f424ee4092e73d871279..ed45bcdb8367735594a6c952de8c957f60baf13c 100644 (file)
@@ -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
index 59cdfc7cce5cb43fc15fb007bb05a5bc61567942..a5c85e5e972e5605a6c7568aa39a8dc36d016cbd 100644 (file)
@@ -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];
index 5e25353dbc53006b15c3eb375d46978bb5bc3fc2..9b40168cd2dd75b3a5879e490df1d820f2c5b4a7 100644 (file)
@@ -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);
index 280a1b720c34b7c984498f6bc00edbfc475a7a99..cf6e231d5600c244ea62882d9340aa1608cb863f 100644 (file)
@@ -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);