Commit 262cd816 authored by Mike McCormack's avatar Mike McCormack Committed by Greg Kroah-Hartman

staging: rtl8192e: Pass r8192_priv to MgntActSet_RF_State

Signed-off-by: default avatarMike McCormack <mikem@ring3k.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7088dfb6
...@@ -604,14 +604,9 @@ static bool MgntDisconnect(struct r8192_priv *priv, u8 asRsn) ...@@ -604,14 +604,9 @@ static bool MgntDisconnect(struct r8192_priv *priv, u8 asRsn)
// Assumption: // Assumption:
// PASSIVE LEVEL. // PASSIVE LEVEL.
// //
bool bool MgntActSet_RF_State(struct r8192_priv *priv, RT_RF_POWER_STATE StateToSet,
MgntActSet_RF_State( RT_RF_CHANGE_SOURCE ChangeSource)
struct net_device* dev,
RT_RF_POWER_STATE StateToSet,
RT_RF_CHANGE_SOURCE ChangeSource
)
{ {
struct r8192_priv *priv = ieee80211_priv(dev);
bool bActionAllowed = false; bool bActionAllowed = false;
bool bConnectBySSID = false; bool bConnectBySSID = false;
RT_RF_POWER_STATE rtState; RT_RF_POWER_STATE rtState;
......
...@@ -22,8 +22,8 @@ RT_STATUS phy_RF8256_Config_ParaFile(struct r8192_priv *priv); ...@@ -22,8 +22,8 @@ RT_STATUS phy_RF8256_Config_ParaFile(struct r8192_priv *priv);
void PHY_SetRF8256CCKTxPower(struct r8192_priv *priv, u8 powerlevel); void PHY_SetRF8256CCKTxPower(struct r8192_priv *priv, u8 powerlevel);
void PHY_SetRF8256OFDMTxPower(struct r8192_priv *priv, u8 powerlevel); void PHY_SetRF8256OFDMTxPower(struct r8192_priv *priv, u8 powerlevel);
bool MgntActSet_RF_State(struct net_device *dev, bool MgntActSet_RF_State(struct r8192_priv *priv,
RT_RF_POWER_STATE StateToSet, RT_RF_POWER_STATE StateToSet,
RT_RF_CHANGE_SOURCE ChangeSource); RT_RF_CHANGE_SOURCE ChangeSource);
#endif /* RTL8225_H */ #endif /* RTL8225_H */
...@@ -1827,12 +1827,14 @@ static short rtl8192_is_tx_queue_empty(struct net_device *dev) ...@@ -1827,12 +1827,14 @@ static short rtl8192_is_tx_queue_empty(struct net_device *dev)
static void rtl8192_hw_sleep_down(struct net_device *dev) static void rtl8192_hw_sleep_down(struct net_device *dev)
{ {
MgntActSet_RF_State(dev, eRfSleep, RF_CHANGE_BY_PS); struct r8192_priv *priv = ieee80211_priv(dev);
MgntActSet_RF_State(priv, eRfSleep, RF_CHANGE_BY_PS);
} }
static void rtl8192_hw_wakeup(struct net_device* dev) static void rtl8192_hw_wakeup(struct net_device* dev)
{ {
MgntActSet_RF_State(dev, eRfOn, RF_CHANGE_BY_PS); struct r8192_priv *priv = ieee80211_priv(dev);
MgntActSet_RF_State(priv, eRfOn, RF_CHANGE_BY_PS);
} }
static void rtl8192_hw_wakeup_wq (struct work_struct *work) static void rtl8192_hw_wakeup_wq (struct work_struct *work)
...@@ -2809,12 +2811,12 @@ static RT_STATUS rtl8192_adapter_start(struct r8192_priv *priv) ...@@ -2809,12 +2811,12 @@ static RT_STATUS rtl8192_adapter_start(struct r8192_priv *priv)
if(priv->RfOffReason > RF_CHANGE_BY_PS) if(priv->RfOffReason > RF_CHANGE_BY_PS)
{ // H/W or S/W RF OFF before sleep. { // 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->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); MgntActSet_RF_State(priv, eRfOff, priv->RfOffReason);
} }
else if(priv->RfOffReason >= RF_CHANGE_BY_IPS) else if(priv->RfOffReason >= RF_CHANGE_BY_IPS)
{ // H/W or S/W RF OFF before sleep. { // 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->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); MgntActSet_RF_State(priv, eRfOff, priv->RfOffReason);
} }
else else
{ {
...@@ -3059,8 +3061,6 @@ rtl819x_ifcheck_resetornot(struct r8192_priv *priv) ...@@ -3059,8 +3061,6 @@ rtl819x_ifcheck_resetornot(struct r8192_priv *priv)
#ifdef ENABLE_IPS #ifdef ENABLE_IPS
static void InactivePsWorkItemCallback(struct r8192_priv *priv) static void InactivePsWorkItemCallback(struct r8192_priv *priv)
{ {
struct net_device *dev = priv->ieee80211->dev;
PRT_POWER_SAVE_CONTROL pPSC = &priv->PowerSaveControl; PRT_POWER_SAVE_CONTROL pPSC = &priv->PowerSaveControl;
RT_TRACE(COMP_POWER, "InactivePsWorkItemCallback() --------->\n"); RT_TRACE(COMP_POWER, "InactivePsWorkItemCallback() --------->\n");
...@@ -3078,7 +3078,7 @@ static void InactivePsWorkItemCallback(struct r8192_priv *priv) ...@@ -3078,7 +3078,7 @@ static void InactivePsWorkItemCallback(struct r8192_priv *priv)
pPSC->eInactivePowerState == eRfOff?"OFF":"ON"); pPSC->eInactivePowerState == eRfOff?"OFF":"ON");
MgntActSet_RF_State(dev, pPSC->eInactivePowerState, RF_CHANGE_BY_IPS); MgntActSet_RF_State(priv, pPSC->eInactivePowerState, RF_CHANGE_BY_IPS);
// //
// To solve CAM values miss in RF OFF, rewrite CAM values after RF ON. By Bruce, 2007-09-20. // To solve CAM values miss in RF OFF, rewrite CAM values after RF ON. By Bruce, 2007-09-20.
...@@ -3451,7 +3451,7 @@ static int _rtl8192_up(struct r8192_priv *priv) ...@@ -3451,7 +3451,7 @@ static int _rtl8192_up(struct r8192_priv *priv)
RT_TRACE(COMP_INIT, "start adapter finished\n"); RT_TRACE(COMP_INIT, "start adapter finished\n");
if (priv->eRFPowerState != eRfOn) if (priv->eRFPowerState != eRfOn)
MgntActSet_RF_State(dev, eRfOn, priv->RfOffReason); MgntActSet_RF_State(priv, eRfOn, priv->RfOffReason);
if(priv->ieee80211->state != IEEE80211_LINKED) if(priv->ieee80211->state != IEEE80211_LINKED)
ieee80211_softmac_start_protocol(priv->ieee80211); ieee80211_softmac_start_protocol(priv->ieee80211);
......
...@@ -1846,7 +1846,6 @@ void dm_gpio_change_rf_callback(struct work_struct *work) ...@@ -1846,7 +1846,6 @@ void dm_gpio_change_rf_callback(struct work_struct *work)
{ {
struct delayed_work *dwork = container_of(work,struct delayed_work,work); struct delayed_work *dwork = container_of(work,struct delayed_work,work);
struct r8192_priv *priv = container_of(dwork,struct r8192_priv,gpio_change_rf_wq); struct r8192_priv *priv = container_of(dwork,struct r8192_priv,gpio_change_rf_wq);
struct net_device *dev = priv->ieee80211->dev;
u8 tmp1byte; u8 tmp1byte;
RT_RF_POWER_STATE eRfPowerStateToSet; RT_RF_POWER_STATE eRfPowerStateToSet;
bool bActuallySet = false; bool bActuallySet = false;
...@@ -1873,7 +1872,7 @@ void dm_gpio_change_rf_callback(struct work_struct *work) ...@@ -1873,7 +1872,7 @@ void dm_gpio_change_rf_callback(struct work_struct *work)
if (bActuallySet) { if (bActuallySet) {
priv->bHwRfOffAction = 1; priv->bHwRfOffAction = 1;
MgntActSet_RF_State(dev, eRfPowerStateToSet, RF_CHANGE_BY_HW); MgntActSet_RF_State(priv, eRfPowerStateToSet, RF_CHANGE_BY_HW);
//DrvIFIndicateCurrentPhyStatus(pAdapter); //DrvIFIndicateCurrentPhyStatus(pAdapter);
} else { } else {
msleep(2000); msleep(2000);
......
...@@ -36,7 +36,7 @@ int rtl8192E_suspend (struct pci_dev *pdev, pm_message_t state) ...@@ -36,7 +36,7 @@ int rtl8192E_suspend (struct pci_dev *pdev, pm_message_t state)
// Call MgntActSet_RF_State instead to prevent RF config race condition. // Call MgntActSet_RF_State instead to prevent RF config race condition.
if(!priv->ieee80211->bSupportRemoteWakeUp) { if(!priv->ieee80211->bSupportRemoteWakeUp) {
MgntActSet_RF_State(dev, eRfOff, RF_CHANGE_BY_INIT); MgntActSet_RF_State(priv, eRfOff, RF_CHANGE_BY_INIT);
// 2006.11.30. System reset bit // 2006.11.30. System reset bit
ulRegRead = read_nic_dword(priv, CPU_GEN); ulRegRead = read_nic_dword(priv, CPU_GEN);
ulRegRead|=CPU_GEN_SYSTEM_RESET; ulRegRead|=CPU_GEN_SYSTEM_RESET;
......
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