Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
0002 /*
0003  * Include file for the interface to an APM BIOS
0004  * Copyright 1994-2001 Stephen Rothwell (sfr@canb.auug.org.au)
0005  *
0006  * This program is free software; you can redistribute it and/or modify it
0007  * under the terms of the GNU General Public License as published by the
0008  * Free Software Foundation; either version 2, or (at your option) any
0009  * later version.
0010  *
0011  * This program is distributed in the hope that it will be useful, but
0012  * WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * General Public License for more details.
0015  */
0016 #ifndef _UAPI_LINUX_APM_H
0017 #define _UAPI_LINUX_APM_H
0018 
0019 
0020 #include <linux/types.h>
0021 
0022 typedef unsigned short  apm_event_t;
0023 typedef unsigned short  apm_eventinfo_t;
0024 
0025 struct apm_bios_info {
0026     __u16   version;
0027     __u16   cseg;
0028     __u32   offset;
0029     __u16   cseg_16;
0030     __u16   dseg;
0031     __u16   flags;
0032     __u16   cseg_len;
0033     __u16   cseg_16_len;
0034     __u16   dseg_len;
0035 };
0036 
0037 
0038 /*
0039  * Power states
0040  */
0041 #define APM_STATE_READY     0x0000
0042 #define APM_STATE_STANDBY   0x0001
0043 #define APM_STATE_SUSPEND   0x0002
0044 #define APM_STATE_OFF       0x0003
0045 #define APM_STATE_BUSY      0x0004
0046 #define APM_STATE_REJECT    0x0005
0047 #define APM_STATE_OEM_SYS   0x0020
0048 #define APM_STATE_OEM_DEV   0x0040
0049 
0050 #define APM_STATE_DISABLE   0x0000
0051 #define APM_STATE_ENABLE    0x0001
0052 
0053 #define APM_STATE_DISENGAGE 0x0000
0054 #define APM_STATE_ENGAGE    0x0001
0055 
0056 /*
0057  * Events (results of Get PM Event)
0058  */
0059 #define APM_SYS_STANDBY     0x0001
0060 #define APM_SYS_SUSPEND     0x0002
0061 #define APM_NORMAL_RESUME   0x0003
0062 #define APM_CRITICAL_RESUME 0x0004
0063 #define APM_LOW_BATTERY     0x0005
0064 #define APM_POWER_STATUS_CHANGE 0x0006
0065 #define APM_UPDATE_TIME     0x0007
0066 #define APM_CRITICAL_SUSPEND    0x0008
0067 #define APM_USER_STANDBY    0x0009
0068 #define APM_USER_SUSPEND    0x000a
0069 #define APM_STANDBY_RESUME  0x000b
0070 #define APM_CAPABILITY_CHANGE   0x000c
0071 #define APM_USER_HIBERNATION    0x000d
0072 #define APM_HIBERNATION_RESUME  0x000e
0073 
0074 /*
0075  * Error codes
0076  */
0077 #define APM_SUCCESS     0x00
0078 #define APM_DISABLED        0x01
0079 #define APM_CONNECTED       0x02
0080 #define APM_NOT_CONNECTED   0x03
0081 #define APM_16_CONNECTED    0x05
0082 #define APM_16_UNSUPPORTED  0x06
0083 #define APM_32_CONNECTED    0x07
0084 #define APM_32_UNSUPPORTED  0x08
0085 #define APM_BAD_DEVICE      0x09
0086 #define APM_BAD_PARAM       0x0a
0087 #define APM_NOT_ENGAGED     0x0b
0088 #define APM_BAD_FUNCTION    0x0c
0089 #define APM_RESUME_DISABLED 0x0d
0090 #define APM_NO_ERROR        0x53
0091 #define APM_BAD_STATE       0x60
0092 #define APM_NO_EVENTS       0x80
0093 #define APM_NOT_PRESENT     0x86
0094 
0095 /*
0096  * APM Device IDs
0097  */
0098 #define APM_DEVICE_BIOS     0x0000
0099 #define APM_DEVICE_ALL      0x0001
0100 #define APM_DEVICE_DISPLAY  0x0100
0101 #define APM_DEVICE_STORAGE  0x0200
0102 #define APM_DEVICE_PARALLEL 0x0300
0103 #define APM_DEVICE_SERIAL   0x0400
0104 #define APM_DEVICE_NETWORK  0x0500
0105 #define APM_DEVICE_PCMCIA   0x0600
0106 #define APM_DEVICE_BATTERY  0x8000
0107 #define APM_DEVICE_OEM      0xe000
0108 #define APM_DEVICE_OLD_ALL  0xffff
0109 #define APM_DEVICE_CLASS    0x00ff
0110 #define APM_DEVICE_MASK     0xff00
0111 
0112 
0113 /*
0114  * Battery status
0115  */
0116 #define APM_MAX_BATTERIES   2
0117 
0118 /*
0119  * APM defined capability bit flags
0120  */
0121 #define APM_CAP_GLOBAL_STANDBY      0x0001
0122 #define APM_CAP_GLOBAL_SUSPEND      0x0002
0123 #define APM_CAP_RESUME_STANDBY_TIMER    0x0004 /* Timer resume from standby */
0124 #define APM_CAP_RESUME_SUSPEND_TIMER    0x0008 /* Timer resume from suspend */
0125 #define APM_CAP_RESUME_STANDBY_RING 0x0010 /* Resume on Ring fr standby */
0126 #define APM_CAP_RESUME_SUSPEND_RING 0x0020 /* Resume on Ring fr suspend */
0127 #define APM_CAP_RESUME_STANDBY_PCMCIA   0x0040 /* Resume on PCMCIA Ring */
0128 #define APM_CAP_RESUME_SUSPEND_PCMCIA   0x0080 /* Resume on PCMCIA Ring */
0129 
0130 /*
0131  * ioctl operations
0132  */
0133 #include <linux/ioctl.h>
0134 
0135 #define APM_IOC_STANDBY     _IO('A', 1)
0136 #define APM_IOC_SUSPEND     _IO('A', 2)
0137 
0138 #endif /* _UAPI_LINUX_APM_H */