pl2303_var.h revision cbab2b2687744cbfdc12fae90f8088127a0b266c
/*
* 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_PL2303_VAR_H
#define _SYS_USB_USBSER_PL2303_VAR_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* USB PL2303 definitions
*/
#include <sys/dditypes.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* PM support
*/
typedef struct pl2303_power {
} pl2303_pm_t;
/*
* From device driver's perspective, there is no difference
* between PL-2303HX(Chip A) and PL-2303X chips, so PL-2303X will
* stand for two chiptypes
*/
enum pl2303_chip {
pl2303_H, /* PL-2303H chip */
pl2303_X, /* PL-2303X chip or PL-2303HX(Chip A) */
pl2303_HX_CHIP_D, /* PL-2303HX(Chip D) */
pl2303_UNKNOWN /* Unknown chip type */
};
/*
* per device state structure
*/
typedef struct pl2303_state {
int pl_dev_flags; /* device flags */
int pl_port_state; /* port state */
int pl_port_flags; /* port flags */
/*
* USBA
*/
int pl_bulkin_state; /* in pipe state */
int pl_bulkout_state; /* out pipe state */
int pl_dev_state; /* USB device state */
/*
* data receipt and transmit
*/
/*
* other
*/
}))
/* port state */
enum {
PL2303_PORT_CLOSED, /* port is closed */
PL2303_PORT_OPEN, /* port is open */
};
/* port flags */
enum {
};
/* pipe state */
enum {
PL2303_PIPE_CLOSED, /* pipe is closed */
PL2303_PIPE_IDLE, /* open but no requests */
PL2303_PIPE_BUSY /* servicing request */
};
/* various tunables */
enum {
};
/*
* debug printing masks
*/
#define DPRINT_ATTACH 0x00000001
#define DPRINT_OPEN 0x00000002
#define DPRINT_CLOSE 0x00000004
#define DPRINT_DEF_PIPE 0x00000010
#define DPRINT_IN_PIPE 0x00000020
#define DPRINT_OUT_PIPE 0x00000040
#define DPRINT_IN_DATA 0x00000400
#define DPRINT_OUT_DATA 0x00000800
#define DPRINT_CTLOP 0x00001000
#define DPRINT_HOTPLUG 0x00002000
#define DPRINT_PM 0x00004000
#define DPRINT_MASK_ALL 0xFFFFFFFF
/*
* misc macros
*/
#define NELEM(a) (sizeof (a) / sizeof (*(a)))
#ifdef __cplusplus
}
#endif
#endif /* _SYS_USB_USBSER_PL2303_VAR_H */