/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_USB_USBSER_VAR_H
#define _SYS_USB_USBSER_VAR_H
/*
* USB-to-serial driver definitions
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* because put() and srv() routines are not allowed to block, usbser
* provides each port with two threads: for read and write processing
* this structure describes the data associated with a usbser thread
*/
typedef struct usbser_thread {
/*
* thr_flags
*/
enum {
};
/*
* additional device state
*/
/*
* per instance data
*/
struct usbser_state {
};
/*
* per port data
*/
struct usbser_port {
};
}))
/*
* port_state:
*
* USBSER_PORT_NOT_INIT
* | ^
* | |
* attach detach
* | |
* | | +----open[1]----> USBSER_PORT_OPENING_TTY ------+
* | | | | | |
* v | | | | |
* USBSER_PORT_CLOSED <---device error---< overtake[2] |
* | | | | v
* | | | v |
* | +----open[1]----> USBSER_PORT_OPENING_OUT |
* | | |
* | | +-------------------+
* | | |
* | v v
* USBSER_PORT_CLOSING <-----close----- USBSER_PORT_OPEN <-----------+
* ^ | ^ --------+ |
* | | | | |
* | | | | |
* | v | v |
* +------close----- USBSER_PORT_DISCONNECTED USBSER_PORT_SUSPENDED
*
* Notes:
*
* [1] for each physical port N two device nodes are created:
*
*
* the port can only be opened in one of these modes at a time.
* difference between the two is that in tty mode the driver
* will block in open(9E) until the CD (Carrier Detect) pin comes up,
* while in dial-out mode CD is ignored. opening and closing states
* one physical port in two different modes simultaneously.
*
* [2] tty mode open may be blocked waiting for carrier.
* if dial-out mode open happens at this time, it is allowed
* for it to overtake the port; from zs(7D) man page:
*
* when no one is logged in on the line.
*/
enum {
};
/* constants used by state machine implementation */
enum {
USBSER_COMPLETE = 0
};
/*
* port_act: current activities on the port.
* only one activity of each type is allowed at a time.
*/
enum {
};
/*
* port_flags
*/
enum {
/* flags that need to */
/* be preserved across opens */
};
/*
* current sun compiler does not seem to inline static leaf routines at O3
* so we have to use preprocessor macros to make up for compiler disability
*
* can we access the port?
*/
/*
* is port doing something?
*/
/* port is busy on TX, delay, break, ctrl */
USBSER_ACT_BREAK | USBSER_ACT_TX)) != 0)
/*
* is the port opening?
*/
/*
* determine, while we are trying to open the port,
* whether it is currently being open in the opposite mode
*/
/*
* determine, while we are trying to open the port,
* whether it is already open in the opposite mode
*/
/*
* minor number manipulation
*/
enum {
};
/*
* various tunables
*
* timeouts are in seconds
*/
enum {
};
/*
* debug printing masks
*/
/*
* misc macros
*/
#define NELEM(a) (sizeof (a) / sizeof (*(a)))
/*
* shortcuts to DSD operations
*/
/* power management */
/* standard UART operations */
val)
/* data xfer */
/* fifos */
/* check for supported operations */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_USB_USBSER_VAR_H */