Dr Andrew Scott G7VAV

My photo
 
June 2025
Mo Tu We Th Fr Sa Su
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6


apm_bios.h
001: #ifndef _LINUX_APM_H
002: #define _LINUX_APM_H
003: 
004: /*
005:  * Include file for the interface to an APM BIOS
006:  * Copyright 1994-2001 Stephen Rothwell (sfr@canb.auug.org.au)
007:  *
008:  * This program is free software; you can redistribute it and/or modify it
009:  * under the terms of the GNU General Public License as published by the
010:  * Free Software Foundation; either version 2, or (at your option) any
011:  * later version.
012:  *
013:  * This program is distributed in the hope that it will be useful, but
014:  * WITHOUT ANY WARRANTY; without even the implied warranty of
015:  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
016:  * General Public License for more details.
017:  */
018: 
019: #include <linux/types.h>
020: 
021: typedef unsigned short  apm_event_t;
022: typedef unsigned short  apm_eventinfo_t;
023: 
024: struct apm_bios_info {
025:         __u16   version;
026:         __u16   cseg;
027:         __u32   offset;
028:         __u16   cseg_16;
029:         __u16   dseg;
030:         __u16   flags;
031:         __u16   cseg_len;
032:         __u16   cseg_16_len;
033:         __u16   dseg_len;
034: };
035: 
036: 
037: /*
038:  * Power states
039:  */
040: #define APM_STATE_READY         0x0000
041: #define APM_STATE_STANDBY       0x0001
042: #define APM_STATE_SUSPEND       0x0002
043: #define APM_STATE_OFF           0x0003
044: #define APM_STATE_BUSY          0x0004
045: #define APM_STATE_REJECT        0x0005
046: #define APM_STATE_OEM_SYS       0x0020
047: #define APM_STATE_OEM_DEV       0x0040
048: 
049: #define APM_STATE_DISABLE       0x0000
050: #define APM_STATE_ENABLE        0x0001
051: 
052: #define APM_STATE_DISENGAGE     0x0000
053: #define APM_STATE_ENGAGE        0x0001
054: 
055: /*
056:  * Events (results of Get PM Event)
057:  */
058: #define APM_SYS_STANDBY         0x0001
059: #define APM_SYS_SUSPEND         0x0002
060: #define APM_NORMAL_RESUME       0x0003
061: #define APM_CRITICAL_RESUME     0x0004
062: #define APM_LOW_BATTERY         0x0005
063: #define APM_POWER_STATUS_CHANGE 0x0006
064: #define APM_UPDATE_TIME         0x0007
065: #define APM_CRITICAL_SUSPEND    0x0008
066: #define APM_USER_STANDBY        0x0009
067: #define APM_USER_SUSPEND        0x000a
068: #define APM_STANDBY_RESUME      0x000b
069: #define APM_CAPABILITY_CHANGE   0x000c
070: 
071: /*
072:  * Error codes
073:  */
074: #define APM_SUCCESS             0x00
075: #define APM_DISABLED            0x01
076: #define APM_CONNECTED           0x02
077: #define APM_NOT_CONNECTED       0x03
078: #define APM_16_CONNECTED        0x05
079: #define APM_16_UNSUPPORTED      0x06
080: #define APM_32_CONNECTED        0x07
081: #define APM_32_UNSUPPORTED      0x08
082: #define APM_BAD_DEVICE          0x09
083: #define APM_BAD_PARAM           0x0a
084: #define APM_NOT_ENGAGED         0x0b
085: #define APM_BAD_FUNCTION        0x0c
086: #define APM_RESUME_DISABLED     0x0d
087: #define APM_NO_ERROR            0x53
088: #define APM_BAD_STATE           0x60
089: #define APM_NO_EVENTS           0x80
090: #define APM_NOT_PRESENT         0x86
091: 
092: /*
093:  * APM Device IDs
094:  */
095: #define APM_DEVICE_BIOS         0x0000
096: #define APM_DEVICE_ALL          0x0001
097: #define APM_DEVICE_DISPLAY      0x0100
098: #define APM_DEVICE_STORAGE      0x0200
099: #define APM_DEVICE_PARALLEL     0x0300
100: #define APM_DEVICE_SERIAL       0x0400
101: #define APM_DEVICE_NETWORK      0x0500
102: #define APM_DEVICE_PCMCIA       0x0600
103: #define APM_DEVICE_BATTERY      0x8000
104: #define APM_DEVICE_OEM          0xe000
105: #define APM_DEVICE_OLD_ALL      0xffff
106: #define APM_DEVICE_CLASS        0x00ff
107: #define APM_DEVICE_MASK         0xff00
108: 
109: 
110: /*
111:  * Battery status
112:  */
113: #define APM_MAX_BATTERIES       2
114: 
115: /*
116:  * APM defined capability bit flags
117:  */
118: #define APM_CAP_GLOBAL_STANDBY          0x0001
119: #define APM_CAP_GLOBAL_SUSPEND          0x0002
120: #define APM_CAP_RESUME_STANDBY_TIMER    0x0004 /* Timer resume from standby */
121: #define APM_CAP_RESUME_SUSPEND_TIMER    0x0008 /* Timer resume from suspend */
122: #define APM_CAP_RESUME_STANDBY_RING     0x0010 /* Resume on Ring fr standby */
123: #define APM_CAP_RESUME_SUSPEND_RING     0x0020 /* Resume on Ring fr suspend */
124: #define APM_CAP_RESUME_STANDBY_PCMCIA   0x0040 /* Resume on PCMCIA Ring */
125: #define APM_CAP_RESUME_SUSPEND_PCMCIA   0x0080 /* Resume on PCMCIA Ring */
126: 
127: /*
128:  * ioctl operations
129:  */
130: #include <linux/ioctl.h>
131: 
132: #define APM_IOC_STANDBY         _IO('A', 1)
133: #define APM_IOC_SUSPEND         _IO('A', 2)
134: 
135: #endif  /* LINUX_APM_H */
136: 


for client (none)
© Andrew Scott 2006 - 2025,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/