// Assumption:
// PASSIVE LEVEL.
//
-bool
-MgntActSet_RF_State(
- struct net_device* dev,
- RT_RF_POWER_STATE StateToSet,
- RT_RF_CHANGE_SOURCE ChangeSource
- )
+bool MgntActSet_RF_State(struct r8192_priv *priv, RT_RF_POWER_STATE StateToSet,
+ RT_RF_CHANGE_SOURCE ChangeSource)
{
- struct r8192_priv *priv = ieee80211_priv(dev);
bool bActionAllowed = false;
bool bConnectBySSID = false;
RT_RF_POWER_STATE rtState;
void PHY_SetRF8256CCKTxPower(struct r8192_priv *priv, u8 powerlevel);
void PHY_SetRF8256OFDMTxPower(struct r8192_priv *priv, u8 powerlevel);
-bool MgntActSet_RF_State(struct net_device *dev,
- RT_RF_POWER_STATE StateToSet,
- RT_RF_CHANGE_SOURCE ChangeSource);
+bool MgntActSet_RF_State(struct r8192_priv *priv,
+ RT_RF_POWER_STATE StateToSet,
+ RT_RF_CHANGE_SOURCE ChangeSource);
#endif /* RTL8225_H */
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)
{
- 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)
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->RfOffReason);
- MgntActSet_RF_State(dev, eRfOff, priv->RfOffReason);
+ MgntActSet_RF_State(priv, eRfOff, priv->RfOffReason);
}
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->RfOffReason);
- MgntActSet_RF_State(dev, eRfOff, priv->RfOffReason);
+ MgntActSet_RF_State(priv, eRfOff, priv->RfOffReason);
}
else
{
#ifdef ENABLE_IPS
static void InactivePsWorkItemCallback(struct r8192_priv *priv)
{
- struct net_device *dev = priv->ieee80211->dev;
-
PRT_POWER_SAVE_CONTROL pPSC = &priv->PowerSaveControl;
RT_TRACE(COMP_POWER, "InactivePsWorkItemCallback() --------->\n");
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.
RT_TRACE(COMP_INIT, "start adapter finished\n");
if (priv->eRFPowerState != eRfOn)
- MgntActSet_RF_State(dev, eRfOn, priv->RfOffReason);
+ MgntActSet_RF_State(priv, eRfOn, priv->RfOffReason);
if(priv->ieee80211->state != IEEE80211_LINKED)
ieee80211_softmac_start_protocol(priv->ieee80211);
{
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 net_device *dev = priv->ieee80211->dev;
u8 tmp1byte;
RT_RF_POWER_STATE eRfPowerStateToSet;
bool bActuallySet = false;
if (bActuallySet) {
priv->bHwRfOffAction = 1;
- MgntActSet_RF_State(dev, eRfPowerStateToSet, RF_CHANGE_BY_HW);
+ MgntActSet_RF_State(priv, eRfPowerStateToSet, RF_CHANGE_BY_HW);
//DrvIFIndicateCurrentPhyStatus(pAdapter);
} else {
msleep(2000);