diff options
Diffstat (limited to 'include/linux/apm_bios.h')
| -rw-r--r-- | include/linux/apm_bios.h | 125 |
1 files changed, 3 insertions, 122 deletions
diff --git a/include/linux/apm_bios.h b/include/linux/apm_bios.h index 01a6244c9bc9..9c3a87184f48 100644 --- a/include/linux/apm_bios.h +++ b/include/linux/apm_bios.h | |||
| @@ -1,6 +1,3 @@ | |||
| 1 | #ifndef _LINUX_APM_H | ||
| 2 | #define _LINUX_APM_H | ||
| 3 | |||
| 4 | /* | 1 | /* |
| 5 | * Include file for the interface to an APM BIOS | 2 | * Include file for the interface to an APM BIOS |
| 6 | * Copyright 1994-2001 Stephen Rothwell (sfr@canb.auug.org.au) | 3 | * Copyright 1994-2001 Stephen Rothwell (sfr@canb.auug.org.au) |
| @@ -15,25 +12,11 @@ | |||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 | * General Public License for more details. | 13 | * General Public License for more details. |
| 17 | */ | 14 | */ |
| 15 | #ifndef _LINUX_APM_H | ||
| 16 | #define _LINUX_APM_H | ||
| 18 | 17 | ||
| 19 | #include <linux/types.h> | 18 | #include <uapi/linux/apm_bios.h> |
| 20 | |||
| 21 | typedef unsigned short apm_event_t; | ||
| 22 | typedef unsigned short apm_eventinfo_t; | ||
| 23 | |||
| 24 | struct apm_bios_info { | ||
| 25 | __u16 version; | ||
| 26 | __u16 cseg; | ||
| 27 | __u32 offset; | ||
| 28 | __u16 cseg_16; | ||
| 29 | __u16 dseg; | ||
| 30 | __u16 flags; | ||
| 31 | __u16 cseg_len; | ||
| 32 | __u16 cseg_16_len; | ||
| 33 | __u16 dseg_len; | ||
| 34 | }; | ||
| 35 | 19 | ||
| 36 | #ifdef __KERNEL__ | ||
| 37 | 20 | ||
| 38 | #define APM_CS (GDT_ENTRY_APMBIOS_BASE * 8) | 21 | #define APM_CS (GDT_ENTRY_APMBIOS_BASE * 8) |
| 39 | #define APM_CS_16 (APM_CS + 8) | 22 | #define APM_CS_16 (APM_CS + 8) |
| @@ -110,111 +93,9 @@ struct apm_info { | |||
| 110 | */ | 93 | */ |
| 111 | extern struct apm_info apm_info; | 94 | extern struct apm_info apm_info; |
| 112 | 95 | ||
| 113 | #endif /* __KERNEL__ */ | ||
| 114 | |||
| 115 | /* | ||
| 116 | * Power states | ||
| 117 | */ | ||
| 118 | #define APM_STATE_READY 0x0000 | ||
| 119 | #define APM_STATE_STANDBY 0x0001 | ||
| 120 | #define APM_STATE_SUSPEND 0x0002 | ||
| 121 | #define APM_STATE_OFF 0x0003 | ||
| 122 | #define APM_STATE_BUSY 0x0004 | ||
| 123 | #define APM_STATE_REJECT 0x0005 | ||
| 124 | #define APM_STATE_OEM_SYS 0x0020 | ||
| 125 | #define APM_STATE_OEM_DEV 0x0040 | ||
| 126 | |||
| 127 | #define APM_STATE_DISABLE 0x0000 | ||
| 128 | #define APM_STATE_ENABLE 0x0001 | ||
| 129 | |||
| 130 | #define APM_STATE_DISENGAGE 0x0000 | ||
| 131 | #define APM_STATE_ENGAGE 0x0001 | ||
| 132 | |||
| 133 | /* | ||
| 134 | * Events (results of Get PM Event) | ||
| 135 | */ | ||
| 136 | #define APM_SYS_STANDBY 0x0001 | ||
| 137 | #define APM_SYS_SUSPEND 0x0002 | ||
| 138 | #define APM_NORMAL_RESUME 0x0003 | ||
| 139 | #define APM_CRITICAL_RESUME 0x0004 | ||
| 140 | #define APM_LOW_BATTERY 0x0005 | ||
| 141 | #define APM_POWER_STATUS_CHANGE 0x0006 | ||
| 142 | #define APM_UPDATE_TIME 0x0007 | ||
| 143 | #define APM_CRITICAL_SUSPEND 0x0008 | ||
| 144 | #define APM_USER_STANDBY 0x0009 | ||
| 145 | #define APM_USER_SUSPEND 0x000a | ||
| 146 | #define APM_STANDBY_RESUME 0x000b | ||
| 147 | #define APM_CAPABILITY_CHANGE 0x000c | ||
| 148 | |||
| 149 | /* | ||
| 150 | * Error codes | ||
| 151 | */ | ||
| 152 | #define APM_SUCCESS 0x00 | ||
| 153 | #define APM_DISABLED 0x01 | ||
| 154 | #define APM_CONNECTED 0x02 | ||
| 155 | #define APM_NOT_CONNECTED 0x03 | ||
| 156 | #define APM_16_CONNECTED 0x05 | ||
| 157 | #define APM_16_UNSUPPORTED 0x06 | ||
| 158 | #define APM_32_CONNECTED 0x07 | ||
| 159 | #define APM_32_UNSUPPORTED 0x08 | ||
| 160 | #define APM_BAD_DEVICE 0x09 | ||
| 161 | #define APM_BAD_PARAM 0x0a | ||
| 162 | #define APM_NOT_ENGAGED 0x0b | ||
| 163 | #define APM_BAD_FUNCTION 0x0c | ||
| 164 | #define APM_RESUME_DISABLED 0x0d | ||
| 165 | #define APM_NO_ERROR 0x53 | ||
| 166 | #define APM_BAD_STATE 0x60 | ||
| 167 | #define APM_NO_EVENTS 0x80 | ||
| 168 | #define APM_NOT_PRESENT 0x86 | ||
| 169 | |||
| 170 | /* | ||
| 171 | * APM Device IDs | ||
| 172 | */ | ||
| 173 | #define APM_DEVICE_BIOS 0x0000 | ||
| 174 | #define APM_DEVICE_ALL 0x0001 | ||
| 175 | #define APM_DEVICE_DISPLAY 0x0100 | ||
| 176 | #define APM_DEVICE_STORAGE 0x0200 | ||
| 177 | #define APM_DEVICE_PARALLEL 0x0300 | ||
| 178 | #define APM_DEVICE_SERIAL 0x0400 | ||
| 179 | #define APM_DEVICE_NETWORK 0x0500 | ||
| 180 | #define APM_DEVICE_PCMCIA 0x0600 | ||
| 181 | #define APM_DEVICE_BATTERY 0x8000 | ||
| 182 | #define APM_DEVICE_OEM 0xe000 | ||
| 183 | #define APM_DEVICE_OLD_ALL 0xffff | ||
| 184 | #define APM_DEVICE_CLASS 0x00ff | ||
| 185 | #define APM_DEVICE_MASK 0xff00 | ||
| 186 | |||
| 187 | #ifdef __KERNEL__ | ||
| 188 | /* | 96 | /* |
| 189 | * This is the "All Devices" ID communicated to the BIOS | 97 | * This is the "All Devices" ID communicated to the BIOS |
| 190 | */ | 98 | */ |
| 191 | #define APM_DEVICE_BALL ((apm_info.connection_version > 0x0100) ? \ | 99 | #define APM_DEVICE_BALL ((apm_info.connection_version > 0x0100) ? \ |
| 192 | APM_DEVICE_ALL : APM_DEVICE_OLD_ALL) | 100 | APM_DEVICE_ALL : APM_DEVICE_OLD_ALL) |
| 193 | #endif | ||
| 194 | |||
| 195 | /* | ||
| 196 | * Battery status | ||
| 197 | */ | ||
| 198 | #define APM_MAX_BATTERIES 2 | ||
| 199 | |||
| 200 | /* | ||
| 201 | * APM defined capability bit flags | ||
| 202 | */ | ||
| 203 | #define APM_CAP_GLOBAL_STANDBY 0x0001 | ||
| 204 | #define APM_CAP_GLOBAL_SUSPEND 0x0002 | ||
| 205 | #define APM_CAP_RESUME_STANDBY_TIMER 0x0004 /* Timer resume from standby */ | ||
| 206 | #define APM_CAP_RESUME_SUSPEND_TIMER 0x0008 /* Timer resume from suspend */ | ||
| 207 | #define APM_CAP_RESUME_STANDBY_RING 0x0010 /* Resume on Ring fr standby */ | ||
| 208 | #define APM_CAP_RESUME_SUSPEND_RING 0x0020 /* Resume on Ring fr suspend */ | ||
| 209 | #define APM_CAP_RESUME_STANDBY_PCMCIA 0x0040 /* Resume on PCMCIA Ring */ | ||
| 210 | #define APM_CAP_RESUME_SUSPEND_PCMCIA 0x0080 /* Resume on PCMCIA Ring */ | ||
| 211 | |||
| 212 | /* | ||
| 213 | * ioctl operations | ||
| 214 | */ | ||
| 215 | #include <linux/ioctl.h> | ||
| 216 | |||
| 217 | #define APM_IOC_STANDBY _IO('A', 1) | ||
| 218 | #define APM_IOC_SUSPEND _IO('A', 2) | ||
| 219 | |||
| 220 | #endif /* LINUX_APM_H */ | 101 | #endif /* LINUX_APM_H */ |
