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
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]
23 * Copyright 2000-2002 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
30 #pragma ident "%Z%%M% %I% %E% SMI"
33 * Header file for the Safari Configurator (gptwocfg).
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
;
78 struct gptwo_new_nodes
{
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
{
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
;
96 typedef struct gptwocfg_handle_list
{
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
)
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
*);
126 extern struct gfc_ops_v gptwo_pov
[];
132 #endif /* _SYS_GP2CFG_H */