staging: rtl8192e: Add a spinlock around SetRFPowerState8190
Signed-off-by: Mike McCormack <mikem@ring3k.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
bc54f3393c
commit
2cb61ea25b
@@ -327,8 +327,11 @@ SetRFPowerState8190(struct net_device *dev, RT_RF_POWER_STATE eRFPowerState)
|
|||||||
PRT_POWER_SAVE_CONTROL pPSC = (PRT_POWER_SAVE_CONTROL)(&(priv->ieee80211->PowerSaveControl));
|
PRT_POWER_SAVE_CONTROL pPSC = (PRT_POWER_SAVE_CONTROL)(&(priv->ieee80211->PowerSaveControl));
|
||||||
bool bResult = true;
|
bool bResult = true;
|
||||||
|
|
||||||
if(priv->SetRFPowerStateInProgress == true)
|
spin_lock(&priv->ps_lock);
|
||||||
return false;
|
if (priv->SetRFPowerStateInProgress) {
|
||||||
|
bResult = false;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
priv->SetRFPowerStateInProgress = true;
|
priv->SetRFPowerStateInProgress = true;
|
||||||
|
|
||||||
switch( eRFPowerState )
|
switch( eRFPowerState )
|
||||||
@@ -345,8 +348,8 @@ SetRFPowerState8190(struct net_device *dev, RT_RF_POWER_STATE eRFPowerState)
|
|||||||
*/
|
*/
|
||||||
if (!NicIFEnableNIC(dev)) {
|
if (!NicIFEnableNIC(dev)) {
|
||||||
RT_TRACE(COMP_ERR, "%s(): NicIFEnableNIC failed\n",__FUNCTION__);
|
RT_TRACE(COMP_ERR, "%s(): NicIFEnableNIC failed\n",__FUNCTION__);
|
||||||
priv->SetRFPowerStateInProgress = false;
|
bResult = false;
|
||||||
return false;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
RT_CLEAR_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC);
|
RT_CLEAR_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC);
|
||||||
@@ -424,7 +427,9 @@ SetRFPowerState8190(struct net_device *dev, RT_RF_POWER_STATE eRFPowerState)
|
|||||||
priv->ieee80211->eRFPowerState = eRFPowerState;
|
priv->ieee80211->eRFPowerState = eRFPowerState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
priv->SetRFPowerStateInProgress = false;
|
priv->SetRFPowerStateInProgress = false;
|
||||||
|
spin_unlock(&priv->ps_lock);
|
||||||
return bResult;
|
return bResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user