Supporting power management in a SCSI driver unavoidably violates some of the guidelines set forth in Card Power Controls. This section discusses some of the issues and potential solutions.
At a minimum, SCSI storage device drivers should support driver gestalt as defined in Driver Gestalt. They should respond positively to the 'lpwr' gestalt selector. Supporting driver gestalt mandates that the driver support csCode=70 for getting and setting the low power state (for spindle motor control, in most cases). The currently defined power modes are Active, Standby, Idle, and Sleep.
If a driver does not have to support multiple platforms (such as both Power Macintosh and PowerBook computers) and chooses to rely on the Power Manager's internal timing semaphores, it should implement the following processes:
When these processes are implemented, drivers registered with the Power Manager will not be ordered to enter a low power mode until all devices have been idle for a period of time set by the user. However, no individual device control will be available and more work will be required to make the driver compatible with future releases of Mac OS.
To be compatible with both Power Macintosh and PowerBook computers, or to simply provide a more elegant solution to the user, the driver should maintain an internal timer specifically for the device it administers. If multiple devices are managed by a single driver, multiple timers should be managed as well. To provide this level of support, the following must be implemented:
Drivers should not install code into the HD Spindown queue in this implementation. However, if the driver supports the main internal storage device on a PowerBook computer and requires device preparation before power is removed, Sleep and Wake and HD Spindown queue elements should be implemented.
With either Power Macintosh or PowerBook platforms, any access to a driver's device or any driver request that requires the device to be at full power should cause the driver to wake the device before servicing that request. A control call to resume full power must be supported, but such a call is not required to wake the device.
Note
Gestalt checks for the presence of the Power Manager should be made to decide whether to implement a low power solution upon a driver open or acknowledge request and to determine what kind of support is appropriate.
The current Power Manager implementation supports a mixed environment where some clients are dependent on the Power Manager's internal timing semaphore and others are self-sufficient. Drives supported by driver-based timers will spin down on a drive-by-drive basis. The internal timer will still trigger a spindown of those drives that rely on the Power Manager's timing facilities. It would be wise in either implementation to respond intelligently to requests to enter a power mode that is already present.