hub.h revision 35f36846429327ed1512f8098c6a6b337055d875
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_USB_HUB_H
#define _SYS_USB_HUB_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#define USB_DESCR_TYPE_SETUP_HUB 0x2900
/*
* Section 11.11.2.1 allows up to 255 ports.
* For simplicity, only a maximum of 31 ports is currently allowed
*/
#define MAX_PORTS 31
typedef struct usb_hub_descr {
/* power on sequence begins on a port */
/* until power is good on that port */
/* removable device attached */
/* power control mask */
#define ROOT_HUB_DESCRIPTOR_LENGTH 9
#define ROOT_HUB_DESCRIPTOR_TYPE 0x29
/* Values for wHubCharacteristics */
#define HUB_CHARS_POWER_SWITCHING_MODE 0x03
#define HUB_CHARS_GANGED_POWER 0x00
#define HUB_CHARS_INDIVIDUAL_PORT_POWER 0x01
#define HUB_CHARS_NO_POWER_SWITCHING 0x02
#define HUB_CHARS_COMPOUND_DEV 0x04
#define HUB_CHARS_GLOBAL_OVER_CURRENT 0x00
#define HUB_CHARS_INDIV_OVER_CURRENT 0x08
#define HUB_CHARS_NO_OVER_CURRENT 0x10
#define HUB_CHARS_TT_THINK_TIME 0x60
#define HUB_CHARS_TT_16FS_TIME 0x20
#define HUB_CHARS_TT_24FS_TIME 0x40
#define HUB_CHARS_TT_32FS_TIME 0x60
#define HUB_CHARS_PORT_INDICATOR 0x80
/* Default Power On to Power Good time */
#define HUB_DEFAULT_POPG 10
/* Hub Status */
#define HUB_CHANGE_STATUS 0x01
/* Class Specific bmRequestType values Table 11-10 */
#define HUB_GET_PORT_STATUS_TYPE (USB_DEV_REQ_DEV_TO_HOST \
#define HUB_CLASS_REQ_TYPE (USB_DEV_REQ_DEV_TO_HOST \
/* bmRequestType for getting device status */
/* Port Status Field Bits - Table 11-15 */
#define PORT_STATUS_MASK 0x171f
/* Port Change Field Bits - Table 11-16 */
#define PORT_CHANGE_MASK 0x001f
/* Hub status Field Bits - Table 11-14 */
/* Hub change clear feature selectors - Table 11-15 */
/* hub class feature selectors - Table 11-12 */
#define CFS_C_HUB_LOCAL_POWER 0
#define CFS_C_HUB_OVER_CURRENT 1
#define CFS_PORT_CONNECTION 0
#define CFS_PORT_ENABLE 1
#define CFS_PORT_SUSPEND 2
#define CFS_PORT_OVER_CURRENT 3
#define CFS_PORT_RESET 4
#define CFS_PORT_POWER 8
#define CFS_PORT_LOW_SPEED 9
#define CFS_C_PORT_CONNECTION 16
#define CFS_C_PORT_ENABLE 17
#define CFS_C_PORT_SUSPEND 18
#define CFS_C_PORT_OVER_CURRENT 19
#define CFS_C_PORT_RESET 20
#ifdef __cplusplus
}
#endif
#endif /* _SYS_USB_HUB_H */