5 #include <libkern/OSTypes.h>
6 #include <IOKit/storage/ata/IOATAStorageDefines.h>
10 /* IOATAPowerStates */
12 struct IOATAPowerStates
14 IOATAPowerState driverDesire
;
15 IOATAPowerState deviceDesire
;
16 IOATAPowerState userDesire
;
19 typedef struct IOATAPowerStates IOATAPowerStates
;
21 /* DiskDevice: see GetATADeviceInfo(), GetATADeviceInfoWithRetry() */
29 IOATAPowerStates powerStates
;
32 typedef struct DiskDevice DiskDevice
;
38 -- Returns the max-of-three power state "desires" from the given IOATAPowerStates.
40 IOATAPowerState
PowerStatesMax( IOATAPowerStates
* powerStates
);
43 -- Returns human-readable string name for the given IOATAPowerState.
44 -- Returns pointer to a static, const string.
46 char * PowerStateString( IOATAPowerState x
, int opt_summary
);
48 /* Routines for printing fs_usage-compatible timestamps: HH:MM:SS.000
50 int sprintf_timestamp( char * str
, time_t t
);
51 int sprintf_timestamp_now( char * str
);
52 char * timestampStr_static( time_t t
); /* Returns pointer to a static, const string. */
55 /* Routines for printing time intervals: HH:MM:SS
57 int sprintf_interval( char * str
, time_t interval
);
58 char * intervalStr_static( time_t interval
); /* Returns pointer to a static, const string. */
61 /* GetATADeviceInfoWithRetry()
62 -- This invokes GetATADeviceInfo() repeatedly at one second intervals until it returns without error.
63 -- Gives up after 10 tries, so it is possible that this could return an error.
65 int GetATADeviceInfoWithRetry( DiskDevice
* diskDevice
);
71 #endif /* __SPINDOWN_H__ */