Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RegisterInterestedDriver problems



According to the comments surrounding IOService::registerInterestedDriver() in xnu/iokit/Kernel/IOServicePM.cpp, you want to call it the other way around:

// called on "this->"
registerInterestedDriver(m_ourProvider);

BUT - I think you're using the wrong API's. Have you considered registering your driver with the power management system? You can declare yourself a "power dependency" of m_ourProvider, and automatically get sleep/wake notifications at appropriate times. If your driver needs to power itself off on sleep and back on on wakeup, then this technique is the way to go.

You'd make the following calls in your start() routine:
IOService::PMinit(); // initializes private variables in IOService
IOService::registerPowerDriver(); // registers your power states with pm
IOService::m_ourProvider->joinPMtree(this); // declares your power dependency on your provider. This call also
// defines the order in which drivers are notified of sleep/wakeup.

And you'd implement the IOService::setPowerState() call, which will get called telling you to power off/on.

Maybe this info will help. enjoy.

-ethan

On Tuesday, August 27, 2002, at 05:09 AM, Francis bouchard wrote:

I'm having big problems getting this to work. I'm using 10.2(6c115)

I have a PCI dirver (IOService) that serves as a provider for another
driver. This second driver wants to know when the provider will go to sleep
so it can setup itself.

// done in the second driver
m_ourProvider->registerInterestedDriver(this);

Then I implement
IOReturn com_matrox_driver_Client::powerStateWillChangeTo( IOPMPowerFlags
domainState, unsigned long stateNumber, IOService* whatDevice){...}
IOReturn com_matrox_driver_Client:: powerStateDidChangeTo( IOPMPowerFlags
domainState, unsigned long stateNumber, IOService* whatDevice){...}

The Client's provider is an IOService and his provider is an IOPCIDevice.

Now the trouble is that the Client does not get the call to
powerStateWillChangeTo and powerStateDidChangeTo when it's provider goes to
sleep.

Any idea why ?
Francis
--
Windows is a 32-bit patch to a 16-bit shell for an 8-bit operating system
written for a 4-bit processor by a 2-bit company without 1 bit of sense.
_______________________________________________
darwin-drivers mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-drivers
Do not post admin requests to the list. They will be ignored.
_______________________________________________
darwin-drivers mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-drivers
Do not post admin requests to the list. They will be ignored.

References: 
 >RegisterInterestedDriver problems (From: Francis bouchard <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.