docs/how-to-build.md: use proper markup for directory names
[unleashed/tickless.git] / include / sys / dacf.h
blob80cc30a94f32ef3b191dd2ba04cd49b6cc19b5b2
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
30 * Device autoconfiguration framework (dacf)
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
37 #include <sys/types.h>
39 #define DACF_MODREV_1 1 /* interface version # */
41 typedef void* dacf_arghdl_t;
42 typedef void* dacf_infohdl_t;
44 typedef enum {
45 DACF_OPID_ERROR = -1,
46 DACF_OPID_END = 0, /* mark end of array of dacf_op's */
47 DACF_OPID_POSTATTACH = 1, /* operate after a driver attaches */
48 DACF_OPID_PREDETACH = 2 /* operate before a driver detaches */
49 } dacf_opid_t;
51 #define DACF_NUM_OPIDS 2
53 typedef struct dacf_op {
54 dacf_opid_t op_id; /* operation id */
55 int (*op_func)(dacf_infohdl_t, dacf_arghdl_t, int);
56 } dacf_op_t;
58 typedef struct dacf_opset {
59 char *opset_name; /* name of this op-set */
60 dacf_op_t *opset_ops; /* null-terminated array of ops */
61 } dacf_opset_t;
63 struct dacfsw {
64 int dacf_rev; /* dacf interface revision # */
65 dacf_opset_t *dacf_opsets; /* op-sets in this module */
68 extern struct dacfsw kmod_dacfsw; /* kernel provided module */
71 * DACF client interface
74 const char *dacf_minor_name(dacf_infohdl_t);
75 minor_t dacf_minor_number(dacf_infohdl_t);
76 dev_t dacf_get_dev(dacf_infohdl_t);
77 const char *dacf_driver_name(dacf_infohdl_t);
78 dev_info_t *dacf_devinfo_node(dacf_infohdl_t);
79 const char *dacf_get_arg(dacf_arghdl_t, char *);
81 void dacf_store_info(dacf_infohdl_t, void *);
82 void *dacf_retrieve_info(dacf_infohdl_t);
84 struct vnode *dacf_makevp(dacf_infohdl_t);
87 * Error codes for configuration operations
89 #define DACF_SUCCESS 0
90 #define DACF_FAILURE -1
92 #ifdef __cplusplus
94 #endif
96 #endif /* _DACF_H */