9815 Want basic AHCI enclosure services
[unleashed.git] / usr / src / uts / common / sys / devcache.h
blobeee6539a85d12c9a914f786746a2dfc13fdd4076
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 2006 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _SYS_DEVCACHE_H
27 #define _SYS_DEVCACHE_H
29 #pragma ident "%Z%%M% %I% %E% SMI"
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
35 #include <sys/list.h>
37 #ifdef _KERNEL
40 * Handle reference to a registered file
42 typedef struct __nvf_handle *nvf_handle_t;
45 * Registration descriptor for a cache file within /etc/devices
47 * path - cache file path path
48 * unpack_list - when reading, called to unpack nvlist
49 * pack_list - when writing, called to pack nvlist
50 * list_free - free data contained within list
51 * write_complete - called when write is completed
53 typedef struct nvf_ops {
54 char *nvfr_cache_path;
55 int (*nvfr_unpack_nvlist)(nvf_handle_t, nvlist_t *, char *);
56 int (*nvfr_pack_list)(nvf_handle_t, nvlist_t **);
57 void (*nvfr_list_free)(nvf_handle_t);
58 void (*nvfr_write_complete)(nvf_handle_t);
59 } nvf_ops_t;
62 * Client interfaces
65 nvf_handle_t nvf_register_file(nvf_ops_t *);
66 int nvf_read_file(nvf_handle_t);
67 void nvf_wake_daemon(void);
68 void nvf_error(const char *, ...);
69 char *nvf_cache_name(nvf_handle_t);
70 krwlock_t *nvf_lock(nvf_handle_t);
71 list_t *nvf_list(nvf_handle_t);
72 void nvf_mark_dirty(nvf_handle_t);
73 int nvf_is_dirty(nvf_handle_t);
75 #endif /* _KERNEL */
77 #ifdef __cplusplus
79 #endif
81 #endif /* _SYS_DEVCACHE_H */