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]
22 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
32 #include <sys/types.h>
33 #include <libnvpair.h>
36 * Function: srpt_GetConfig()
39 * cfg Current SRPT configuration in nvlist form
40 * token Configuration generation number. Use this token
41 * if updating the configuration with srpt_SetConfig.
45 * ENOMEM Could not allocate resources
46 * EINVAL Invalid parameter
49 srpt_GetConfig(nvlist_t
**cfg
, uint64_t *token
);
52 * Function: srpt_SetConfig()
55 * cfg SRPT configuration in nvlist form
56 * token Configuration generation number from srpt_GetConfig.
57 * Use this token to ensure the configuration hasn't been
58 * updated by another user since the time it was fetched.
62 * ENOMEM Could not allocate resources
63 * EINVAL Invalid parameter
64 * ECANCELED Configuration updated by another user
67 srpt_SetConfig(nvlist_t
*cfg
, uint64_t token
);
70 * Function: srpt_GetDefaultState()
73 * enabled If B_TRUE, indicates that targets will be created for all
74 * discovered HCAs that have not been specifically disabled.
75 * If B_FALSE, targets will not be created unless the HCA has
76 * been specifically enabled. See also srpt_SetDefaultState().
80 * ENOMEM Could not allocate resources
81 * EINVAL Invalid parameter
84 srpt_GetDefaultState(boolean_t
*enabled
);
87 * Function: srpt_SetDefaultState()
90 * enabled If B_TRUE, indicates that targets will be created for all
91 * discovered HCAs that have not been specifically disabled.
92 * If B_FALSE, targets will not be created unless the HCA has
93 * been specifically enabled. See also srpt_SetDefaultState().
97 * ENOMEM Could not allocate resources
98 * EINVAL Invalid parameter
101 srpt_SetDefaultState(boolean_t enabled
);
104 * Function: srpt_SetTargetState()
107 * hca_guid HCA GUID. See description of srpt_NormalizeGuid
108 * enabled If B_TRUE, indicates that a target will be created for
109 * this HCA when the SRPT SMF service is enabled. If B_FALSE,
110 * a target will not be created
114 * ENOMEM Could not allocate resources
115 * EINVAL Invalid parameter
118 srpt_SetTargetState(char *hca_guid
, boolean_t enabled
);
121 * Function: srpt_GetTargetState()
124 * hca_guid HCA GUID. See description of srpt_NormalizeGuid
125 * enabled If B_TRUE, indicates that a target will be created for
126 * this HCA when the SRPT SMF service is enabled. If B_FALSE,
127 * a target will not be created
131 * ENOMEM Could not allocate resources
132 * EINVAL Invalid parameter
135 srpt_GetTargetState(char *hca_guid
, boolean_t
*enabled
);
138 * Function: srpt_ResetTarget()
140 * Clears the HCA-specific configuration. Target creation will revert to
144 * hca_guid HCA GUID. See description of srpt_NormalizeGuid
148 * ENOMEM Could not allocate resources
149 * EINVAL Invalid parameter
152 srpt_ResetTarget(char *hca_guid
);
155 * srpt_NormalizeGuid()
158 * in HCA GUID. Must be in one of the following forms:
159 * 3BA000100CD18 - base hex form
160 * 0003BA000100CD18 - base hex form with leading zeroes
161 * hca:3BA000100CD18 - form from cfgadm and/or /dev/cfg
162 * eui.0003BA000100CD18 - EUI form
164 * buf Buffer to hold normalized guid string. Must be at least
166 * buflen Length of provided buffer
167 * int_guid Optional. If not NULL, the integer form of the GUID will also
171 * EINVAL Invalid HCA GUID or invalid parameter.
174 srpt_NormalizeGuid(char *in
, char *buf
, size_t buflen
, uint64_t *int_guid
);
180 #endif /* _LIBSRPT_H */