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