Home | History | Annotate | Line # | Download | only in include
apmvar.h revision 1.2.104.1
      1  1.2.104.1     tls /*	$NetBSD: apmvar.h,v 1.2.104.1 2012/11/20 03:01:31 tls Exp $	*/
      2        1.1  itojun /*	$OpenBSD: apmvar.h,v 1.2 2001/10/03 20:06:01 drahn Exp $	*/
      3        1.1  itojun 
      4        1.1  itojun /*
      5        1.1  itojun  *  Copyright (c) 2001 Alexander Guy
      6        1.1  itojun  *  Copyright (c) 1995 John T. Kohl
      7        1.1  itojun  *  All rights reserved.
      8        1.1  itojun  *
      9        1.1  itojun  *  Redistribution and use in source and binary forms, with or without
     10        1.1  itojun  *  modification, are permitted provided that the following conditions
     11        1.1  itojun  *  are met:
     12        1.1  itojun  *  1. Redistributions of source code must retain the above copyright
     13        1.1  itojun  *     notice, this list of conditions and the following disclaimer.
     14        1.1  itojun  *  2. Redistributions in binary form must reproduce the above copyright
     15        1.1  itojun  *     notice, this list of conditions and the following disclaimer in the
     16        1.1  itojun  *     documentation and/or other materials provided with the distribution.
     17        1.1  itojun  *  3. The name of the author may not be used to endorse or promote products
     18        1.1  itojun  *     derived from this software without specific prior written permission.
     19        1.1  itojun  *
     20        1.1  itojun  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR
     21        1.1  itojun  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     22        1.1  itojun  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     23        1.1  itojun  * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
     24        1.1  itojun  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     25        1.1  itojun  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     26        1.1  itojun  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     27        1.1  itojun  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     28        1.1  itojun  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
     29        1.1  itojun  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     30        1.1  itojun  * POSSIBILITY OF SUCH DAMAGE.
     31        1.1  itojun  *
     32        1.1  itojun  */
     33        1.1  itojun #ifndef _MACPPC_APMVAR_H_
     34        1.1  itojun #define _MACPPC_APMVAR_H_
     35        1.1  itojun 
     36        1.1  itojun #include <sys/ioccom.h>
     37        1.1  itojun 
     38        1.1  itojun /* Advanced Power Management (v1.0 and v1.1 specification)
     39        1.1  itojun  * functions/defines/etc.
     40        1.1  itojun  */
     41        1.1  itojun 
     42        1.1  itojun /* These definitions make up the heart of the user-land interface
     43        1.1  itojun  * to the APM devices.
     44        1.1  itojun  */
     45        1.1  itojun 
     46        1.1  itojun #define		APM_AC_OFF		0x00
     47        1.1  itojun #define		APM_AC_ON		0x01
     48        1.1  itojun #define		APM_AC_BACKUP		0x02
     49        1.1  itojun #define		APM_AC_UNKNOWN		0xff
     50        1.1  itojun #define		APM_BATT_HIGH		0x00
     51        1.1  itojun #define		APM_BATT_LOW		0x01
     52        1.1  itojun #define		APM_BATT_CRITICAL	0x02
     53        1.1  itojun #define		APM_BATT_CHARGING	0x03
     54        1.1  itojun #define		APM_BATT_ABSENT		0x04 /* Software only--not in spec! */
     55        1.1  itojun #define		APM_BATT_UNKNOWN	0xff
     56        1.1  itojun #define		APM_BATT_LIFE_UNKNOWN	0xff
     57        1.1  itojun 
     58        1.1  itojun #define		APM_NOEVENT		0x0000
     59        1.1  itojun #define		APM_STANDBY_REQ		0x0001
     60        1.1  itojun #define		APM_SUSPEND_REQ		0x0002
     61        1.1  itojun #define		APM_NORMAL_RESUME	0x0003
     62        1.1  itojun #define		APM_CRIT_RESUME		0x0004 /* suspend/resume happened
     63        1.1  itojun 						  without us */
     64        1.1  itojun #define		APM_BATTERY_LOW		0x0005
     65        1.1  itojun #define		APM_POWER_CHANGE	0x0006
     66        1.1  itojun #define		APM_UPDATE_TIME		0x0007
     67        1.1  itojun #define		APM_CRIT_SUSPEND_REQ	0x0008
     68        1.1  itojun #define		APM_USER_STANDBY_REQ	0x0009
     69        1.1  itojun #define		APM_USER_SUSPEND_REQ	0x000A
     70        1.1  itojun #define		APM_SYS_STANDBY_RESUME	0x000B
     71        1.1  itojun #define		APM_CAPABILITY_CHANGE	0x000C	/* apm v1.2 */
     72        1.1  itojun #define		APM_EVENT_MASK		0xffff
     73        1.1  itojun 
     74        1.1  itojun #define	APM_EVENT_COMPOSE(t,i)	((((i) & 0x7fff) << 16)|((t) & APM_EVENT_MASK))
     75        1.1  itojun #define	APM_EVENT_TYPE(e)	((e) & APM_EVENT_MASK)
     76        1.1  itojun #define	APM_EVENT_INDEX(e)	((e) >> 16)
     77        1.1  itojun 
     78        1.2      he #include <dev/apm/apmio.h>
     79        1.2      he 
     80        1.1  itojun #define APM_BATTERY_ABSENT 4
     81        1.1  itojun 
     82        1.1  itojun #define APM_IOC_PRN_CTL _IOW('A', 6, int ) /* driver power status msg */
     83        1.1  itojun #define		APM_PRINT_ON	0	/* driver power status displayed */
     84        1.1  itojun #define		APM_PRINT_OFF	1	/* driver power status not displayed */
     85        1.1  itojun #define		APM_PRINT_PCT	2	/* driver power status only displayed
     86        1.1  itojun 					   if the percentage changes */
     87        1.1  itojun 
     88        1.1  itojun #endif /* _MACPPC_APMVAR_H_ */
     89