xref: /illumos-gate/usr/src/uts/common/io/scsi/adapters/iscsi/nvfile.h (revision 2f172c55ef76964744bc62b4500ece87f3089b4d)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
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.
12  *
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]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef _NVFILE_H
27 #define	_NVFILE_H
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #include <sys/types.h>
34 
35 typedef enum iscsi_nvfile_status {
36 	/* Success */
37 	ISCSI_NVFILE_SUCCESS = 0,
38 	/* nvf_list not found */
39 	ISCSI_NVFILE_NVF_LIST_NOT_FOUND,
40 	/* name/value pair not found */
41 	ISCSI_NVFILE_NAMEVAL_NOT_FOUND,
42 	/* other failure */
43 	ISCSI_NVFILE_FAILURE
44 } iscsi_nvfile_status_t;
45 
46 /*
47  * Function Prototypes
48  */
49 void		nvf_init(void);
50 void		nvf_fini(void);
51 boolean_t	nvf_load(void);
52 void		nvf_update(void);
53 boolean_t	nvf_list_check(char *id);
54 boolean_t	nvf_node_value_set(char *id, uint32_t value);
55 boolean_t	nvf_node_value_get(char *id, uint32_t *value);
56 boolean_t	nvf_node_name_set(char *id, char *name);
57 boolean_t	nvf_node_name_get(char *id, char *name, uint_t nsize);
58 boolean_t	nvf_node_data_set(char *name, void *data, uint_t dsize);
59 iscsi_nvfile_status_t	nvf_node_data_get(char *name, void *data, uint_t dsize);
60 boolean_t	nvf_node_data_clear(char *name);
61 boolean_t	nvf_data_set(char *id, char *name, void *data, uint_t dsize);
62 boolean_t	nvf_data_get(char *id, char *name, void *data, uint_t dsize);
63 boolean_t	nvf_data_next(char *id, void **v, char *name,
64 		    void *data, uint_t dsize);
65 boolean_t	nvf_data_clear(char *id, char *name);
66 
67 
68 #ifdef __cplusplus
69 }
70 #endif
71 
72 #endif /* _NVFILE_H */
73