2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 2N/A * Function: srpt_GetConfig() 2N/A * cfg Current SRPT configuration in nvlist form 2N/A * token Configuration generation number. Use this token 2N/A * if updating the configuration with srpt_SetConfig. 2N/A * ENOMEM Could not allocate resources 2N/A * EINVAL Invalid parameter 2N/A /* Not initialized yet */ 2N/A /* create the HCA list */ 2N/A * Function: srpt_SetConfig() 2N/A * cfg SRPT configuration in nvlist form 2N/A * token Configuration generation number from srpt_GetConfig. 2N/A * Use this token to ensure the configuration hasn't been 2N/A * updated by another user since the time it was fetched. 2N/A * ENOMEM Could not allocate resources 2N/A * EINVAL Invalid parameter 2N/A * ECANCELED Configuration updated by another user 2N/A * Function: srpt_GetDefaultState() 2N/A * enabled If B_TRUE, indicates that targets will be created for all 2N/A * discovered HCAs that have not been specifically disabled. 2N/A * If B_FALSE, targets will not be created unless the HCA has 2N/A * been specifically enabled. See also srpt_SetDefaultState(). 2N/A * ENOMEM Could not allocate resources 2N/A * EINVAL Invalid parameter 2N/A * Function: srpt_SetDefaultState() 2N/A * enabled If B_TRUE, indicates that targets will be created for all 2N/A * discovered HCAs that have not been specifically disabled. 2N/A * If B_FALSE, targets will not be created unless the HCA has 2N/A * been specifically enabled. See also srpt_SetDefaultState(). 2N/A * ENOMEM Could not allocate resources 2N/A * EINVAL Invalid parameter 2N/A * Function: srpt_SetTargetState() 2N/A * hca_guid HCA GUID. See description of srpt_NormalizeGuid 2N/A * enabled If B_TRUE, indicates that a target will be created for 2N/A * this HCA when the SRPT SMF service is enabled. If B_FALSE, 2N/A * a target will not be created 2N/A * ENOMEM Could not allocate resources 2N/A * EINVAL Invalid parameter 2N/A /* get the list of HCAs */ 2N/A * Function: srpt_GetTargetState() 2N/A * hca_guid HCA GUID. See description of srpt_NormalizeGuid 2N/A * enabled If B_TRUE, indicates that a target will be created for 2N/A * this HCA when the SRPT SMF service is enabled. If B_FALSE, 2N/A * a target will not be created 2N/A * ENOMEM Could not allocate resources 2N/A * EINVAL Invalid parameter 2N/A /* get the list of HCAs */ 2N/A * Find the default, for the likely case that this HCA isn't 2N/A /* not explicitly set, use the default */ 2N/A * Function: srpt_ResetTarget() 2N/A * Clears the HCA-specific configuration. Target creation will revert to 2N/A * hca_guid HCA GUID. See description of srpt_NormalizeGuid 2N/A * ENOMEM Could not allocate resources 2N/A * EINVAL Invalid parameter 2N/A /* get the list of HCAs */ 2N/A /* don't set config if we don't actually change anything */ 2N/A * srpt_NormalizeGuid() 2N/A * in HCA GUID. Must be in one of the following forms: 2N/A * 3BA000100CD18 - base hex form 2N/A * 0003BA000100CD18 - base hex form with leading zeroes 2N/A * eui.0003BA000100CD18 - EUI form 2N/A * buf Buffer to hold normalized guid string. Must be at least 2N/A * buflen Length of provided buffer 2N/A * int_guid Optional. If not NULL, the integer form of the GUID will also 2N/A * EINVAL Invalid HCA GUID or invalid parameter. 2N/A * strtoull() does not return EINVAL as documented. Lucky 2N/A * for us, neither 0 nor ULLONG_MAX will be valid. Trap on