1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linu << 2 /* 1 /* 3 * Include file for the interface to an APM BI 2 * Include file for the interface to an APM BIOS 4 * Copyright 1994-2001 Stephen Rothwell (sfr@c 3 * Copyright 1994-2001 Stephen Rothwell (sfr@canb.auug.org.au) 5 * 4 * 6 * This program is free software; you can redi 5 * This program is free software; you can redistribute it and/or modify it 7 * under the terms of the GNU General Public L 6 * under the terms of the GNU General Public License as published by the 8 * Free Software Foundation; either version 2, 7 * Free Software Foundation; either version 2, or (at your option) any 9 * later version. 8 * later version. 10 * 9 * 11 * This program is distributed in the hope tha 10 * This program is distributed in the hope that it will be useful, but 12 * WITHOUT ANY WARRANTY; without even the impl 11 * WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * General Public License for more details. 13 * General Public License for more details. 15 */ 14 */ 16 #ifndef _UAPI_LINUX_APM_H 15 #ifndef _UAPI_LINUX_APM_H 17 #define _UAPI_LINUX_APM_H 16 #define _UAPI_LINUX_APM_H 18 17 19 18 20 #include <linux/types.h> 19 #include <linux/types.h> 21 20 22 typedef unsigned short apm_event_t; 21 typedef unsigned short apm_event_t; 23 typedef unsigned short apm_eventinfo_t; 22 typedef unsigned short apm_eventinfo_t; 24 23 25 struct apm_bios_info { 24 struct apm_bios_info { 26 __u16 version; 25 __u16 version; 27 __u16 cseg; 26 __u16 cseg; 28 __u32 offset; 27 __u32 offset; 29 __u16 cseg_16; 28 __u16 cseg_16; 30 __u16 dseg; 29 __u16 dseg; 31 __u16 flags; 30 __u16 flags; 32 __u16 cseg_len; 31 __u16 cseg_len; 33 __u16 cseg_16_len; 32 __u16 cseg_16_len; 34 __u16 dseg_len; 33 __u16 dseg_len; 35 }; 34 }; 36 35 37 36 38 /* 37 /* 39 * Power states 38 * Power states 40 */ 39 */ 41 #define APM_STATE_READY 0x0000 40 #define APM_STATE_READY 0x0000 42 #define APM_STATE_STANDBY 0x0001 41 #define APM_STATE_STANDBY 0x0001 43 #define APM_STATE_SUSPEND 0x0002 42 #define APM_STATE_SUSPEND 0x0002 44 #define APM_STATE_OFF 0x0003 43 #define APM_STATE_OFF 0x0003 45 #define APM_STATE_BUSY 0x0004 44 #define APM_STATE_BUSY 0x0004 46 #define APM_STATE_REJECT 0x0005 45 #define APM_STATE_REJECT 0x0005 47 #define APM_STATE_OEM_SYS 0x0020 46 #define APM_STATE_OEM_SYS 0x0020 48 #define APM_STATE_OEM_DEV 0x0040 47 #define APM_STATE_OEM_DEV 0x0040 49 48 50 #define APM_STATE_DISABLE 0x0000 49 #define APM_STATE_DISABLE 0x0000 51 #define APM_STATE_ENABLE 0x0001 50 #define APM_STATE_ENABLE 0x0001 52 51 53 #define APM_STATE_DISENGAGE 0x0000 52 #define APM_STATE_DISENGAGE 0x0000 54 #define APM_STATE_ENGAGE 0x0001 53 #define APM_STATE_ENGAGE 0x0001 55 54 56 /* 55 /* 57 * Events (results of Get PM Event) 56 * Events (results of Get PM Event) 58 */ 57 */ 59 #define APM_SYS_STANDBY 0x0001 58 #define APM_SYS_STANDBY 0x0001 60 #define APM_SYS_SUSPEND 0x0002 59 #define APM_SYS_SUSPEND 0x0002 61 #define APM_NORMAL_RESUME 0x0003 60 #define APM_NORMAL_RESUME 0x0003 62 #define APM_CRITICAL_RESUME 0x0004 61 #define APM_CRITICAL_RESUME 0x0004 63 #define APM_LOW_BATTERY 0x0005 62 #define APM_LOW_BATTERY 0x0005 64 #define APM_POWER_STATUS_CHANGE 0x0006 63 #define APM_POWER_STATUS_CHANGE 0x0006 65 #define APM_UPDATE_TIME 0x0007 64 #define APM_UPDATE_TIME 0x0007 66 #define APM_CRITICAL_SUSPEND 0x0008 65 #define APM_CRITICAL_SUSPEND 0x0008 67 #define APM_USER_STANDBY 0x0009 66 #define APM_USER_STANDBY 0x0009 68 #define APM_USER_SUSPEND 0x000a 67 #define APM_USER_SUSPEND 0x000a 69 #define APM_STANDBY_RESUME 0x000b 68 #define APM_STANDBY_RESUME 0x000b 70 #define APM_CAPABILITY_CHANGE 0x000c 69 #define APM_CAPABILITY_CHANGE 0x000c 71 #define APM_USER_HIBERNATION 0x000d 70 #define APM_USER_HIBERNATION 0x000d 72 #define APM_HIBERNATION_RESUME 0x000e 71 #define APM_HIBERNATION_RESUME 0x000e 73 72 74 /* 73 /* 75 * Error codes 74 * Error codes 76 */ 75 */ 77 #define APM_SUCCESS 0x00 76 #define APM_SUCCESS 0x00 78 #define APM_DISABLED 0x01 77 #define APM_DISABLED 0x01 79 #define APM_CONNECTED 0x02 78 #define APM_CONNECTED 0x02 80 #define APM_NOT_CONNECTED 0x03 79 #define APM_NOT_CONNECTED 0x03 81 #define APM_16_CONNECTED 0x05 80 #define APM_16_CONNECTED 0x05 82 #define APM_16_UNSUPPORTED 0x06 81 #define APM_16_UNSUPPORTED 0x06 83 #define APM_32_CONNECTED 0x07 82 #define APM_32_CONNECTED 0x07 84 #define APM_32_UNSUPPORTED 0x08 83 #define APM_32_UNSUPPORTED 0x08 85 #define APM_BAD_DEVICE 0x09 84 #define APM_BAD_DEVICE 0x09 86 #define APM_BAD_PARAM 0x0a 85 #define APM_BAD_PARAM 0x0a 87 #define APM_NOT_ENGAGED 0x0b 86 #define APM_NOT_ENGAGED 0x0b 88 #define APM_BAD_FUNCTION 0x0c 87 #define APM_BAD_FUNCTION 0x0c 89 #define APM_RESUME_DISABLED 0x0d 88 #define APM_RESUME_DISABLED 0x0d 90 #define APM_NO_ERROR 0x53 89 #define APM_NO_ERROR 0x53 91 #define APM_BAD_STATE 0x60 90 #define APM_BAD_STATE 0x60 92 #define APM_NO_EVENTS 0x80 91 #define APM_NO_EVENTS 0x80 93 #define APM_NOT_PRESENT 0x86 92 #define APM_NOT_PRESENT 0x86 94 93 95 /* 94 /* 96 * APM Device IDs 95 * APM Device IDs 97 */ 96 */ 98 #define APM_DEVICE_BIOS 0x0000 97 #define APM_DEVICE_BIOS 0x0000 99 #define APM_DEVICE_ALL 0x0001 98 #define APM_DEVICE_ALL 0x0001 100 #define APM_DEVICE_DISPLAY 0x0100 99 #define APM_DEVICE_DISPLAY 0x0100 101 #define APM_DEVICE_STORAGE 0x0200 100 #define APM_DEVICE_STORAGE 0x0200 102 #define APM_DEVICE_PARALLEL 0x0300 101 #define APM_DEVICE_PARALLEL 0x0300 103 #define APM_DEVICE_SERIAL 0x0400 102 #define APM_DEVICE_SERIAL 0x0400 104 #define APM_DEVICE_NETWORK 0x0500 103 #define APM_DEVICE_NETWORK 0x0500 105 #define APM_DEVICE_PCMCIA 0x0600 104 #define APM_DEVICE_PCMCIA 0x0600 106 #define APM_DEVICE_BATTERY 0x8000 105 #define APM_DEVICE_BATTERY 0x8000 107 #define APM_DEVICE_OEM 0xe000 106 #define APM_DEVICE_OEM 0xe000 108 #define APM_DEVICE_OLD_ALL 0xffff 107 #define APM_DEVICE_OLD_ALL 0xffff 109 #define APM_DEVICE_CLASS 0x00ff 108 #define APM_DEVICE_CLASS 0x00ff 110 #define APM_DEVICE_MASK 0xff00 109 #define APM_DEVICE_MASK 0xff00 111 110 112 111 113 /* 112 /* 114 * Battery status 113 * Battery status 115 */ 114 */ 116 #define APM_MAX_BATTERIES 2 115 #define APM_MAX_BATTERIES 2 117 116 118 /* 117 /* 119 * APM defined capability bit flags 118 * APM defined capability bit flags 120 */ 119 */ 121 #define APM_CAP_GLOBAL_STANDBY 0x0001 120 #define APM_CAP_GLOBAL_STANDBY 0x0001 122 #define APM_CAP_GLOBAL_SUSPEND 0x0002 121 #define APM_CAP_GLOBAL_SUSPEND 0x0002 123 #define APM_CAP_RESUME_STANDBY_TIMER 0x0004 122 #define APM_CAP_RESUME_STANDBY_TIMER 0x0004 /* Timer resume from standby */ 124 #define APM_CAP_RESUME_SUSPEND_TIMER 0x0008 123 #define APM_CAP_RESUME_SUSPEND_TIMER 0x0008 /* Timer resume from suspend */ 125 #define APM_CAP_RESUME_STANDBY_RING 0x0010 124 #define APM_CAP_RESUME_STANDBY_RING 0x0010 /* Resume on Ring fr standby */ 126 #define APM_CAP_RESUME_SUSPEND_RING 0x0020 125 #define APM_CAP_RESUME_SUSPEND_RING 0x0020 /* Resume on Ring fr suspend */ 127 #define APM_CAP_RESUME_STANDBY_PCMCIA 0x0040 126 #define APM_CAP_RESUME_STANDBY_PCMCIA 0x0040 /* Resume on PCMCIA Ring */ 128 #define APM_CAP_RESUME_SUSPEND_PCMCIA 0x0080 127 #define APM_CAP_RESUME_SUSPEND_PCMCIA 0x0080 /* Resume on PCMCIA Ring */ 129 128 130 /* 129 /* 131 * ioctl operations 130 * ioctl operations 132 */ 131 */ 133 #include <linux/ioctl.h> 132 #include <linux/ioctl.h> 134 133 135 #define APM_IOC_STANDBY _IO('A', 1) 134 #define APM_IOC_STANDBY _IO('A', 1) 136 #define APM_IOC_SUSPEND _IO('A', 2) 135 #define APM_IOC_SUSPEND _IO('A', 2) 137 136 138 #endif /* _UAPI_LINUX_APM_H */ 137 #endif /* _UAPI_LINUX_APM_H */ 139 138
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.