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
6 * Copyright (C) 1992-1997,2000-2003 Silicon Graphics, Inc. All rights reserved.
8 #ifndef _ASM_IA64_SN_HCL_H
9 #define _ASM_IA64_SN_HCL_H
12 #include <asm/sn/sgi.h>
14 extern vertex_hdl_t hwgraph_root
;
15 extern vertex_hdl_t linux_busnum
;
17 void hwgraph_debug(char *, const char *, int, vertex_hdl_t
, vertex_hdl_t
, char *, ...);
20 #define HWGRAPH_DEBUG(args...) hwgraph_debug(args)
22 #define HWGRAPH_DEBUG(args)
25 typedef long labelcl_info_place_t
;
26 typedef long arbitrary_info_t
;
27 typedef long arb_info_desc_t
;
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.
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 */
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.
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
51 * Special pre-defined edge labels.
53 #define HWGRAPH_EDGELBL_HW "hw"
54 #define HWGRAPH_EDGELBL_DOT "."
55 #define HWGRAPH_EDGELBL_DOTDOT ".."
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)
65 * External declarations of EXPORTED SYMBOLS in hcl.c
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 *);
71 extern int hwgraph_mk_symlink(vertex_hdl_t
, const char *, unsigned int,
72 unsigned int, const char *, unsigned int, vertex_hdl_t
*, void *);
74 extern int hwgraph_vertex_destroy(vertex_hdl_t
);
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
*);
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 *);
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 *);
86 extern graph_error_t
hwgraph_traverse(vertex_hdl_t
, char *, vertex_hdl_t
*);
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
,
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);
107 #endif /* _ASM_IA64_SN_HCL_H */