Skip to content

Commit

Permalink
staging: rtl8192e: Move eRFPowerState to r8192e_priv struct
Browse files Browse the repository at this point in the history
Signed-off-by: Mike McCormack <mikem@ring3k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Mike McCormack authored and Greg Kroah-Hartman committed Mar 7, 2011
1 parent 477dfe7 commit 4559854
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 31 deletions.
1 change: 0 additions & 1 deletion drivers/staging/rtl8192e/ieee80211/ieee80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -1988,7 +1988,6 @@ struct ieee80211_device {
RT_PS_MODE dot11PowerSaveMode; // Power save mode configured.
bool actscanning;
bool beinretry;
RT_RF_POWER_STATE eRFPowerState;
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
Expand Down
11 changes: 0 additions & 11 deletions drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1420,17 +1420,6 @@ void ieee80211_associate_procedure_wq(struct work_struct *work)
printk("===>%s(), chan:%d\n", __FUNCTION__, ieee->current_network.channel);
HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT);

#ifdef ENABLE_IPS
if(ieee->eRFPowerState == eRfOff)
{
if(ieee->ieee80211_ips_leave_wq != NULL)
ieee->ieee80211_ips_leave_wq(ieee->dev);

up(&ieee->wx_sem);
return;
}
#endif

ieee->associate_seq = 1;
ieee80211_associate_step1(ieee);

Expand Down
10 changes: 5 additions & 5 deletions drivers/staging/rtl8192e/r8190_rtl8256.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ SetRFPowerState8190(struct net_device *dev, RT_RF_POWER_STATE eRFPowerState)
PRT_POWER_SAVE_CONTROL pPSC = (PRT_POWER_SAVE_CONTROL)(&(priv->ieee80211->PowerSaveControl));
bool bResult = true;

