ohci_hub.h revision 7492:2387323b838f
11901Swollman/* 21901Swollman * CDDL HEADER START 31901Swollman * 41901Swollman * The contents of this file are subject to the terms of the 51901Swollman * Common Development and Distribution License (the "License"). 61901Swollman * You may not use this file except in compliance with the License. 71901Swollman * 88870Srgrimes * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 91901Swollman * or http://www.opensolaris.org/os/licensing. 101901Swollman * See the License for the specific language governing permissions 111901Swollman * and limitations under the License. 128870Srgrimes * 131901Swollman * When distributing Covered Code, include this CDDL HEADER in each 141901Swollman * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 151901Swollman * If applicable, add the following below this CDDL HEADER, with the 168870Srgrimes * fields enclosed by brackets "[]" replaced with your own identifying 171901Swollman * information: Portions Copyright [yyyy] [name of copyright owner] 181901Swollman * 191901Swollman * CDDL HEADER END 208870Srgrimes */ 211901Swollman/* 221901Swollman * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 231901Swollman * Use is subject to license terms. 248870Srgrimes */ 251901Swollman 261901Swollman#ifndef _SYS_USB_OHCI_HUB_H 271901Swollman#define _SYS_USB_OHCI_HUB_H 281901Swollman 291901Swollman 301901Swollman#ifdef __cplusplus 311901Swollmanextern "C" { 321901Swollman#endif 3350476Speter 341901Swollman/* 351901Swollman * Open Host Controller Driver (OHCI) 361901Swollman * 371901Swollman * The USB Open Host Controller driver is a software driver which interfaces 381901Swollman * to the Universal Serial Bus layer (USBA) and the USB Open Host Controller. 391901Swollman * The interface to USB Open Host Controller is defined by the OpenHCI Host 401901Swollman * Controller Interface. 411901Swollman * 421901Swollman * This header file describes the data structures required for the USB Open 4371579Sdeischen * Host Controller Driver to maintain state of USB Open Host Controller, to 441901Swollman * perform different USB transfers and for the bandwidth allocations. 451901Swollman */ 461901Swollman 471901Swollman/* 481901Swollman * Root hub information structure 4911666Sphk * 5071579Sdeischen * The Root hub is a Universal Serial Bus hub attached directly to the 511901Swollman * Host Controller (HC) and all the internal registers of the root hub 521901Swollman * are exposed to the Host Controller Driver (HCD) which is responsible 531901Swollman * for providing the proper hub-class protocol with the USB driver and 541901Swollman * proper control of the root hub. This structure contains information 551901Swollman * about the root hub and its ports. 561901Swollman */ 571901Swollmantypedef struct ohci_root_hub { 581901Swollman usb_hub_descr_t rh_descr; /* Copy of rh descriptor */ 591901Swollman uint_t rh_des_A; /* Descriptor reg A value */ 601901Swollman uint_t rh_des_B; /* Descriptor reg B value */ 611901Swollman uint_t rh_status; /* Last root hub status */ 621901Swollman 631901Swollman /* Last state & status for each root hub port */ 641901Swollman uint_t rh_port_status[OHCI_MAX_RH_PORTS]; 651901Swollman uint_t rh_port_state[OHCI_MAX_RH_PORTS]; 661901Swollman 671901Swollman /* Root hub control pipe handle */ 681901Swollman usba_pipe_handle_data_t *rh_ctrl_pipe_handle; 691901Swollman 701901Swollman /* Current control request pointer */ 711901Swollman usb_ctrl_req_t *rh_curr_ctrl_reqp; 721901Swollman 731901Swollman /* Root hub control pipe state */ 741901Swollman uint_t rh_ctrl_pipe_state; 751901Swollman 761901Swollman /* Root hub interrupt pipe handle */ 771901Swollman usba_pipe_handle_data_t *rh_intr_pipe_handle; 781901Swollman 791901Swollman /* Current interrupt request pointer */ 801901Swollman usb_intr_req_t *rh_curr_intr_reqp; 811901Swollman 821901Swollman /* Saved original interrupt request pointer */ 831901Swollman usb_intr_req_t *rh_client_intr_reqp; 841901Swollman 851901Swollman /* Root hub interrupt pipe state and timer-id */ 861901Swollman uint_t rh_intr_pipe_state; 871901Swollman timeout_id_t rh_intr_pipe_timer_id; 881901Swollman} ohci_root_hub_t; 8921080Speter 9056698Sjasone/* Port States */ 911901Swollman#define UNINIT 0x00 /* Uninitialized port */ 921901Swollman#define POWERED_OFF 0x01 /* Port has no power */ 931901Swollman#define DISCONNECTED 0x02 /* Port has power, no dev */ 94#define DISABLED 0x03 /* Dev connected, no downstream data */ 95#define ENABLED 0x04 /* Downstream data is enabled */ 96#define SUSPEND 0x05 /* Suspended port */ 97 98/* 99 * Time waits for the different OHCI specific operations. 100 * These timeout values are specified in terms of microseconds. 101 */ 102#define OHCI_RH_POLL_TIME 30000 /* Root hub polling interval */ 103 104#ifdef __cplusplus 105} 106#endif 107 108#endif /* _SYS_USB_OHCI_HUB_H */ 109