#PR-2741905.diffs# [plain text]
Index: UniNEnet.cpp
===================================================================
RCS file: /CVSRoot/IO/Drivers/Ethernet/AppleGMACEthernet/UniNEnet.cpp,v
retrieving revision 1.11
retrieving revision 1.11.6.1
diff -u -d -b -w -r1.11 -r1.11.6.1
--- UniNEnet.cpp	2001/07/24 22:40:31	1.11
+++ UniNEnet.cpp	2001/08/22 17:30:28	1.11.6.1
@@ -37,6 +37,11 @@
 #include "UniNEnetMII.h"
 #include <libkern/OSByteOrder.h>
 
+extern "C"
+{
+	extern boolean_t	ml_probe_read( vm_offset_t physAddr, unsigned int *val );
+}
+
 
 
 #define super IOEthernetController
@@ -626,7 +631,8 @@
 bool UniNEnet::wakeUp()
 {
 	bool	rc = false;
-	UInt32	gemReg;
+	bool	regAvail;
+	UInt32	gemReg = 0;
 
 
 	ELG( this, 0, 'Wake', "UniNEnet::wakeUp" );
@@ -649,9 +655,30 @@
 			// Set PHY and Cell to full power:
 	
 		callPlatformFunction( "EnableUniNEthernetClock", true, (void*)true, 0, 0, 0 );
-		OSSynchronizeIO();
-	}
 
+		if ( ioMapEnet )			// Probe register access if able:
+		{
+			IOSleep( 10 );
+	
+			regAvail = ml_probe_read(	(vm_offset_t)&fpRegsPhys->Status,
+										&(unsigned int)gemReg );
+
+			if ( !regAvail )		// try again if cell clock disabled: 
+			{
+				IOLog( "UniNEnet::wakeUp - ethernet cell's clock is disabled.\n" );
+				callPlatformFunction( "EnableUniNEthernetClock", true, (void*)true, 0, 0, 0 );
+				IOSleep( 10 );
+				regAvail = ml_probe_read(	(vm_offset_t)&fpRegsPhys->Status,
+											&(unsigned int)gemReg );
+				if ( !regAvail )	// return FALSE if cell clock still disabled. 
+				{
+					IOLog( "UniNEnet::wakeUp - ethernet cell's clock is still disabled.\n" );
+					goto wakeUp_exit;	
+				}/* end IF still disabled */
+			}/* end IF need to try again. */ 
+		}/* end IF can probe UniN register access */
+	}/* end IF builtin ethernet */
+
 		/* BUS MASTER, MEM I/O Space, MEM WR & INV	*/
 
 	nub->configWrite32( 0x04, 0x16 );		// write to the Config space
@@ -669,6 +696,8 @@
 		fpRegs	= (GMAC_Registers*)ioMapEnet->getVirtualAddress();
 		g.pRegs	= (UInt32)fpRegs;
 		ELG( ioMapEnet, fpRegs, 'Adrs', "start - base eNet addr" );
+			// for ml_probe_read on Wake:
+		fpRegsPhys	= (GMAC_Registers*)ioMapEnet->getPhysicalAddress();
 	}
 
 	if ( !initRxRing() || !initTxRing() ) 
Index: UniNEnet.h
===================================================================
RCS file: /CVSRoot/IO/Drivers/Ethernet/AppleGMACEthernet/UniNEnet.h,v
retrieving revision 1.10
retrieving revision 1.10.4.1
diff -u -d -b -w -r1.10 -r1.10.4.1
--- UniNEnet.h	2001/08/02 16:20:19	1.10
+++ UniNEnet.h	2001/08/22 17:30:29	1.10.4.1
@@ -139,6 +139,7 @@
 
 	globals					*fpGlobals;		// ptr to ELG structure
 	volatile GMAC_Registers	*fpRegs;
+	GMAC_Registers			*fpRegsPhys;	// for ml_probe_read
     IOPCIDevice *             nub;
     IOMemoryMap *             ioMapEnet;
     volatile IOPPCAddress     ioBaseEnet;

Generated by GNU enscript 1.6.4.