import of ftp.dlink.com/GPL/DSMG-600_reB/ppclinux.tar.gz
[linux-2.4.21-pre4.git] / drivers / acpi / include / acnamesp.h
1 /******************************************************************************
2  *
3  * Name: acnamesp.h - Namespace subcomponent prototypes and defines
4  *       $Revision: 1.1.1.1 $
5  *
6  *****************************************************************************/
7
8 /*
9  *  Copyright (C) 2000, 2001 R. Byron Moore
10  *
11  *  This program is free software; you can redistribute it and/or modify
12  *  it under the terms of the GNU General Public License as published by
13  *  the Free Software Foundation; either version 2 of the License, or
14  *  (at your option) any later version.
15  *
16  *  This program is distributed in the hope that it will be useful,
17  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  *  GNU General Public License for more details.
20  *
21  *  You should have received a copy of the GNU General Public License
22  *  along with this program; if not, write to the Free Software
23  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
24  */
25
26 #ifndef __ACNAMESP_H__
27 #define __ACNAMESP_H__
28
29
30 /* To search the entire name space, pass this as Search_base */
31
32 #define NS_ALL                  ((acpi_handle)0)
33
34 /*
35  * Elements of Acpi_ns_properties are bit significant
36  * and should be one-to-one with values of acpi_object_type
37  */
38 #define NSP_NORMAL              0
39 #define NSP_NEWSCOPE            1   /* a definition of this type opens a name scope */
40 #define NSP_LOCAL               2   /* suppress search of enclosing scopes */
41
42
43 /* Definitions of the predefined namespace names  */
44
45 #define ACPI_UNKNOWN_NAME       (u32) 0x3F3F3F3F     /* Unknown name is  "????" */
46 #define ACPI_ROOT_NAME          (u32) 0x2F202020     /* Root name is     "/   " */
47 #define ACPI_SYS_BUS_NAME       (u32) 0x5F53425F     /* Sys bus name is  "_SB_" */
48
49 #define NS_ROOT_PATH            "/"
50 #define NS_SYSTEM_BUS           "_SB_"
51
52
53 /* Flags for Acpi_ns_lookup, Acpi_ns_search_and_enter */
54
55 #define NS_NO_UPSEARCH          0
56 #define NS_SEARCH_PARENT        0x01
57 #define NS_DONT_OPEN_SCOPE      0x02
58 #define NS_NO_PEER_SEARCH       0x04
59 #define NS_ERROR_IF_FOUND       0x08
60
61 #define NS_WALK_UNLOCK          TRUE
62 #define NS_WALK_NO_UNLOCK       FALSE
63
64
65 acpi_status
66 acpi_ns_load_namespace (
67         void);
68
69 acpi_status
70 acpi_ns_initialize_objects (
71         void);
72
73 acpi_status
74 acpi_ns_initialize_devices (
75         void);
76
77
78 /* Namespace init - nsxfinit */
79
80 acpi_status
81 acpi_ns_init_one_device (
82         acpi_handle             obj_handle,
83         u32                     nesting_level,
84         void                    *context,
85         void                    **return_value);
86
87 acpi_status
88 acpi_ns_init_one_object (
89         acpi_handle             obj_handle,
90         u32                     level,
91         void                    *context,
92         void                    **return_value);
93
94
95 acpi_status
96 acpi_ns_walk_namespace (
97         acpi_object_type8       type,
98         acpi_handle             start_object,
99         u32                     max_depth,
100         u8                      unlock_before_callback,
101         acpi_walk_callback      user_function,
102         void                    *context,
103         void                    **return_value);
104
105 acpi_namespace_node *
106 acpi_ns_get_next_node (
107         acpi_object_type8       type,
108         acpi_namespace_node     *parent,
109         acpi_namespace_node     *child);
110
111 acpi_status
112 acpi_ns_delete_namespace_by_owner (
113         u16                     table_id);
114
115
116 /* Namespace loading - nsload */
117
118 acpi_status
119 acpi_ns_one_complete_parse (
120         u32                     pass_number,
121         acpi_table_desc         *table_desc);
122
123 acpi_status
124 acpi_ns_parse_table (
125         acpi_table_desc         *table_desc,
126         acpi_namespace_node     *scope);
127
128 acpi_status
129 acpi_ns_load_table (
130         acpi_table_desc         *table_desc,
131         acpi_namespace_node     *node);
132
133 acpi_status
134 acpi_ns_load_table_by_type (
135         acpi_table_type         table_type);
136
137
138 /*
139  * Top-level namespace access - nsaccess
140  */
141
142
143 acpi_status
144 acpi_ns_root_initialize (
145         void);
146
147 acpi_status
148 acpi_ns_lookup (
149         acpi_generic_state      *scope_info,
150         NATIVE_CHAR             *name,
151         acpi_object_type8       type,
152         operating_mode          interpreter_mode,
153         u32                     flags,
154         acpi_walk_state         *walk_state,
155         acpi_namespace_node     **ret_node);
156
157
158 /*
159  * Named object allocation/deallocation - nsalloc
160  */
161
162
163 acpi_namespace_node *
164 acpi_ns_create_node (
165         u32                     name);
166
167 void
168 acpi_ns_delete_node (
169         acpi_namespace_node     *node);
170
171 acpi_status
172 acpi_ns_delete_namespace_subtree (
173         acpi_namespace_node     *parent_handle);
174
175 void
176 acpi_ns_detach_object (
177         acpi_namespace_node     *node);
178
179 void
180 acpi_ns_delete_children (
181         acpi_namespace_node     *parent);
182
183
184 /*
185  * Namespace modification - nsmodify
186  */
187
188 acpi_status
189 acpi_ns_unload_namespace (
190         acpi_handle             handle);
191
192 acpi_status
193 acpi_ns_delete_subtree (
194         acpi_handle             start_handle);
195
196
197 /*
198  * Namespace dump/print utilities - nsdump
199  */
200
201 void
202 acpi_ns_dump_tables (
203         acpi_handle             search_base,
204         u32                     max_depth);
205
206 void
207 acpi_ns_dump_entry (
208         acpi_handle             handle,
209         u32                     debug_level);
210
211 acpi_status
212 acpi_ns_dump_pathname (
213         acpi_handle             handle,
214         NATIVE_CHAR             *msg,
215         u32                     level,
216         u32                     component);
217
218 void
219 acpi_ns_dump_root_devices (
220         void);
221
222 void
223 acpi_ns_dump_objects (
224         acpi_object_type8       type,
225         u8                      display_type,
226         u32                     max_depth,
227         u32                     ownder_id,
228         acpi_handle             start_handle);
229
230
231 /*
232  * Namespace evaluation functions - nseval
233  */
234
235 acpi_status
236 acpi_ns_evaluate_by_handle (
237         acpi_namespace_node     *prefix_node,
238         acpi_operand_object     **params,
239         acpi_operand_object     **return_object);
240
241 acpi_status
242 acpi_ns_evaluate_by_name (
243         NATIVE_CHAR             *pathname,
244         acpi_operand_object     **params,
245         acpi_operand_object     **return_object);
246
247 acpi_status
248 acpi_ns_evaluate_relative (
249         acpi_namespace_node     *prefix_node,
250         NATIVE_CHAR             *pathname,
251         acpi_operand_object     **params,
252         acpi_operand_object     **return_object);
253
254 acpi_status
255 acpi_ns_execute_control_method (
256         acpi_namespace_node     *method_node,
257         acpi_operand_object     **params,
258         acpi_operand_object     **return_obj_desc);
259
260 acpi_status
261 acpi_ns_get_object_value (
262         acpi_namespace_node     *object_node,
263         acpi_operand_object     **return_obj_desc);
264
265
266 /*
267  * Parent/Child/Peer utility functions - nsfamily
268  */
269
270 acpi_name
271 acpi_ns_find_parent_name (
272         acpi_namespace_node     *node_to_search);
273
274 u8
275 acpi_ns_exist_downstream_sibling (
276         acpi_namespace_node     *this_node);
277
278
279 /*
280  * Scope manipulation - nsscope
281  */
282
283 u32
284 acpi_ns_opens_scope (
285         acpi_object_type8       type);
286
287 NATIVE_CHAR *
288 acpi_ns_get_table_pathname (
289         acpi_namespace_node     *node);
290
291 NATIVE_CHAR *
292 acpi_ns_name_of_current_scope (
293         acpi_walk_state         *walk_state);
294
295 acpi_status
296 acpi_ns_handle_to_pathname (
297         acpi_handle             obj_handle,
298         u32                     *buf_size,
299         NATIVE_CHAR             *user_buffer);
300
301 u8
302 acpi_ns_pattern_match (
303         acpi_namespace_node     *obj_node,
304         NATIVE_CHAR             *search_for);
305
306 acpi_status
307 acpi_ns_get_node (
308         NATIVE_CHAR             *pathname,
309         acpi_namespace_node     *in_prefix_node,
310         acpi_namespace_node     **out_node);
311
312 u32
313 acpi_ns_get_pathname_length (
314         acpi_namespace_node     *node);
315
316
317 /*
318  * Object management for NTEs - nsobject
319  */
320
321 acpi_status
322 acpi_ns_attach_object (
323         acpi_namespace_node     *node,
324         acpi_operand_object     *object,
325         acpi_object_type8       type);
326
327
328 /*
329  * Namespace searching and entry - nssearch
330  */
331
332 acpi_status
333 acpi_ns_search_and_enter (
334         u32                     entry_name,
335         acpi_walk_state         *walk_state,
336         acpi_namespace_node     *node,
337         operating_mode          interpreter_mode,
338         acpi_object_type8       type,
339         u32                     flags,
340         acpi_namespace_node     **ret_node);
341
342 acpi_status
343 acpi_ns_search_node (
344         u32                     entry_name,
345         acpi_namespace_node     *node,
346         acpi_object_type8       type,
347         acpi_namespace_node     **ret_node);
348
349 void
350 acpi_ns_install_node (
351         acpi_walk_state         *walk_state,
352         acpi_namespace_node     *parent_node,   /* Parent */
353         acpi_namespace_node     *node,      /* New Child*/
354         acpi_object_type8       type);
355
356
357 /*
358  * Utility functions - nsutils
359  */
360
361 u8
362 acpi_ns_valid_root_prefix (
363         NATIVE_CHAR             prefix);
364
365 u8
366 acpi_ns_valid_path_separator (
367         NATIVE_CHAR             sep);
368
369 acpi_object_type8
370 acpi_ns_get_type (
371         acpi_namespace_node     *node);
372
373 void *
374 acpi_ns_get_attached_object (
375         acpi_namespace_node     *node);
376
377 u32
378 acpi_ns_local (
379         acpi_object_type8       type);
380
381 acpi_status
382 acpi_ns_build_internal_name (
383         acpi_namestring_info    *info);
384
385 acpi_status
386 acpi_ns_get_internal_name_length (
387         acpi_namestring_info    *info);
388
389 acpi_status
390 acpi_ns_internalize_name (
391         NATIVE_CHAR             *dotted_name,
392         NATIVE_CHAR             **converted_name);
393
394 acpi_status
395 acpi_ns_externalize_name (
396         u32                     internal_name_length,
397         NATIVE_CHAR             *internal_name,
398         u32                     *converted_name_length,
399         NATIVE_CHAR             **converted_name);
400
401 acpi_namespace_node *
402 acpi_ns_map_handle_to_node (
403         acpi_handle             handle);
404
405 acpi_handle
406 acpi_ns_convert_entry_to_handle(
407         acpi_namespace_node     *node);
408
409 void
410 acpi_ns_terminate (
411         void);
412
413 acpi_namespace_node *
414 acpi_ns_get_parent_object (
415         acpi_namespace_node     *node);
416
417
418 acpi_namespace_node *
419 acpi_ns_get_next_valid_node (
420         acpi_namespace_node     *node);
421
422
423 #endif /* __ACNAMESP_H__ */