3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
7 * Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
9 #ifndef _ASM_IA64_SN_LABELCL_H
10 #define _ASM_IA64_SN_LABELCL_H
12 #define LABELCL_MAGIC 0x4857434c /* 'HWLC' */
13 #define LABEL_LENGTH_MAX 256 /* Includes NULL char */
14 #define INFO_DESC_PRIVATE (-1) /* default */
15 #define INFO_DESC_EXPORT 0 /* export info itself */
18 * Internal Error codes.
20 typedef enum labelcl_error_e { LABELCL_SUCCESS, /* 0 */
22 LABELCL_NOT_FOUND, /* 2 */
23 LABELCL_BAD_PARAM, /* 3 */
24 LABELCL_HIT_LIMIT, /* 4 */
25 LABELCL_CANNOT_ALLOC, /* 5 */
26 LABELCL_ILLEGAL_REQUEST, /* 6 */
27 LABELCL_IN_USE /* 7 */
32 * Description of a label entry.
34 typedef struct label_info_s {
37 arbitrary_info_t info;
41 * Definition of the data structure that provides the link to
42 * the hwgraph fastinfo and the label entries associated with a
43 * particular devfs entry.
45 typedef struct labelcl_info_s {
46 unsigned long hwcl_magic;
47 unsigned long num_labels;
49 arbitrary_info_t IDX_list[HWGRAPH_NUM_INDEX_INFO];
53 * Definitions for the string table that holds the actual names
56 struct string_table_item {
57 struct string_table_item *next;
62 struct string_table_item *string_table_head;
63 long string_table_generation;
67 #define STRTBL_BASIC_SIZE ((size_t)(((struct string_table_item *)0)->string))
68 #define STRTBL_ITEM_SIZE(str_length) (STRTBL_BASIC_SIZE + (str_length) + 1)
70 #define STRTBL_ALLOC(str_length) \
71 ((struct string_table_item *)kmalloc(STRTBL_ITEM_SIZE(str_length), GFP_KERNEL))
73 #define STRTBL_FREE(ptr) kfree(ptr)
76 extern labelcl_info_t *labelcl_info_create(void);
77 extern int labelcl_info_destroy(labelcl_info_t *);
78 extern int labelcl_info_add_LBL(vertex_hdl_t, char *, arb_info_desc_t, arbitrary_info_t);
79 extern int labelcl_info_remove_LBL(vertex_hdl_t, char *, arb_info_desc_t *, arbitrary_info_t *);
80 extern int labelcl_info_replace_LBL(vertex_hdl_t, char *, arb_info_desc_t,
81 arbitrary_info_t, arb_info_desc_t *, arbitrary_info_t *);
82 extern int labelcl_info_get_LBL(vertex_hdl_t, char *, arb_info_desc_t *,
84 extern int labelcl_info_get_next_LBL(vertex_hdl_t, char *, arb_info_desc_t *,
85 arbitrary_info_t *, labelcl_info_place_t *);
86 extern int labelcl_info_replace_IDX(vertex_hdl_t, int, arbitrary_info_t,
88 extern int labelcl_info_connectpt_set(vertex_hdl_t, vertex_hdl_t);
89 extern int labelcl_info_get_IDX(vertex_hdl_t, int, arbitrary_info_t *);
90 extern struct devfs_handle_t device_info_connectpt_get(vertex_hdl_t);
92 #endif /* _ASM_IA64_SN_LABELCL_H */