/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _VCC_IMPL_H
#define _VCC_IMPL_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* VCC Port States
*/
/*
* There is one lock in port structure to protect the states of the port.
* States of the port are:
* 1. VCC_PORT_AVAIL
* 2. VCC_PORT_OPEN
* 3. VCC_PORT_USE_READ_LDC - There is a thread doing vcc_read.
* 4. VCC_PORT_USE_WRITE_LDC - There is a thread doing vcc_write.
* 6. VCC_PORT_LDC_DATA_READY - Data is ready from ldc.
* 5. VCC_PORT_LDC_WRITE_READY - Ldc has space to receive data.
* 7. VCC_PORT_LDC_CHANNEL_READY - Ldc channel is up.
* 8. VCC_PORT_ADDED - A new port was added.
* 9. VCC_PORT_TERM_RD - Terminal read is enabled vs suspended
* 10. VCC_PORT_TERM_WR - Terminal write is enabled vc suspended
* 11. VCC_PORT_NONBLOCK - A port was opened with non blocking flag.
* 12. VCC_PORT_LDC_LINK_DOWN
*
*
* Code flow for port to transit from one state to another is as the follows:
*
* 1. VCC_PORT_AVAIL
*
* Transition from unavailable to available
* - obtain port lock
* Transit port to available and added states
* - release port lock
* - obtain softstate lock
* Increase total number of ports
* - release softsate lock
*
* after download added port to vntsd
* - obtain port lock
* Transit port to not added state
* - release port lock
*
* Transition from available to unavailable
* - obtain port lock
* - cv_wait read available
* Transit port to read unavailable
* - cv_wait write available
* Transit port to write unavailable
* Transit port to not ready. (close ldc channel)
* Transit port to deleted state
* Transit port to read and write available
* - cv_broadcast
* - release lock
*
* vntsd close the deleted port
* - obtained port lock
* Transit port to close and deleted state
* - release port lock
*
* after vntsd deletion of the port
* - obtain softstate lock
* - cv_wait port table unlocked
* Transit softstate to port table locked
* - release softstate lock
* - obtain port lock
* Transit port to unavailable
* destroy port lock
* - obtain softstate lock
* Transit softstate to port table unlocked
* - cv_broadcast
* - release softsate lock
*
* 2. VCC_PORT_OPEN
*
* Transition from close to open
* - obtain port lock
* transit port to open
* - release port lock
*
* Transition from open to close
* - obtain port lock
* - cv_wait read available
* Transit port to read unavailable
* - cv_wait write available
* Transit port to write unavailable
* Transit port to not ready. (close ldc channel)
* Transit port to close state
* Transit port to read and write available
* - cv_broadcast
* - release lock
*
* to read unavailable/write unavailable
* - obtain port lock
* - cv_wait read available
* - release port lock
*
* Transition from read unavailale/write unavailable
* - obtain port lock
* - cv_broadcast
* - release port lock
*
* 4. VCC_PORT_LDC_CHANNEL_READY
* Transition from data not ready to data ready
* - obtain port lock
* Transit to data ready
* - cv_broadcast
* - release port lock
*
* Transition from data ready to data not ready
* - obtain port lock
* Transit to data not ready
* - release port lock
*/
/* Poll Flags */
/* Poll evnets */
/* softstate port table state */
/* VCC limits */
/* size of vcc message data */
/* Default values */
/* HV message data type */
/* HV control messages */
/* minor number to port number */
/* minor number to minor pointer */
VCC_CONTROL_PORT)]))
/* minor number to instance */
/* hv console packet format */
typedef struct vcc_msg {
} vcc_msg_t;
/*
* minor node to port mapping table
*/
typedef struct vcc_minor {
} vcc_minor_t;
/* console port structure */
typedef struct vcc_port {
} vcc_port_t;
/*
* vcc driver's soft state structure
*/
typedef struct vcc {
/* protects vcc_t (soft state) */
} vcc_t;
#ifdef __cplusplus
}
#endif
#endif /* _VCC_IMPL_H */