IOReturn IOADBController::powerStateWillChangeTo ( IOPMPowerFlags theFlags, unsigned long, IOService*)
{
int i;
-
- if ( ! (theFlags & IOPMPowerOn) ) {
+ if ( ! (theFlags & kIOPMPowerOn) && ! (theFlags & kIOPMDoze) ) {
busProbed = false;
for ( i = 1; i < ADB_DEVICE_COUNT; i++ ) {
if( adbDevices[ i ] != NULL ) {
if ( adbDevices[ i ]->nub ) {
- adbDevices[ i ]->nub->terminate(kIOServiceRequired);
+ adbDevices[ i ]->nub->terminate(kIOServiceRequired | kIOServiceSynchronous);
adbDevices[ i ]->nub->release();
}
IOFree( adbDevices[ i ], sizeof (ADBDeviceControl));
//*********************************************************************************
IOReturn IOADBController::powerStateDidChangeTo ( IOPMPowerFlags theFlags, unsigned long, IOService*)
{
- if ( theFlags & IOPMPowerOn ) {
+ if ( (theFlags & kIOPMPowerOn) || (theFlags & kIOPMDoze) ) {
if ( ! busProbed ) {
thread_call_enter(probeThread);
busProbed = true;
const OSNumber * object;
const OSSymbol * key;
- /* Waits one second for the trackpads to be up */
-
- IOSleep(1500);
-
/* Kill the auto poll until a new dev id's have been setup */
-
setAutoPollEnable(false);
-
+
/*
* Send a ADB bus reset - reply is sent after bus has reset,
* so there is no need to wait for the reset to complete.
resetBus();
- /* Waits one second for the trackpads to be up */
-
- IOSleep(1500);
-
/*
* Okay, now attempt reassign the
* bus
}
}
- /* Now attempt to reassign the addresses */
+/* Now attempt to reassign the addresses */
while( unresolvedAddrs) {
if( !freeAddrs) {
panic("ADB: Cannot find a free ADB slot for reassignment!");
newDev->release();
continue;
}
- newDev->registerService();
newDev->start(this);
+ newDev->registerService();
+ newDev->waitQuiet();
} // repeat loop
return kIOReturnSuccess;
}
keys++;
}
else {
- if( deviceInfo->defaultAddress != strtol(keys, &keys, 16)) {
+ if( deviceInfo->defaultAddress != strtol(keys, (char **) &keys, 16)) {
break;
}
}
if( *keys++ == '-' ) {
- if( deviceInfo->defaultHandlerID != strtol(keys, &keys, 16)) {
+ if( deviceInfo->defaultHandlerID != strtol(keys, (char **) &keys, 16)) {
break;
}
}
{
ADBDeviceControl * deviceInfo = (ADBDeviceControl *)device;
- deviceInfo->owner = client;
deviceInfo->handler = handler;
+ deviceInfo->owner = client;
return kIOReturnSuccess;
}
}
+// **********************************************************************************
+// cancelAllIO
+//
+// **********************************************************************************
+IOReturn IOADBController::cancelAllIO ( void )
+{
+ return kIOReturnSuccess;
+}
+
+
// **********************************************************************************
// flush
//