613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * CDDL HEADER START
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * The contents of this file are subject to the terms of the
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * Common Development and Distribution License (the "License").
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * You may not use this file except in compliance with the License.
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * See the License for the specific language governing permissions
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * and limitations under the License.
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * When distributing Covered Code, include this CDDL HEADER in each
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * If applicable, add the following below this CDDL HEADER, with the
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * fields enclosed by brackets "[]" replaced with your own identifying
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * information: Portions Copyright [yyyy] [name of copyright owner]
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * CDDL HEADER END
3d804dabd641ca3bac12a320ebf63c36c6f3eba0Gordon Ross * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * Use is subject to license terms.
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * Functions called by the IO deamon (IOD).
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * Here in the library to simplify testing.
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * Be the reader thread for this VC.
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross /* Calle should have opened these */
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross if (ctx->ct_tran_fd == -1 || ctx->ct_dev_fd == -1) {
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * This is the reader / reconnect loop.
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * We could start with state "idle", but
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * we know someone wants a connection to
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * this server, so start in "vcactive".
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * XXX: Add some syslog calls in here?
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * Wait for driver requests to arrive
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * for this VC, then return here.
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * Next state is normally RECONNECT.
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * If the error was EAUTH, retry is
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * not likely to succeed either, so
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * just exit this thread. The user
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * will need to run smbutil to get
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * a new thread with new auth info.
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * Reconnect failed. Kill off any
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * requests waiting in the driver,
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * then get ready to try again.
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * Next state is normally IDLE.
3d804dabd641ca3bac12a320ebf63c36c6f3eba0Gordon Ross * Go ahead and close the transport now,
3d804dabd641ca3bac12a320ebf63c36c6f3eba0Gordon Ross * rather than wait until reconnect to
3d804dabd641ca3bac12a320ebf63c36c6f3eba0Gordon Ross * this server.