1 /* $Id: labelcl.h,v 1.1.1.1 2005/04/11 02:50:52 jack Exp $
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-2002 Silicon Graphics, Inc. All rights reserved.
9 #ifndef _ASM_IA64_SN_LABELCL_H
10 #define _ASM_IA64_SN_LABELCL_H
12 #include <asm/sn/hcl.h>
14 #define LABELCL_MAGIC 0x4857434c /* 'HWLC' */
15 #define LABEL_LENGTH_MAX 256 /* Includes NULL char */
16 #define INFO_DESC_PRIVATE (-1) /* default */
17 #define INFO_DESC_EXPORT 0 /* export info itself */
20 * Internal Error codes.
22 typedef enum labelcl_error_e { LABELCL_SUCCESS, /* 0 */
24 LABELCL_NOT_FOUND, /* 2 */
25 LABELCL_BAD_PARAM, /* 3 */
26 LABELCL_HIT_LIMIT, /* 4 */
27 LABELCL_CANNOT_ALLOC, /* 5 */
28 LABELCL_ILLEGAL_REQUEST, /* 6 */
29 LABELCL_IN_USE /* 7 */
34 * Description of a label entry.
36 typedef struct label_info_s {
39 arbitrary_info_t info;
43 * Definition of the data structure that provides the link to
44 * the hwgraph fastinfo and the label entries associated with a
45 * particular devfs entry.
47 typedef struct labelcl_info_s {
48 unsigned long hwcl_magic;
49 unsigned long num_labels;
51 arbitrary_info_t IDX_list[HWGRAPH_NUM_INDEX_INFO];
55 * Definitions for the string table that holds the actual names
58 struct string_table_item {
59 struct string_table_item *next;
64 struct string_table_item *string_table_head;
65 long string_table_generation;
69 #define STRTBL_BASIC_SIZE ((size_t)(((struct string_table_item *)0)->string))
70 #define STRTBL_ITEM_SIZE(str_length) (STRTBL_BASIC_SIZE + (str_length) + 1)
72 #define STRTBL_ALLOC(str_length) \
73 ((struct string_table_item *)kmalloc(STRTBL_ITEM_SIZE(str_length), GFP_KERNEL))
75 #define STRTBL_FREE(ptr) kfree(ptr)
78 extern labelcl_info_t *labelcl_info_create(void);
79 extern int labelcl_info_destroy(labelcl_info_t *);
80 extern int labelcl_info_add_LBL(struct devfs_entry *, char *, arb_info_desc_t, arbitrary_info_t);
81 extern int labelcl_info_remove_LBL(struct devfs_entry *, char *, arb_info_desc_t *, arbitrary_info_t *);
82 extern int labelcl_info_replace_LBL(struct devfs_entry *, char *, arb_info_desc_t,
83 arbitrary_info_t, arb_info_desc_t *, arbitrary_info_t *);
84 extern int labelcl_info_get_LBL(struct devfs_entry *, char *, arb_info_desc_t *,
86 extern int labelcl_info_get_next_LBL(struct devfs_entry *, char *, arb_info_desc_t *,
87 arbitrary_info_t *, labelcl_info_place_t *);
88 extern int labelcl_info_replace_IDX(struct devfs_entry *, int, arbitrary_info_t,
90 extern int labelcl_info_connectpt_set(struct devfs_entry *, struct devfs_entry *);
91 extern int labelcl_info_get_IDX(struct devfs_entry *, int, arbitrary_info_t *);
92 extern struct devfs_entry *device_info_connectpt_get(struct devfs_entry *);
94 #endif /* _ASM_IA64_SN_LABELCL_H */