xref: /titanic_41/usr/src/head/metadyn.h (revision d583b39bfb4e2571d3e41097c5c357ffe353ad45)
1 /*
2  * CDDL HEADER START
3  *
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.
8  *
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.
13  *
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]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1998, 2000 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef	_METADYN_H
28 #define	_METADYN_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 #define	METALDPATH_DEFAULT "/usr/lib"
37 #define	METATOOLLDPATH_DEFAULT "/usr/sadm/lib/lvm"
38 
39 typedef enum {
40 	/*
41 	 * Conversion of driver name from cinfo should have occurred,
42 	 * but something prevented that from taking place.
43 	 */
44 	Convert_Error,
45 
46 	/*
47 	 * The library being called doesn't handle this driver so nothing
48 	 * was done.
49 	 */
50 	Convert_Noop,
51 
52 	/*
53 	 * Conversion completed without errors.
54 	 */
55 	Convert_Okay
56 } meta_convert_e;
57 
58 meta_convert_e convert_path(mdname_t *, struct dk_cinfo *, mdcinfo_t *,
59     md_error_t *);
60 
61 typedef enum {
62 	/*
63 	 * While trying to determine information regarding the enclosure,
64 	 * such as tray, bus, or world wide number and error occurred.
65 	 */
66 	Enclosure_Error,
67 
68 	/*
69 	 * This library doesn't handle this device name. No changes have been
70 	 * made to the structures.
71 	 */
72 	Enclosure_Noop,
73 
74 	/*
75 	 * Successfully determined all pertinent information regarding
76 	 * the enclosure.
77 	 */
78 	Enclosure_Okay
79 } meta_enclosure_e;
80 
81 meta_enclosure_e get_enclosure(mdname_t *, mdcinfo_t *, md_error_t *);
82 
83 typedef enum {
84 	/*
85 	 * When one library tries to load another and finds the second
86 	 * library already locked, lock_and_load will return this value.
87 	 */
88 	Library_Locked,
89 
90 	/*
91 	 * If all goes well during a library load we'll receive this
92 	 * return code.
93 	 */
94 	Library_Unlocked,
95 
96 	/*
97 	 * Failed to even open the requested library
98 	 */
99 	Library_Open_Error
100 } meta_library_e;
101 
102 meta_library_e lock_and_load(const char *, void **);
103 void unlock_and_unload(void *);
104 
105 char *get_phys_name(char *);
106 
107 #ifdef	__cplusplus
108 }
109 #endif
110 
111 #endif	/* _METADYN_H */
112