911106dfb16696472af8c1b7b4c554a829354fa8jm * CDDL HEADER START
911106dfb16696472af8c1b7b4c554a829354fa8jm * The contents of this file are subject to the terms of the
911106dfb16696472af8c1b7b4c554a829354fa8jm * Common Development and Distribution License (the "License").
911106dfb16696472af8c1b7b4c554a829354fa8jm * You may not use this file except in compliance with the License.
911106dfb16696472af8c1b7b4c554a829354fa8jm * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
911106dfb16696472af8c1b7b4c554a829354fa8jm * See the License for the specific language governing permissions
911106dfb16696472af8c1b7b4c554a829354fa8jm * and limitations under the License.
911106dfb16696472af8c1b7b4c554a829354fa8jm * When distributing Covered Code, include this CDDL HEADER in each
911106dfb16696472af8c1b7b4c554a829354fa8jm * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
911106dfb16696472af8c1b7b4c554a829354fa8jm * If applicable, add the following below this CDDL HEADER, with the
911106dfb16696472af8c1b7b4c554a829354fa8jm * fields enclosed by brackets "[]" replaced with your own identifying
911106dfb16696472af8c1b7b4c554a829354fa8jm * information: Portions Copyright [yyyy] [name of copyright owner]
911106dfb16696472af8c1b7b4c554a829354fa8jm * CDDL HEADER END
d3d50737e566cade9a08d73d2af95105ac7cd960Rafael Vanoni * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
911106dfb16696472af8c1b7b4c554a829354fa8jm * Use is subject to license terms.
bfc848c632c9eacb2a640246d96e198f1b185c03jm/* max time (secs) to wait for door calls to complete during door_close */
bfc848c632c9eacb2a640246d96e198f1b185c03jmuint32_t vs_door_close_timeout = VS_DOOR_CLOSE_TIMEOUT_DEFAULT;
911106dfb16696472af8c1b7b4c554a829354fa8jm * vscan_door_init
911106dfb16696472af8c1b7b4c554a829354fa8jm mutex_init(&vscan_door_mutex, NULL, MUTEX_DEFAULT, NULL);
911106dfb16696472af8c1b7b4c554a829354fa8jm return (0);
911106dfb16696472af8c1b7b4c554a829354fa8jm * vscan_door_fini
911106dfb16696472af8c1b7b4c554a829354fa8jm * vscan_door_open
911106dfb16696472af8c1b7b4c554a829354fa8jm "- failed to access vscan service daemon.");
911106dfb16696472af8c1b7b4c554a829354fa8jm return (-1);
911106dfb16696472af8c1b7b4c554a829354fa8jm return (0);
911106dfb16696472af8c1b7b4c554a829354fa8jm * vscan_door_close
911106dfb16696472af8c1b7b4c554a829354fa8jm /* wait for any in-progress requests to complete */
d3d50737e566cade9a08d73d2af95105ac7cd960Rafael Vanoni time_left = cv_reltimedwait(&vscan_door_cv, &vscan_door_mutex,
bfc848c632c9eacb2a640246d96e198f1b185c03jm cmn_err(CE_WARN, "Timeout waiting for door calls to complete");
911106dfb16696472af8c1b7b4c554a829354fa8jm * vscan_door_scan_file
bfc848c632c9eacb2a640246d96e198f1b185c03jm * Returns: result returned in door response or VS_STATUS_ERROR
1843d056c3ae0950dec6c3453e589966ba280beeAlan Wright for (i = 0; i < VS_DOOR_RETRIES; ++i) {