Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b1a26f8 authored by Mike McCormack's avatar Mike McCormack Committed by Greg Kroah-Hartman
Browse files

staging: rtl8192e: Enable the NIC only once

parent 1b8b4969
Loading
Loading
Loading
Loading
+9 −13
Original line number Original line Diff line number Diff line
@@ -339,19 +339,15 @@ SetRFPowerState8190(struct net_device *dev, RT_RF_POWER_STATE eRFPowerState)
	case eRfOn:
	case eRfOn:


		// turn on RF
		// turn on RF
		if((priv->ieee80211->eRFPowerState == eRfOff) && RT_IN_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC))
		if ((priv->ieee80211->eRFPowerState == eRfOff) &&
		{ // The current RF state is OFF and the RF OFF level is halting the NIC, re-initialize the NIC.
		    RT_IN_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC))
			bool rtstatus = true;
			u32 InitializeCount = 3;
			do
		{
		{
				InitializeCount--;
			/*
				rtstatus = NicIFEnableNIC(dev);
			 * The current RF state is OFF and the RF OFF level
			}while( (rtstatus != true) &&(InitializeCount >0) );
			 * is halting the NIC, re-initialize the NIC.

			 */
			if(rtstatus != true)
			if (!NicIFEnableNIC(dev)) {
			{
				RT_TRACE(COMP_ERR, "%s(): NicIFEnableNIC failed\n",__FUNCTION__);
				RT_TRACE(COMP_ERR,"%s():Initialize Adapter fail,return\n",__FUNCTION__);
				priv->SetRFPowerStateInProgress = false;
				priv->SetRFPowerStateInProgress = false;
				return false;
				return false;
			}
			}