]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: rtl8192e: Enable the NIC only once
authorMike McCormack <mikem@ring3k.org>
Thu, 10 Feb 2011 23:44:09 +0000 (08:44 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Feb 2011 20:35:32 +0000 (12:35 -0800)
Signed-off-by: Mike McCormack <mikem@ring3k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/rtl8192e/r8190_rtl8256.c

index 4af8f12bad66b0258d946290b7de4260d71b7ab8..db70505179315f6b40dec00ef5e25f1c6a4c84e2 100644 (file)
@@ -339,19 +339,15 @@ SetRFPowerState8190(struct net_device *dev, RT_RF_POWER_STATE eRFPowerState)
        case eRfOn:
 
                // turn on RF
-               if((priv->ieee80211->eRFPowerState == eRfOff) && RT_IN_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC))
-               { // The current RF state is OFF and the RF OFF level is halting the NIC, re-initialize the NIC.
-                       bool rtstatus = true;
-                       u32 InitializeCount = 3;
-                       do
-                       {
-                               InitializeCount--;
-                               rtstatus = NicIFEnableNIC(dev);
-                       }while( (rtstatus != true) &&(InitializeCount >0) );
-
-                       if(rtstatus != true)
-                       {
-                               RT_TRACE(COMP_ERR,"%s():Initialize Adapter fail,return\n",__FUNCTION__);
+               if ((priv->ieee80211->eRFPowerState == eRfOff) &&
+                   RT_IN_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC))
+               {
+                       /*
+                        * The current RF state is OFF and the RF OFF level
+                        * is halting the NIC, re-initialize the NIC.
+                        */
+                       if (!NicIFEnableNIC(dev)) {
+                               RT_TRACE(COMP_ERR, "%s(): NicIFEnableNIC failed\n",__FUNCTION__);
                                priv->SetRFPowerStateInProgress = false;
                                return false;
                        }