staging: rtl8192e: MgntActSet_RF_State: remove ProtectOrNot parameter

It is set at the very beginning of function to a constant value.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Mateusz Kulikowski 2015-07-28 23:31:41 +02:00 committed by Greg Kroah-Hartman
parent f2d4d4e1e2
commit 2937a5d272
6 changed files with 35 additions and 48 deletions

View File

@ -882,19 +882,17 @@ start:
RT_TRACE((COMP_INIT | COMP_RF | COMP_POWER),
"%s(): Turn off RF for RegRfOff ----------\n",
__func__);
rtl92e_set_rf_state(dev, eRfOff, RF_CHANGE_BY_SW, true);
rtl92e_set_rf_state(dev, eRfOff, RF_CHANGE_BY_SW);
} else if (priv->rtllib->RfOffReason > RF_CHANGE_BY_PS) {
RT_TRACE((COMP_INIT|COMP_RF|COMP_POWER),
"%s(): Turn off RF for RfOffReason(%d) ----------\n",
__func__, priv->rtllib->RfOffReason);
rtl92e_set_rf_state(dev, eRfOff, priv->rtllib->RfOffReason,
true);
rtl92e_set_rf_state(dev, eRfOff, priv->rtllib->RfOffReason);
} else if (priv->rtllib->RfOffReason >= RF_CHANGE_BY_IPS) {
RT_TRACE((COMP_INIT|COMP_RF|COMP_POWER),
"%s(): Turn off RF for RfOffReason(%d) ----------\n",
__func__, priv->rtllib->RfOffReason);
rtl92e_set_rf_state(dev, eRfOff, priv->rtllib->RfOffReason,
true);
rtl92e_set_rf_state(dev, eRfOff, priv->rtllib->RfOffReason);
} else {
RT_TRACE((COMP_INIT|COMP_RF|COMP_POWER), "%s(): RF-ON\n",
__func__);

View File

@ -149,8 +149,7 @@ void rtl92e_writew(struct net_device *dev, int x, u16 y)
*****************************************************************************/
bool rtl92e_set_rf_state(struct net_device *dev,
enum rt_rf_power_state StateToSet,
RT_RF_CHANGE_SOURCE ChangeSource,
bool ProtectOrNot)
RT_RF_CHANGE_SOURCE ChangeSource)
{
struct r8192_priv *priv = rtllib_priv(dev);
struct rtllib_device *ieee = priv->rtllib;
@ -163,37 +162,32 @@ bool rtl92e_set_rf_state(struct net_device *dev,
RT_TRACE((COMP_PS | COMP_RF),
"===>rtl92e_set_rf_state(): StateToSet(%d)\n", StateToSet);
ProtectOrNot = false;
while (true) {
spin_lock_irqsave(&priv->rf_ps_lock, flag);
if (priv->RFChangeInProgress) {
spin_unlock_irqrestore(&priv->rf_ps_lock, flag);
RT_TRACE((COMP_PS | COMP_RF),
"rtl92e_set_rf_state(): RF Change in progress! Wait to set..StateToSet(%d).\n",
StateToSet);
if (!ProtectOrNot) {
while (true) {
spin_lock_irqsave(&priv->rf_ps_lock, flag);
if (priv->RFChangeInProgress) {
spin_unlock_irqrestore(&priv->rf_ps_lock, flag);
while (priv->RFChangeInProgress) {
RFWaitCounter++;
RT_TRACE((COMP_PS | COMP_RF),
"rtl92e_set_rf_state(): RF Change in progress! Wait to set..StateToSet(%d).\n",
StateToSet);
"rtl92e_set_rf_state(): Wait 1 ms (%d times)...\n",
RFWaitCounter);
mdelay(1);
while (priv->RFChangeInProgress) {
RFWaitCounter++;
RT_TRACE((COMP_PS | COMP_RF),
"rtl92e_set_rf_state(): Wait 1 ms (%d times)...\n",
RFWaitCounter);
mdelay(1);
if (RFWaitCounter > 100) {
netdev_warn(dev,
"%s(): Timeout waiting for RF change.\n",
__func__);
return false;
}
if (RFWaitCounter > 100) {
netdev_warn(dev,
"%s(): Timeout waiting for RF change.\n",
__func__);
return false;
}
} else {
priv->RFChangeInProgress = true;
spin_unlock_irqrestore(&priv->rf_ps_lock, flag);
break;
}
} else {
priv->RFChangeInProgress = true;
spin_unlock_irqrestore(&priv->rf_ps_lock, flag);
break;
}
}
@ -270,11 +264,9 @@ bool rtl92e_set_rf_state(struct net_device *dev,
StateToSet, ChangeSource, priv->rtllib->RfOffReason);
}
if (!ProtectOrNot) {
spin_lock_irqsave(&priv->rf_ps_lock, flag);
priv->RFChangeInProgress = false;
spin_unlock_irqrestore(&priv->rf_ps_lock, flag);
}
spin_lock_irqsave(&priv->rf_ps_lock, flag);
priv->RFChangeInProgress = false;
spin_unlock_irqrestore(&priv->rf_ps_lock, flag);
RT_TRACE((COMP_PS | COMP_RF), "<===rtl92e_set_rf_state()\n");
return bActionAllowed;

View File

@ -617,6 +617,5 @@ bool rtl92e_disable_nic(struct net_device *dev);
bool rtl92e_set_rf_state(struct net_device *dev,
enum rt_rf_power_state StateToSet,
RT_RF_CHANGE_SOURCE ChangeSource,
bool ProtectOrNot);
RT_RF_CHANGE_SOURCE ChangeSource);
#endif

View File

@ -1888,8 +1888,7 @@ static void dm_CheckRfCtrlGPIO(void *data)
if (bActuallySet) {
mdelay(1000);
priv->bHwRfOffAction = 1;
rtl92e_set_rf_state(dev, eRfPowerStateToSet, RF_CHANGE_BY_HW,
true);
rtl92e_set_rf_state(dev, eRfPowerStateToSet, RF_CHANGE_BY_HW);
if (priv->bHwRadioOff)
argv[1] = "RFOFF";
else

View File

@ -45,7 +45,7 @@ int rtl92e_suspend(struct pci_dev *pdev, pm_message_t state)
netif_device_detach(dev);
if (!priv->rtllib->bSupportRemoteWakeUp) {
rtl92e_set_rf_state(dev, eRfOff, RF_CHANGE_BY_INIT, true);
rtl92e_set_rf_state(dev, eRfOff, RF_CHANGE_BY_INIT);
ulRegRead = rtl92e_readl(dev, CPU_GEN);
ulRegRead |= CPU_GEN_SYSTEM_RESET;
rtl92e_writel(dev, CPU_GEN, ulRegRead);
@ -108,7 +108,7 @@ int rtl92e_resume(struct pci_dev *pdev)
dev->netdev_ops->ndo_open(dev);
if (!priv->rtllib->bSupportRemoteWakeUp)
rtl92e_set_rf_state(dev, eRfOn, RF_CHANGE_BY_INIT, true);
rtl92e_set_rf_state(dev, eRfOn, RF_CHANGE_BY_INIT);
out:
RT_TRACE(COMP_POWER, "<================r8192E resume call.\n");

View File

@ -45,7 +45,7 @@ static void rtl8192_hw_sleep_down(struct net_device *dev)
spin_unlock_irqrestore(&priv->rf_ps_lock, flags);
RT_TRACE(COMP_DBG, "%s()============>come to sleep down\n", __func__);
rtl92e_set_rf_state(dev, eRfSleep, RF_CHANGE_BY_PS, false);
rtl92e_set_rf_state(dev, eRfSleep, RF_CHANGE_BY_PS);
}
void rtl92e_hw_sleep_wq(void *data)
@ -74,7 +74,7 @@ void rtl92e_hw_wakeup(struct net_device *dev)
}
spin_unlock_irqrestore(&priv->rf_ps_lock, flags);
RT_TRACE(COMP_PS, "%s()============>come to wake up\n", __func__);
rtl92e_set_rf_state(dev, eRfOn, RF_CHANGE_BY_PS, false);
rtl92e_set_rf_state(dev, eRfOn, RF_CHANGE_BY_PS);
}
void rtl92e_hw_wakeup_wq(void *data)
@ -133,8 +133,7 @@ static void InactivePsWorkItemCallback(struct net_device *dev)
RT_TRACE(COMP_PS, "InactivePsWorkItemCallback(): Set RF to %s.\n",
pPSC->eInactivePowerState == eRfOff ? "OFF" : "ON");
rtl92e_set_rf_state(dev, pPSC->eInactivePowerState, RF_CHANGE_BY_IPS,
false);
rtl92e_set_rf_state(dev, pPSC->eInactivePowerState, RF_CHANGE_BY_IPS);
pPSC->bSwRfProcessing = false;
RT_TRACE(COMP_PS, "InactivePsWorkItemCallback() <---------\n");