if (eRFPowerState == priv->ieee80211->eRFPowerState &&
if (eRFPowerState == priv->eRFPowerState &&
priv->bHwRfOffAction == 0) {
bResult = false;
goto out;
Expand All @@ -338,7 +338,7 @@ SetRFPowerState8190(struct net_device *dev, RT_RF_POWER_STATE eRFPowerState)
case eRfOn:

// turn on RF
if ((priv->ieee80211->eRFPowerState == eRfOff) &&
if ((priv->eRFPowerState == eRfOff) &&
RT_IN_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC))
{
/*
Expand Down Expand Up @@ -384,7 +384,7 @@ SetRFPowerState8190(struct net_device *dev, RT_RF_POWER_STATE eRFPowerState)
case eRfSleep:

// HW setting had been configured with deeper mode.
if(priv->ieee80211->eRFPowerState == eRfOff)
if(priv->eRFPowerState == eRfOff)
break;

r8192e_drain_tx_queues(priv);
Expand Down Expand Up @@ -423,7 +423,7 @@ SetRFPowerState8190(struct net_device *dev, RT_RF_POWER_STATE eRFPowerState)
if(bResult)
{
// Update current RF state variable.
priv->ieee80211->eRFPowerState = eRFPowerState;
priv->eRFPowerState = eRFPowerState;
}

out:
Expand Down Expand Up @@ -640,7 +640,7 @@ MgntActSet_RF_State(

spin_lock(&priv->rf_ps_lock);

rtState = priv->ieee80211->eRFPowerState;
rtState = priv->eRFPowerState;

switch(StateToSet)
{
Expand Down
2 changes: 2 additions & 0 deletions drivers/staging/rtl8192e/r8192E.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <linux/random.h>
#include <linux/version.h>
#include <asm/io.h>
#include "ieee80211/rtl819x_HT.h"
#include "ieee80211/ieee80211.h"


Expand Down Expand Up @@ -929,6 +930,7 @@ typedef struct r8192_priv
char CCKPresentAttentuation_difference;
char CCKPresentAttentuation;
// Use to calculate PWBD.
RT_RF_POWER_STATE eRFPowerState;
u8 bCckHighPower;
long undecorated_smoothed_pwdb;
long undecorated_smoothed_cck_adc_pwdb[4];
Expand Down
18 changes: 9 additions & 9 deletions drivers/staging/rtl8192e/r8192E_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2847,7 +2847,7 @@ static RT_STATUS rtl8192_adapter_start(struct net_device *dev)
else
{
RT_TRACE((COMP_INIT|COMP_RF|COMP_POWER), "%s(): RF-ON \n",__FUNCTION__);
priv->ieee80211->eRFPowerState = eRfOn;
priv->eRFPowerState = eRfOn;
priv->ieee80211->RfOffReason = 0;
}
}
Expand Down Expand Up @@ -3059,7 +3059,7 @@ rtl819x_ifcheck_resetornot(struct net_device *dev)
RESET_TYPE RxResetType = RESET_TYPE_NORESET;
RT_RF_POWER_STATE rfState;

rfState = priv->ieee80211->eRFPowerState;
rfState = priv->eRFPowerState;

if( rfState != eRfOff &&
/*ADAPTER_TEST_STATUS_FLAG(Adapter, ADAPTER_STATUS_FW_DOWNLOAD_FAILURE)) &&*/
Expand Down Expand Up @@ -3218,7 +3218,7 @@ IPSEnter(struct net_device *dev)

if (pPSC->bInactivePs)
{
rtState = priv->ieee80211->eRFPowerState;
rtState = priv->eRFPowerState;
//
// Added by Bruce, 2007-12-25.
// Do not enter IPS in the following conditions:
Expand Down Expand Up @@ -3253,7 +3253,7 @@ IPSLeave(struct net_device *dev)

if (pPSC->bInactivePs)
{
rtState = priv->ieee80211->eRFPowerState;
rtState = priv->eRFPowerState;
if (rtState != eRfOn && !pPSC->bSwRfProcessing && priv->ieee80211->RfOffReason <= RF_CHANGE_BY_IPS)
{
RT_TRACE(COMP_POWER, "IPSLeave(): Turn on RF.\n");
Expand All @@ -3278,7 +3278,7 @@ void ieee80211_ips_leave_wq(struct net_device *dev)
{
struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
RT_RF_POWER_STATE rtState;
rtState = priv->ieee80211->eRFPowerState;
rtState = priv->eRFPowerState;

if(priv->ieee80211->PowerSaveControl.bInactivePs){
if(rtState == eRfOff){
Expand Down Expand Up @@ -3345,7 +3345,7 @@ static void rtl819x_watchdog_wqcallback(struct work_struct *work)
#ifdef ENABLE_IPS
if(ieee->actscanning == false){
if((ieee->iw_mode == IW_MODE_INFRA) && (ieee->state == IEEE80211_NOLINK) &&
(ieee->eRFPowerState == eRfOn)&&!ieee->is_set_key &&
(priv->eRFPowerState == eRfOn) && !ieee->is_set_key &&
(!ieee->proto_stoppping) && !ieee->wx_set_enc){
if(ieee->PowerSaveControl.ReturnPoint == IPS_CALLBACK_NONE){
IPSEnter(dev);
Expand Down Expand Up @@ -3408,7 +3408,7 @@ static void rtl819x_watchdog_wqcallback(struct work_struct *work)
rtl819x_update_rxcounts(priv, &TotalRxBcnNum, &TotalRxDataNum);
if((TotalRxBcnNum+TotalRxDataNum) == 0)
{
if( ieee->eRFPowerState == eRfOff)
if (priv->eRFPowerState == eRfOff)
RT_TRACE(COMP_ERR,"========>%s()\n",__FUNCTION__);
printk("===>%s(): AP is power off,connect another one\n",__FUNCTION__);
// Dot11d_Reset(dev);
Expand Down Expand Up @@ -3478,7 +3478,7 @@ static int _rtl8192_up(struct net_device *dev)
}
RT_TRACE(COMP_INIT, "start adapter finished\n");

if(priv->ieee80211->eRFPowerState!=eRfOn)
if (priv->eRFPowerState != eRfOn)
MgntActSet_RF_State(dev, eRfOn, priv->ieee80211->RfOffReason);

if(priv->ieee80211->state != IEEE80211_LINKED)
Expand Down Expand Up @@ -5045,7 +5045,7 @@ void setKey( struct net_device *dev,
#ifdef ENABLE_IPS
struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
RT_RF_POWER_STATE rtState;
rtState = priv->ieee80211->eRFPowerState;
rtState = priv->eRFPowerState;
if(priv->ieee80211->PowerSaveControl.bInactivePs){
if(rtState == eRfOff){
if(priv->ieee80211->RfOffReason > RF_CHANGE_BY_IPS)
Expand Down
6 changes: 3 additions & 3 deletions drivers/staging/rtl8192e/r8192E_wx.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ static int r8192_wx_set_mode(struct net_device *dev, struct iw_request_info *a,
if (priv->bHwRadioOff)
return 0;

rtState = priv->ieee80211->eRFPowerState;
rtState = priv->eRFPowerState;
down(&priv->wx_sem);
#ifdef ENABLE_IPS
if(wrqu->mode == IW_MODE_ADHOC){
Expand Down Expand Up @@ -384,7 +384,7 @@ static int r8192_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
if (priv->bHwRadioOff)
return 0;

rtState = priv->ieee80211->eRFPowerState;
rtState = priv->eRFPowerState;

if(!priv->up) return -ENETDOWN;
if (priv->ieee80211->LinkDetectInfo.bBusyTraffic == true)
Expand Down Expand Up @@ -475,7 +475,7 @@ static int r8192_wx_set_essid(struct net_device *dev,
if (priv->bHwRadioOff)
return 0;

rtState = priv->ieee80211->eRFPowerState;
rtState = priv->eRFPowerState;
down(&priv->wx_sem);

#ifdef ENABLE_IPS
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/rtl8192e/r819xE_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ void rtl8192_phy_SetRFReg(struct net_device* dev, RF90_RADIO_PATH_E eRFPath, u32

if (!rtl8192_phy_CheckIsLegalRFPath(dev, eRFPath))
return;
if(priv->ieee80211->eRFPowerState != eRfOn && !priv->being_init_adapter)
if (priv->eRFPowerState != eRfOn && !priv->being_init_adapter)
return;
//down(&priv->rf_sem);

Expand Down Expand Up @@ -859,7 +859,7 @@ u32 rtl8192_phy_QueryRFReg(struct net_device* dev, RF90_RADIO_PATH_E eRFPath, u3
struct r8192_priv *priv = ieee80211_priv(dev);
if (!rtl8192_phy_CheckIsLegalRFPath(dev, eRFPath))
return 0;
if(priv->ieee80211->eRFPowerState != eRfOn && !priv->being_init_adapter)
if (priv->eRFPowerState != eRfOn && !priv->being_init_adapter)
return 0;
down(&priv->rf_sem);
if (priv->Rf_Mode == RF_OP_By_FW)
Expand Down

0 comments on commit 4559854

Please sign in to comment.