ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / asm-ia64 / sn / hcl.h
1 /*
2  * This file is subject to the terms and conditions of the GNU General Public
3  * License.  See the file "COPYING" in the main directory of this archive
4  * for more details.
5  *
6  * Copyright (C) 1992-1997,2000-2003 Silicon Graphics, Inc. All rights reserved.
7  */
8 #ifndef _ASM_IA64_SN_HCL_H
9 #define _ASM_IA64_SN_HCL_H
10
11 #include <linux/fs.h>
12 #include <asm/sn/sgi.h>
13
14 extern vertex_hdl_t hwgraph_root;
15 extern vertex_hdl_t linux_busnum;
16
17 void hwgraph_debug(char *, const char *, int, vertex_hdl_t, vertex_hdl_t, char *, ...);
18
19 #if 1
20 #define HWGRAPH_DEBUG(args...) hwgraph_debug(args)
21 #else   
22 #define HWGRAPH_DEBUG(args)
23 #endif  
24
25 typedef long            labelcl_info_place_t;
26 typedef long            arbitrary_info_t;
27 typedef long            arb_info_desc_t;
28
29
30 /* 
31  * Reserve room in every vertex for 2 pieces of fast access indexed information 
32  * Note that we do not save a pointer to the bdevsw or cdevsw[] tables anymore.
33  */
34 #define HWGRAPH_NUM_INDEX_INFO  2       /* MAX Entries */
35 #define HWGRAPH_CONNECTPT       0       /* connect point (aprent) */
36 #define HWGRAPH_FASTINFO        1       /* callee's private handle */
37
38 /*
39  * Reserved edge_place_t values, used as the "place" parameter to edge_get_next.
40  * Every vertex in the hwgraph has up to 2 *implicit* edges.  There is an implicit
41  * edge called "." that points to the current vertex.  There is an implicit edge
42  * called ".." that points to the vertex' connect point.
43  */
44 #define EDGE_PLACE_WANT_CURRENT 0       /* "." */
45 #define EDGE_PLACE_WANT_CONNECTPT 1     /* ".." */
46 #define EDGE_PLACE_WANT_REAL_EDGES 2    /* Get the first real edge */
47 #define HWGRAPH_RESERVED_PLACES 2
48
49
50 /*
51  * Special pre-defined edge labels.
52  */
53 #define HWGRAPH_EDGELBL_HW      "hw"
54 #define HWGRAPH_EDGELBL_DOT     "."
55 #define HWGRAPH_EDGELBL_DOTDOT  ".."
56
57 #include <asm/sn/labelcl.h>
58 #define hwgraph_fastinfo_set(a,b) labelcl_info_replace_IDX(a, HWGRAPH_FASTINFO, b, NULL)
59 #define hwgraph_connectpt_set labelcl_info_connectpt_set
60 #define hwgraph_generate_path hwgfs_generate_path
61 #define hwgraph_path_to_vertex(a) hwgfs_find_handle(NULL, a, 0, 0, 0, 1)
62 #define hwgraph_vertex_unref(a)
63
64 /*
65  * External declarations of EXPORTED SYMBOLS in hcl.c
66  */
67 extern vertex_hdl_t hwgraph_register(vertex_hdl_t, const char *,
68         unsigned int, unsigned int, unsigned int, unsigned int,
69         umode_t, uid_t, gid_t, struct file_operations *, void *);
70
71 extern int hwgraph_mk_symlink(vertex_hdl_t, const char *, unsigned int,
72         unsigned int, const char *, unsigned int, vertex_hdl_t *, void *);
73
74 extern int hwgraph_vertex_destroy(vertex_hdl_t);
75
76 extern int hwgraph_edge_add(vertex_hdl_t, vertex_hdl_t, char *);
77 extern int hwgraph_edge_get(vertex_hdl_t, char *, vertex_hdl_t *);
78
79 extern arbitrary_info_t hwgraph_fastinfo_get(vertex_hdl_t);
80 extern vertex_hdl_t hwgraph_mk_dir(vertex_hdl_t, const char *, unsigned int, void *);
81
82 extern int hwgraph_connectpt_set(vertex_hdl_t, vertex_hdl_t);
83 extern vertex_hdl_t hwgraph_connectpt_get(vertex_hdl_t);
84 extern int hwgraph_edge_get_next(vertex_hdl_t, char *, vertex_hdl_t *, unsigned int *);
85
86 extern graph_error_t hwgraph_traverse(vertex_hdl_t, char *, vertex_hdl_t *);
87
88 extern int hwgraph_vertex_get_next(vertex_hdl_t *, vertex_hdl_t *);
89 extern int hwgraph_path_add(vertex_hdl_t, char *, vertex_hdl_t *);
90 extern vertex_hdl_t hwgraph_path_to_dev(char *);
91 extern vertex_hdl_t hwgraph_block_device_get(vertex_hdl_t);
92 extern vertex_hdl_t hwgraph_char_device_get(vertex_hdl_t);
93 extern graph_error_t hwgraph_char_device_add(vertex_hdl_t, char *, char *, vertex_hdl_t *);
94 extern int hwgraph_path_add(vertex_hdl_t, char *, vertex_hdl_t *);
95 extern int hwgraph_info_add_LBL(vertex_hdl_t, char *, arbitrary_info_t);
96 extern int hwgraph_info_get_LBL(vertex_hdl_t, char *, arbitrary_info_t *);
97 extern int hwgraph_info_replace_LBL(vertex_hdl_t, char *, arbitrary_info_t,
98                                     arbitrary_info_t *);
99 extern int hwgraph_info_get_exported_LBL(vertex_hdl_t, char *, int *, arbitrary_info_t *);
100 extern int hwgraph_info_get_next_LBL(vertex_hdl_t, char *, arbitrary_info_t *,
101                                 labelcl_info_place_t *);
102 extern int hwgraph_info_export_LBL(vertex_hdl_t, char *, int);
103 extern int hwgraph_info_unexport_LBL(vertex_hdl_t, char *);
104 extern int hwgraph_info_remove_LBL(vertex_hdl_t, char *, arbitrary_info_t *);
105 extern char *vertex_to_name(vertex_hdl_t, char *, unsigned int);
106
107 #endif /* _ASM_IA64_SN_HCL_H */