• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _DEVICE_H_
20 #define _DEVICE_H_
21 #include <linux/ioport.h>
22 #include <linux/kobject.h>
23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24 #include <linux/klist.h>
25 #include <linux/list.h>
26 #include <linux/types.h>
27 #include <linux/module.h>
28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29 #include <linux/pm.h>
30 #include <asm/semaphore.h>
31 #include <asm/atomic.h>
32 #define DEVICE_NAME_SIZE 50
33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34 #define DEVICE_NAME_HALF __stringify(20)
35 #define DEVICE_ID_SIZE 32
36 #define BUS_ID_SIZE KOBJ_NAME_LEN
37 struct device;
38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39 struct device_driver;
40 struct class;
41 struct class_device;
42 struct bus_type {
43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44  const char * name;
45  struct subsystem subsys;
46  struct kset drivers;
47  struct kset devices;
48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49  struct klist klist_devices;
50  struct klist klist_drivers;
51  struct bus_attribute * bus_attrs;
52  struct device_attribute * dev_attrs;
53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54  struct driver_attribute * drv_attrs;
55  int (*match)(struct device * dev, struct device_driver * drv);
56  int (*uevent)(struct device *dev, char **envp,
57  int num_envp, char *buffer, int buffer_size);
58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59  int (*probe)(struct device * dev);
60  int (*remove)(struct device * dev);
61  void (*shutdown)(struct device * dev);
62  int (*suspend)(struct device * dev, pm_message_t state);
63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64  int (*resume)(struct device * dev);
65 };
66 struct device * bus_find_device(struct bus_type *bus, struct device *start,
67  void *data, int (*match)(struct device *, void *));
68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69 struct bus_attribute {
70  struct attribute attr;
71  ssize_t (*show)(struct bus_type *, char * buf);
72  ssize_t (*store)(struct bus_type *, const char * buf, size_t count);
73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74 };
75 #define BUS_ATTR(_name,_mode,_show,_store)  struct bus_attribute bus_attr_##_name = __ATTR(_name,_mode,_show,_store)
76 struct device_driver {
77  const char * name;
78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79  struct bus_type * bus;
80  struct completion unloaded;
81  struct kobject kobj;
82  struct klist klist_devices;
83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84  struct klist_node knode_bus;
85  struct module * owner;
86  int (*probe) (struct device * dev);
87  int (*remove) (struct device * dev);
88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89  void (*shutdown) (struct device * dev);
90  int (*suspend) (struct device * dev, pm_message_t state);
91  int (*resume) (struct device * dev);
92 };
93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94 struct driver_attribute {
95  struct attribute attr;
96  ssize_t (*show)(struct device_driver *, char * buf);
97  ssize_t (*store)(struct device_driver *, const char * buf, size_t count);
98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99 };
100 #define DRIVER_ATTR(_name,_mode,_show,_store)  struct driver_attribute driver_attr_##_name = __ATTR(_name,_mode,_show,_store)
101 struct device * driver_find_device(struct device_driver *drv,
102  struct device *start, void *data,
103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104  int (*match)(struct device *, void *));
105 struct class {
106  const char * name;
107  struct module * owner;
108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109  struct subsystem subsys;
110  struct list_head children;
111  struct list_head devices;
112  struct list_head interfaces;
113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114  struct semaphore sem;
115  struct class_attribute * class_attrs;
116  struct class_device_attribute * class_dev_attrs;
117  int (*uevent)(struct class_device *dev, char **envp,
118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119  int num_envp, char *buffer, int buffer_size);
120  void (*release)(struct class_device *dev);
121  void (*class_release)(struct class *class);
122 };
123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124 struct class_attribute {
125  struct attribute attr;
126  ssize_t (*show)(struct class *, char * buf);
127  ssize_t (*store)(struct class *, const char * buf, size_t count);
128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129 };
130 #define CLASS_ATTR(_name,_mode,_show,_store)  struct class_attribute class_attr_##_name = __ATTR(_name,_mode,_show,_store)
131 struct class_device_attribute {
132  struct attribute attr;
133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134  ssize_t (*show)(struct class_device *, char * buf);
135  ssize_t (*store)(struct class_device *, const char * buf, size_t count);
136 };
137 #define CLASS_DEVICE_ATTR(_name,_mode,_show,_store)  struct class_device_attribute class_device_attr_##_name =   __ATTR(_name,_mode,_show,_store)
138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139 struct class_device {
140  struct list_head node;
141  struct kobject kobj;
142  struct class * class;
143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144  dev_t devt;
145  struct class_device_attribute *devt_attr;
146  struct class_device_attribute uevent_attr;
147  struct device * dev;
148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149  void * class_data;
150  struct class_device *parent;
151  struct attribute_group ** groups;
152  void (*release)(struct class_device *dev);
153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154  int (*uevent)(struct class_device *dev, char **envp,
155  int num_envp, char *buffer, int buffer_size);
156  char class_id[BUS_ID_SIZE];
157 };
158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159 struct class_interface {
160  struct list_head node;
161  struct class *class;
162  int (*add) (struct class_device *, struct class_interface *);
163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164  void (*remove) (struct class_device *, struct class_interface *);
165 };
166 struct device_attribute {
167  struct attribute attr;
168 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169  ssize_t (*show)(struct device *dev, struct device_attribute *attr,
170  char *buf);
171  ssize_t (*store)(struct device *dev, struct device_attribute *attr,
172  const char *buf, size_t count);
173 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
174 };
175 #define DEVICE_ATTR(_name,_mode,_show,_store)  struct device_attribute dev_attr_##_name = __ATTR(_name,_mode,_show,_store)
176 struct device {
177  struct klist klist_children;
178 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
179  struct klist_node knode_parent;
180  struct klist_node knode_driver;
181  struct klist_node knode_bus;
182  struct device * parent;
183 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
184  struct kobject kobj;
185  char bus_id[BUS_ID_SIZE];
186  struct device_attribute uevent_attr;
187  struct device_attribute *devt_attr;
188 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
189  struct semaphore sem;
190  struct bus_type * bus;
191  struct device_driver *driver;
192  void *driver_data;
193 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
194  void *platform_data;
195  void *firmware_data;
196  struct dev_pm_info power;
197  u64 *dma_mask;
198 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
199  u64 coherent_dma_mask;
200  struct list_head dma_pools;
201  struct dma_coherent_mem *dma_mem;
202  struct list_head node;
203 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
204  struct class *class;
205  dev_t devt;
206  void (*release)(struct device * dev);
207 };
208 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
209 #define dev_printk(level, dev, format, arg...)   printk(level "%s %s: " format , dev_driver_string(dev) , (dev)->bus_id , ## arg)
210 #ifdef DEBUG
211 #define dev_dbg(dev, format, arg...)   dev_printk(KERN_DEBUG , dev , format , ## arg)
212 #else
213 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
214 #define dev_dbg(dev, format, arg...) do { (void)(dev); } while (0)
215 #endif
216 #define dev_err(dev, format, arg...)   dev_printk(KERN_ERR , dev , format , ## arg)
217 #define dev_info(dev, format, arg...)   dev_printk(KERN_INFO , dev , format , ## arg)
218 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
219 #define dev_warn(dev, format, arg...)   dev_printk(KERN_WARNING , dev , format , ## arg)
220 #define dev_notice(dev, format, arg...)   dev_printk(KERN_NOTICE , dev , format , ## arg)
221 #define MODULE_ALIAS_CHARDEV(major,minor)   MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor))
222 #define MODULE_ALIAS_CHARDEV_MAJOR(major)   MODULE_ALIAS("char-major-" __stringify(major) "-*")
223 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
224 #endif
225