Print this page
PANKOVs restructure
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/hotkey_drv.h
+++ new/usr/src/uts/common/sys/hotkey_drv.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26
27 27 #ifndef _HOTKEY_DRV_H
28 28 #define _HOTKEY_DRV_H
29 29
30 30 #ifdef __cplusplus
↓ open down ↓ |
30 lines elided |
↑ open up ↑ |
31 31 extern "C" {
32 32 #endif
33 33
34 34 #include <sys/types.h>
35 35 #include <sys/conf.h>
36 36 #include <sys/stat.h>
37 37 #include <sys/note.h>
38 38 #include <sys/modctl.h>
39 39 #include <sys/ddi.h>
40 40 #include <sys/sunddi.h>
41 -#include <sys/acpi/acpi.h>
41 +#include <acpica/include/acpi.h>
42 42 #include <sys/acpica.h>
43 43 #include <sys/sysevent/eventdefs.h>
44 44 #include <sys/acpi_drv.h>
45 45
46 46
47 47 #define ID_LEN 9
48 48
49 49 struct acpi_drv_dev {
50 50 ACPI_HANDLE hdl;
51 51 char hid[ID_LEN]; /* ACPI HardwareId */
52 52 char uid[ID_LEN]; /* ACPI UniqueId */
53 53 ACPI_INTEGER adr; /* Bus device Id */
54 54 int valid; /* the device state is valid */
55 55
56 56 /*
57 57 * Unlike most other devices, when a battery is inserted or
58 58 * removed from the system, the device itself(the battery bay)
59 59 * is still considered to be present in the system.
60 60 *
61 61 * Value:
62 62 * 0 -- Off-line
63 63 * 1 -- On-line
64 64 * -1 -- Unknown
65 65 */
66 66 int present;
67 67 enum acpi_drv_type type;
68 68 int index; /* device index */
69 69 int minor;
70 70 };
71 71
72 72 /*
73 73 * hotkey driver soft-state structure
74 74 */
75 75 typedef struct hotkey_drv {
76 76 struct acpi_drv_dev dev;
77 77 dev_info_t *dip;
78 78 void *private; /* Vendor specific structure */
79 79 kmutex_t *hotkey_lock;
80 80 int hotkey_method;
81 81 int modid;
82 82 int (*vendor_ioctl)(struct hotkey_drv *,
83 83 int cmd, intptr_t arg, int mode,
84 84 cred_t *cr, int *rval);
85 85 int (*vendor_fini)(struct hotkey_drv *);
86 86 boolean_t check_acpi_video;
87 87 void *acpi_video;
88 88 } hotkey_drv_t;
89 89
90 90 /*
91 91 * Collection of vendor specific hotkey support
92 92 */
93 93 struct vendor_hotkey_drv {
94 94 const char *vid;
95 95 const char *module;
96 96 boolean_t enable;
97 97 };
98 98
99 99 #define HOTKEY_DRV_OK 0
100 100 #define HOTKEY_DRV_ERR -1
101 101 #define HOTKEY_DBG_NOTICE 0x8000
102 102 #define HOTKEY_DBG_WARN 0x0001
103 103
104 104 #define HOTKEY_METHOD_NONE 0x0
105 105 #define HOTKEY_METHOD_VENDOR 0x1
106 106 #define HOTKEY_METHOD_ACPI_VIDEO 0x2
107 107 #define HOTKEY_METHOD_MISC (HOTKEY_METHOD_VENDOR | \
108 108 HOTKEY_METHOD_ACPI_VIDEO)
109 109 /*
110 110 * Inter-source-file linkage ...
111 111 */
112 112 extern struct hotkey_drv acpi_hotkey;
113 113 extern int hotkey_drv_debug;
114 114 int acpi_drv_set_int(ACPI_HANDLE dev, char *method, uint32_t aint);
115 115 void acpi_drv_gen_sysevent(struct acpi_drv_dev *devp, char *ev, uint32_t val);
116 116 int acpi_drv_dev_init(struct acpi_drv_dev *p);
117 117
118 118 int hotkey_init(hotkey_drv_t *htkp);
119 119 int hotkey_fini(hotkey_drv_t *htkp);
120 120 int acpi_drv_hotkey_ioctl(int cmd, intptr_t arg, int mode, cred_t *cr,
121 121 int *rval);
122 122 int acpi_video_ioctl(void *vidp, int cmd, intptr_t arg, int mode, cred_t *cr,
123 123 int *rval);
124 124 int hotkey_brightness_inc(hotkey_drv_t *htkp);
125 125 int hotkey_brightness_dec(hotkey_drv_t *htkp);
126 126 void hotkey_drv_gen_sysevent(dev_info_t *, char *);
127 127
128 128 #ifdef __cplusplus
129 129 }
130 130 #endif
131 131
132 132 #endif /* _HOTKEY_DRV_H */
↓ open down ↓ |
81 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX