8354 sync regcomp(3C) with upstream (fix make catalog)
[unleashed/tickless.git] / usr / src / uts / sun4u / sys / gp2cfg.h
blobeb9b541f55cf4ba6fe78d19405e39f36a2a65b5e
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright 2000-2002 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _SYS_GP2CFG_H
28 #define _SYS_GP2CFG_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
33 * Header file for the Safari Configurator (gptwocfg).
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
40 #include <sys/safari_pcd.h>
41 #include <sys/fcode.h>
42 #include <sys/fcgp2.h>
45 * Interfaces exported by Safari Configurator module, kernel/misc/gp2cfg.
48 typedef void *gptwocfg_cookie_t;
49 typedef void *gptwocfg_ops_cookie_t;
50 typedef uint32_t gptwo_aid_t;
52 gptwocfg_cookie_t gptwocfg_configure(dev_info_t *, spcd_t *, uint_t);
53 gptwocfg_cookie_t gptwocfg_unconfigure(dev_info_t *, gptwo_aid_t);
54 int gptwocfg_next_node(gptwocfg_cookie_t, dev_info_t *, dev_info_t **);
55 void gptwocfg_save_handle(dev_info_t *, fco_handle_t);
56 fco_handle_t gptwocfg_get_handle(dev_info_t *);
60 * Prototypes for the platform specific functions.
63 #define GP2CFG_SUCCESS 0x00
64 #define GP2CFG_FAILURE 0x01
66 struct gptwo_phys_spec {
67 uint_t gptwo_phys_hi; /* child's address, hi word */
68 uint_t gptwo_phys_low; /* child's address, low word */
69 uint_t gptwo_size_hi; /* high word of size field */
70 uint_t gptwo_size_low; /* low word of size field */
73 typedef struct gptwo_phys_spec gptwo_regspec_t;
76 #define GP2_VERSION 0
78 struct gptwo_new_nodes {
79 uint_t gptwo_version;
80 uint_t gptwo_number_of_nodes;
81 dev_info_t *gptwo_nodes[1];
82 /* actual size is gptwo_number_of_nodes */
85 typedef struct gptwo_new_nodes gptwo_new_nodes_t;
87 typedef struct gptwocfg_config {
88 uint_t gptwo_version;
89 dev_info_t *gptwo_ap;
90 struct gptwocfg_ops *gptwo_ops;
91 gptwo_aid_t gptwo_portid;
92 gptwo_new_nodes_t *gptwo_nodes;
93 struct gptwocfg_config *gptwo_next;
94 } gptwocfg_config_t;
96 typedef struct gptwocfg_handle_list {
97 dev_info_t *dip;
98 fco_handle_t fco_handle;
99 struct gptwocfg_handle_list *next;
100 } gptwocfg_handle_list_t;
102 #define GPTWOCFG_OPS_VERSION 0
104 typedef struct gptwocfg_ops {
105 int gptwocfg_version; /* GPTWOCFG_OPS_VERSION */
106 int gptwocfg_type; /* SAFPTYPE_xxx */
107 gptwo_new_nodes_t *(*gptwocfg_configure)
108 (dev_info_t *ap, spcd_t *pcd, gptwo_aid_t id);
109 dev_info_t *(*gptwocfg_unconfigure)
110 (dev_info_t *dip);
111 } gptwocfg_ops_t;
113 typedef gptwo_new_nodes_t *gptwo_cfgfunc_t(dev_info_t *, spcd_t *, gptwo_aid_t);
114 typedef dev_info_t *gptwo_uncfgfunc_t(dev_info_t *);
115 void gptwocfg_register_ops(uint_t, gptwo_cfgfunc_t *, gptwo_uncfgfunc_t *);
116 void gptwocfg_unregister_ops(uint_t);
117 gptwo_new_nodes_t *gptwocfg_allocate_node_list(int);
118 void gptwocfg_free_node_list(gptwo_new_nodes_t *);
119 void gptwocfg_devi_attach_to_parent(dev_info_t *);
121 struct gfc_ops_v {
122 char *svc_name;
123 fc_ops_t *f;
126 extern struct gfc_ops_v gptwo_pov[];
128 #ifdef __cplusplus
130 #endif
132 #endif /* _SYS_GP2CFG_H */