6198 Let's EOL cachefs
[illumos-gate.git] / usr / src / uts / common / sys / dacf.h
blobb6b7124870eb8d73d8e1a3e7e7ba4646c90c8216
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _DACF_H
27 #define _DACF_H
29 #pragma ident "%Z%%M% %I% %E% SMI"
32 * Device autoconfiguration framework (dacf)
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
39 #include <sys/types.h>
41 #define DACF_MODREV_1 1 /* interface version # */
43 typedef void* dacf_arghdl_t;
44 typedef void* dacf_infohdl_t;
46 typedef enum {
47 DACF_OPID_ERROR = -1,
48 DACF_OPID_END = 0, /* mark end of array of dacf_op's */
49 DACF_OPID_POSTATTACH = 1, /* operate after a driver attaches */
50 DACF_OPID_PREDETACH = 2 /* operate before a driver detaches */
51 } dacf_opid_t;
53 #define DACF_NUM_OPIDS 2
55 typedef struct dacf_op {
56 dacf_opid_t op_id; /* operation id */
57 int (*op_func)(dacf_infohdl_t, dacf_arghdl_t, int);
58 } dacf_op_t;
60 typedef struct dacf_opset {
61 char *opset_name; /* name of this op-set */
62 dacf_op_t *opset_ops; /* null-terminated array of ops */
63 } dacf_opset_t;
65 struct dacfsw {
66 int dacf_rev; /* dacf interface revision # */
67 dacf_opset_t *dacf_opsets; /* op-sets in this module */
70 extern struct dacfsw kmod_dacfsw; /* kernel provided module */
73 * DACF client interface
76 const char *dacf_minor_name(dacf_infohdl_t);
77 minor_t dacf_minor_number(dacf_infohdl_t);
78 dev_t dacf_get_dev(dacf_infohdl_t);
79 const char *dacf_driver_name(dacf_infohdl_t);
80 dev_info_t *dacf_devinfo_node(dacf_infohdl_t);
81 const char *dacf_get_arg(dacf_arghdl_t, char *);
83 void dacf_store_info(dacf_infohdl_t, void *);
84 void *dacf_retrieve_info(dacf_infohdl_t);
86 struct vnode *dacf_makevp(dacf_infohdl_t);
89 * Error codes for configuration operations
91 #define DACF_SUCCESS 0
92 #define DACF_FAILURE -1
94 #ifdef __cplusplus
96 #endif
98 #endif /* _DACF_H */