usbser_dsdi.h revision 28cdc3d776761766afeb198769d1b70ed7e0f2e1
/*
* 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 _SYS_USB_USBSER_DSDI_H
#define _SYS_USB_USBSER_DSDI_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* USB-to-serial device-specific driver interface (DSDI)
*/
#include <sys/dditypes.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef void *ds_hdl_t; /* DSD device handler */
/*
* interrupt emulation callbacks
*/
typedef struct ds_cb {
} ds_cb_t;
typedef struct ds_attach_info {
/*
* passed to DSD:
*/
/*
* these event callbacks should be registered by DSD
* using usb_register_event_cbs()
*/
/*
* returned by DSD:
*/
/*
* device operations used by Generic Serial Driver (GSD)
*
* ops returning int should return USB_SUCCESS on successful completion
* or appropriate USB_* error code in case of failure
*
* ops can block unless otherwise indicated
*/
typedef struct ds_ops {
int ds_version; /* structure version */
/*
* configuration operations
* ------------------------
*
*/
/*
* register/unregister interrupt callbacks for the given port
*/
/*
*/
/*
* power management
* ----------------
*
* set power level of the component;
* DSD should set new_state to the resulting USB device state
*/
/*
*/
int (*ds_suspend)(ds_hdl_t);
/*
* USB device disconnect/reconnect
*/
int (*ds_disconnect)(ds_hdl_t);
int (*ds_reconnect)(ds_hdl_t);
/*
* standard UART operations
* ------------------------
*
* set one or more port parameters: baud rate, parity,
*/
/*
* set modem controls: each bit set to 1 in 'mask' will be set to the
* value of corresponding bit in 'val'; other bits are not affected
*/
/*
* to those set to 1 in 'mask' are returned in 'valp'
*/
/*
*/
/*
*/
/*
* data xfer
* ---------
*
* data transmit: DSD is *required* to accept mblk for transfer and
* return USB_SUCCESS; after which GSD no longer owns the mblk
*/
/*
* data receipt: DSD returns either received data mblk or NULL
* if no data available. this op must not block as it is intended
* to be called from is usually called GSD receive callback
*/
/*
* 'dir' can be an OR of DS_TX and DS_RX; must succeed.
*/
/*
* flush FIFOs: 'dir' can be an OR of DS_TX and DS_RX,
* affecting transmit and received FIFO respectively
*/
/*
* drain (wait until empty) output FIFO
*
* return failure if the FIFO does not get empty after at least
* 'timeout' seconds (zero timeout means wait forever)
*/
/* V1 ops for polled I/O */
} ds_ops_t;
/*
* ds_version
*/
enum {
DS_OPS_VERSION_V0 = 0,
DS_OPS_VERSION_V1 = 1,
};
/*
* parameter type
*/
typedef enum {
DS_PARAM_BAUD, /* baud rate */
DS_PARAM_PARITY, /* parity */
DS_PARAM_STOPB, /* stop bits */
DS_PARAM_CHARSZ, /* char size */
DS_PARAM_XON_XOFF, /* xon/xoff chars */
DS_PARAM_FLOW_CTL /* flow control */
/*
* a single param entry, union used to pass various data types
*/
typedef struct ds_port_param_entry {
union {
} val; /* parameter value(s) */
/*
* port parameter array
*/
struct ds_port_params {
int tp_cnt; /* entry count */
};
/*
* direction (ds_fifo_flush, ds_fifo_drain)
*/
enum {
};
/*
*/
enum {
};
/*
* input error codes, returned by DSD in an M_BREAK message
*/
enum {
};
#ifdef __cplusplus
}
#endif
#endif /* _SYS_USB_USBSER_DSDI_H */