1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate #ifndef _SYS_USB_UGEN_H
28*7c478bd9Sstevel@tonic-gate #define	_SYS_USB_UGEN_H
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*7c478bd9Sstevel@tonic-gate 
32*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
33*7c478bd9Sstevel@tonic-gate extern "C" {
34*7c478bd9Sstevel@tonic-gate #endif
35*7c478bd9Sstevel@tonic-gate 
36*7c478bd9Sstevel@tonic-gate /*
37*7c478bd9Sstevel@tonic-gate  * Header  file  for  applications  written to  USB  Generic Driver (UGEN).
38*7c478bd9Sstevel@tonic-gate  * This  provides different  status  values written  to the application by
39*7c478bd9Sstevel@tonic-gate  * UGEN.
40*7c478bd9Sstevel@tonic-gate  */
41*7c478bd9Sstevel@tonic-gate 
42*7c478bd9Sstevel@tonic-gate /*
43*7c478bd9Sstevel@tonic-gate  * UGEN  provides a mechanism  to  retrieve  USB bus  specific information
44*7c478bd9Sstevel@tonic-gate  * through endpoint status minor nodes (See ugen(7D) for more information).
45*7c478bd9Sstevel@tonic-gate  * Whenever an error occurs on any endpoint, the application can retrieve
46*7c478bd9Sstevel@tonic-gate  * the last command status (int). Possible values are give below
47*7c478bd9Sstevel@tonic-gate  */
48*7c478bd9Sstevel@tonic-gate #define	USB_LC_STAT_NOERROR		0x00	/* No error		  */
49*7c478bd9Sstevel@tonic-gate #define	USB_LC_STAT_CRC			0x01	/* CRC timeout detected   */
50*7c478bd9Sstevel@tonic-gate #define	USB_LC_STAT_BITSTUFFING		0x02	/* Bit-stuffing violation */
51*7c478bd9Sstevel@tonic-gate #define	USB_LC_STAT_DATA_TOGGLE_MM	0x03	/* Data toggle mismatch	  */
52*7c478bd9Sstevel@tonic-gate #define	USB_LC_STAT_STALL		0x04	/* Endpoint stalled	  */
53*7c478bd9Sstevel@tonic-gate #define	USB_LC_STAT_DEV_NOT_RESP	0x05	/* Device not responding  */
54*7c478bd9Sstevel@tonic-gate #define	USB_LC_STAT_PID_CHECKFAILURE	0x06	/* PID Check failure	  */
55*7c478bd9Sstevel@tonic-gate #define	USB_LC_STAT_UNEXP_PID		0x07	/* Unexpected PID	  */
56*7c478bd9Sstevel@tonic-gate #define	USB_LC_STAT_DATA_OVERRUN	0x08	/* Data size exceeded	  */
57*7c478bd9Sstevel@tonic-gate #define	USB_LC_STAT_DATA_UNDERRUN	0x09	/* Less data received	  */
58*7c478bd9Sstevel@tonic-gate #define	USB_LC_STAT_BUFFER_OVERRUN	0x0a	/* Buffer size exceeded	  */
59*7c478bd9Sstevel@tonic-gate #define	USB_LC_STAT_BUFFER_UNDERRUN	0x0b	/* Buffer under run	  */
60*7c478bd9Sstevel@tonic-gate #define	USB_LC_STAT_TIMEOUT		0x0c	/* Command timed out	  */
61*7c478bd9Sstevel@tonic-gate #define	USB_LC_STAT_NOT_ACCESSED	0x0d	/* Not accessed by h/w	  */
62*7c478bd9Sstevel@tonic-gate #define	USB_LC_STAT_UNSPECIFIED_ERR	0x0e	/* Unspecified error	  */
63*7c478bd9Sstevel@tonic-gate #define	USB_LC_STAT_NO_BANDWIDTH	0x41	/* No bandwidth		  */
64*7c478bd9Sstevel@tonic-gate #define	USB_LC_STAT_HW_ERR		0x42	/* Hardware error	  */
65*7c478bd9Sstevel@tonic-gate #define	USB_LC_STAT_SUSPENDED		0x43	/* Device suspended/resumed */
66*7c478bd9Sstevel@tonic-gate #define	USB_LC_STAT_DISCONNECTED	0x44	/* Device disconnected	  */
67*7c478bd9Sstevel@tonic-gate #define	USB_LC_STAT_INTR_BUF_FULL	0x45	/* Interrupt buf was full */
68*7c478bd9Sstevel@tonic-gate #define	USB_LC_STAT_INVALID_REQ		0x46	/* request was invalid	  */
69*7c478bd9Sstevel@tonic-gate #define	USB_LC_STAT_INTERRUPTED		0x47	/* request was interrupted  */
70*7c478bd9Sstevel@tonic-gate #define	USB_LC_STAT_NO_RESOURCES	0x48	/* no resources for req	  */
71*7c478bd9Sstevel@tonic-gate #define	USB_LC_STAT_INTR_POLLING_FAILED	0x49	/* failed to restart poll  */
72*7c478bd9Sstevel@tonic-gate 
73*7c478bd9Sstevel@tonic-gate /*
74*7c478bd9Sstevel@tonic-gate  * Endpoint control
75*7c478bd9Sstevel@tonic-gate  */
76*7c478bd9Sstevel@tonic-gate #define	USB_EP_INTR_ONE_XFER		0x01	/* when this bit is set	*/
77*7c478bd9Sstevel@tonic-gate 						/* ugen will poll an intr */
78*7c478bd9Sstevel@tonic-gate 						/* endpoint only once	*/
79*7c478bd9Sstevel@tonic-gate 
80*7c478bd9Sstevel@tonic-gate /*
81*7c478bd9Sstevel@tonic-gate  * Possible Device status (int) values
82*7c478bd9Sstevel@tonic-gate  * Application can poll(2) and read(2) device status on device status minor
83*7c478bd9Sstevel@tonic-gate  * nodes (See ugen(7D) for more details).
84*7c478bd9Sstevel@tonic-gate  */
85*7c478bd9Sstevel@tonic-gate #define	USB_DEV_STAT_ONLINE		0x1	/* Device is online	  */
86*7c478bd9Sstevel@tonic-gate #define	USB_DEV_STAT_DISCONNECTED	0x2	/* Device is disconnected */
87*7c478bd9Sstevel@tonic-gate #define	USB_DEV_STAT_RESUMED		0x4	/* Device resumed	  */
88*7c478bd9Sstevel@tonic-gate #define	USB_DEV_STAT_UNAVAILABLE	0x5	/* Device unavailable	  */
89*7c478bd9Sstevel@tonic-gate 
90*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
91*7c478bd9Sstevel@tonic-gate }
92*7c478bd9Sstevel@tonic-gate #endif
93*7c478bd9Sstevel@tonic-gate 
94*7c478bd9Sstevel@tonic-gate #endif	/* _SYS_USB_UGEN_H */
95