Documentation Archive Developer
Search

ADC Home > Reference Library > Technical Notes > Legacy Documents > Mac OS 9 & Earlier >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

Power Management & PC Card Manager 3.0

CONTENTS

Technote menu gif

This Technote describes the relationship between the Power Manager on PowerBook computers and the PC Card Manager 3.0.

 Updated: [Feb 9 1998]






PowerBook Power Management (Sleep/Wake) and PC Card Manager 3.0

PowerBooks support a Sleep state in order to extend battery life. Since PC Cards can consume a lot of power (relatively speaking), PC Card Manager 3.0 works along with the Mac OS to turn off power when the computer goes to sleep. This provides some opportunities and responsibilities for the developers of PC Card drivers and card enablers.

Back to top

What PC Card Manager 3.0 Does...

When your PowerBook goes to sleep

  • PC Card Manager 3.0 will notify clients (with a kPCCardPMSuspendMessage)
  • PC Card Manager 3.0 saves the generic state of the card (configuration registers, window mappings etc.)
  • PC Card Manager 3.0 turns off power to the socket

When your PowerBook wakes up

  • PC Card Manager 3.0 turns on power to the socket
  • PC Card Manager 3.0 restores the generic state of the card
  • PC Card Manager 3.0 sends kPCCardPMResumeMessage notification to clients

When your PowerBook is idle

  • depending on the settings of your PowerBook control panel, after some period of time, the Mac OS will issue a sleep request in order to determine if it is safe to put the machine to sleep
  • PC Card Manager 3.0 will get this request and send a kPCCardPMSuspendRequest notification to all clients
  • if any client objects to going to sleep (for example, if it would disrupt a network connection), it should return a value not equal to noErr from it's call back function.
  • if nobody vetoes this sleep request (PC CARD client or non-client), the machine goes to sleep and PC CARD clients will see a kPCCardPMSuspendMessage
  • when a sleep demand call is issued, PC Cards can not reject the call; this is merely notification to your card that the system is going to go to sleep, not a request for sleep. See the Power Manager chapter ofInside Macintosh: Devices for more detail.

Back to top

What Card developers need to do

Preserving Device Specific Dynamic Data

  • if you are doing a driver for a PC CARD device that has some data on a card that will go away if the power is turned off, you are responsible for saving and restoring it.
  • you can save and restore this data in either the device driver or a custom card enabler
  • if you wish to save this data in a device driver:
    • register the driver as a card services client
    • when you get a kPCCardPMSuspendMessage, save the device specific data
    • when you get a kPCCardPMResumeMessage, restore the device specific data
  • if you wish to save this data in a custom card enabler: (this might be the best choice for a multi-function card)
    • override setPCCardPowerLevel
      • save the device specific data on the card
      • call CEPowerManagement
    • When waking up
      • call CEPowerManagement
      • restore the device specific data on the card

Implementing a Low Power Mode

  • We have defined three power states for PC Card Manager 3.0 ( kPCCardPowerOn, kPCCardPowerOff and kPCCardLowPower)
  • PC Card Manager 3.0 only supports On and Off (Low is considered to be On)
  • If your card supports a Low power mode, you will need a custom card enabler to support transitions to and from this Low power mode - you will need to override setPCCardPowerLevel to do so.

Note:
in a future version of the PC Card Manager, we intend to implement a function named PCCardSetPowerLevel which could be called by a driver to turn power off and/or low. This will make your driver very battery friendly.


Back to top

References

PC Card 3.0 Manager SDK Documentation

Inside Macintosh: Devices, chapter 6, the Power Manager

Back to top

Downloadables

Acrobat gif

Acrobat version of this Note (48K)

Download

Back to top