xref: /openbsd/usr.sbin/apmd/apm-proto.h (revision f6da2e61)
1*f6da2e61Ssturm /*	$OpenBSD: apm-proto.h,v 1.5 2005/11/23 08:02:58 sturm Exp $	*/
2a831c31eSmickey 
3054c7b81Shvozda /*
4054c7b81Shvozda  *  Copyright (c) 1996 John T. Kohl
5054c7b81Shvozda  *  All rights reserved.
6054c7b81Shvozda  *
7054c7b81Shvozda  *  Redistribution and use in source and binary forms, with or without
8054c7b81Shvozda  *  modification, are permitted provided that the following conditions
9054c7b81Shvozda  *  are met:
10054c7b81Shvozda  *  1. Redistributions of source code must retain the above copyright
11054c7b81Shvozda  *     notice, this list of conditions and the following disclaimer.
12054c7b81Shvozda  *  2. Redistributions in binary form must reproduce the above copyright
13054c7b81Shvozda  *     notice, this list of conditions and the following disclaimer in the
14054c7b81Shvozda  *     documentation and/or other materials provided with the distribution.
15054c7b81Shvozda  *  3. The name of the author may not be used to endorse or promote products
16054c7b81Shvozda  *     derived from this software without specific prior written permission.
17054c7b81Shvozda  *
18054c7b81Shvozda  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR
19054c7b81Shvozda  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20054c7b81Shvozda  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21054c7b81Shvozda  * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
22054c7b81Shvozda  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23054c7b81Shvozda  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24054c7b81Shvozda  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25054c7b81Shvozda  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26054c7b81Shvozda  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
27054c7b81Shvozda  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28054c7b81Shvozda  * POSSIBILITY OF SUCH DAMAGE.
29054c7b81Shvozda  *
30054c7b81Shvozda  */
31054c7b81Shvozda 
32054c7b81Shvozda enum apm_action {
33054c7b81Shvozda 	NONE,
34054c7b81Shvozda 	SUSPEND,
35054c7b81Shvozda 	STANDBY,
36*f6da2e61Ssturm 	GETSTATUS,
37*f6da2e61Ssturm 	SETPERF_LOW,
38*f6da2e61Ssturm 	SETPERF_HIGH,
39*f6da2e61Ssturm 	SETPERF_AUTO
40054c7b81Shvozda };
41054c7b81Shvozda 
42054c7b81Shvozda enum apm_state {
43054c7b81Shvozda 	NORMAL,
44054c7b81Shvozda 	SUSPENDING,
45054c7b81Shvozda 	STANDING_BY
46054c7b81Shvozda };
47054c7b81Shvozda 
48*f6da2e61Ssturm enum apm_perfstate {
49*f6da2e61Ssturm 	PERF_NONE,
50*f6da2e61Ssturm 	PERF_MANUAL,
51*f6da2e61Ssturm 	PERF_AUTO
52*f6da2e61Ssturm };
53*f6da2e61Ssturm 
54054c7b81Shvozda struct apm_command {
55054c7b81Shvozda 	int vno;
56054c7b81Shvozda 	enum apm_action action;
57054c7b81Shvozda };
58054c7b81Shvozda 
59054c7b81Shvozda struct apm_reply {
60054c7b81Shvozda 	int vno;
61054c7b81Shvozda 	enum apm_state newstate;
62*f6da2e61Ssturm 	enum apm_perfstate perfstate;
63054c7b81Shvozda 	struct apm_power_info batterystate;
64054c7b81Shvozda };
65054c7b81Shvozda 
66*f6da2e61Ssturm #define APMD_VNO	2
67054c7b81Shvozda 
68c72b5b24Smillert extern const char *battstate(int state);
69c72b5b24Smillert extern const char *ac_state(int state);
70*f6da2e61Ssturm extern const char *perf_state(int state);
71