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 2002 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_OHCI_HUB_H 28*7c478bd9Sstevel@tonic-gate #define _SYS_USB_OHCI_HUB_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 * Open Host Controller Driver (OHCI) 38*7c478bd9Sstevel@tonic-gate * 39*7c478bd9Sstevel@tonic-gate * The USB Open Host Controller driver is a software driver which interfaces 40*7c478bd9Sstevel@tonic-gate * to the Universal Serial Bus layer (USBA) and the USB Open Host Controller. 41*7c478bd9Sstevel@tonic-gate * The interface to USB Open Host Controller is defined by the OpenHCI Host 42*7c478bd9Sstevel@tonic-gate * Controller Interface. 43*7c478bd9Sstevel@tonic-gate * 44*7c478bd9Sstevel@tonic-gate * This header file describes the data structures required for the USB Open 45*7c478bd9Sstevel@tonic-gate * Host Controller Driver to maintain state of USB Open Host Controller, to 46*7c478bd9Sstevel@tonic-gate * perform different USB transfers and for the bandwidth allocations. 47*7c478bd9Sstevel@tonic-gate */ 48*7c478bd9Sstevel@tonic-gate 49*7c478bd9Sstevel@tonic-gate /* 50*7c478bd9Sstevel@tonic-gate * Root hub information structure 51*7c478bd9Sstevel@tonic-gate * 52*7c478bd9Sstevel@tonic-gate * The Root hub is a Universal Serial Bus hub attached directly to the 53*7c478bd9Sstevel@tonic-gate * Host Controller (HC) and all the internal registers of the root hub 54*7c478bd9Sstevel@tonic-gate * are exposed to the Host Controller Driver (HCD) which is responsible 55*7c478bd9Sstevel@tonic-gate * for providing the proper hub-class protocol with the USB driver and 56*7c478bd9Sstevel@tonic-gate * proper control of the root hub. This structure contains information 57*7c478bd9Sstevel@tonic-gate * about the root hub and its ports. 58*7c478bd9Sstevel@tonic-gate */ 59*7c478bd9Sstevel@tonic-gate typedef struct ohci_root_hub { 60*7c478bd9Sstevel@tonic-gate usb_hub_descr_t rh_descr; /* Copy of rh descriptor */ 61*7c478bd9Sstevel@tonic-gate uint_t rh_des_A; /* Descriptor reg A value */ 62*7c478bd9Sstevel@tonic-gate uint_t rh_des_B; /* Descriptor reg B value */ 63*7c478bd9Sstevel@tonic-gate uint_t rh_status; /* Last root hub status */ 64*7c478bd9Sstevel@tonic-gate 65*7c478bd9Sstevel@tonic-gate /* Last state & status for each root hub port */ 66*7c478bd9Sstevel@tonic-gate uint_t rh_port_status[OHCI_MAX_RH_PORTS]; 67*7c478bd9Sstevel@tonic-gate uint_t rh_port_state[OHCI_MAX_RH_PORTS]; 68*7c478bd9Sstevel@tonic-gate 69*7c478bd9Sstevel@tonic-gate /* Root hub control pipe handle */ 70*7c478bd9Sstevel@tonic-gate usba_pipe_handle_data_t *rh_ctrl_pipe_handle; 71*7c478bd9Sstevel@tonic-gate 72*7c478bd9Sstevel@tonic-gate /* Current control request pointer */ 73*7c478bd9Sstevel@tonic-gate usb_ctrl_req_t *rh_curr_ctrl_reqp; 74*7c478bd9Sstevel@tonic-gate 75*7c478bd9Sstevel@tonic-gate /* Root hub control pipe state */ 76*7c478bd9Sstevel@tonic-gate uint_t rh_ctrl_pipe_state; 77*7c478bd9Sstevel@tonic-gate 78*7c478bd9Sstevel@tonic-gate /* Root hub interrupt pipe handle */ 79*7c478bd9Sstevel@tonic-gate usba_pipe_handle_data_t *rh_intr_pipe_handle; 80*7c478bd9Sstevel@tonic-gate 81*7c478bd9Sstevel@tonic-gate /* Current interrupt request pointer */ 82*7c478bd9Sstevel@tonic-gate usb_intr_req_t *rh_curr_intr_reqp; 83*7c478bd9Sstevel@tonic-gate 84*7c478bd9Sstevel@tonic-gate /* Saved original interrupt request pointer */ 85*7c478bd9Sstevel@tonic-gate usb_intr_req_t *rh_client_intr_reqp; 86*7c478bd9Sstevel@tonic-gate 87*7c478bd9Sstevel@tonic-gate /* Root hub interrupt pipe state and timer-id */ 88*7c478bd9Sstevel@tonic-gate uint_t rh_intr_pipe_state; 89*7c478bd9Sstevel@tonic-gate timeout_id_t rh_intr_pipe_timer_id; 90*7c478bd9Sstevel@tonic-gate } ohci_root_hub_t; 91*7c478bd9Sstevel@tonic-gate 92*7c478bd9Sstevel@tonic-gate /* Port States */ 93*7c478bd9Sstevel@tonic-gate #define UNINIT 0x00 /* Uninitialized port */ 94*7c478bd9Sstevel@tonic-gate #define POWERED_OFF 0x01 /* Port has no power */ 95*7c478bd9Sstevel@tonic-gate #define DISCONNECTED 0x02 /* Port has power, no dev */ 96*7c478bd9Sstevel@tonic-gate #define DISABLED 0x03 /* Dev connected, no downstream data */ 97*7c478bd9Sstevel@tonic-gate #define ENABLED 0x04 /* Downstream data is enabled */ 98*7c478bd9Sstevel@tonic-gate #define SUSPEND 0x05 /* Suspended port */ 99*7c478bd9Sstevel@tonic-gate 100*7c478bd9Sstevel@tonic-gate /* 101*7c478bd9Sstevel@tonic-gate * Time waits for the different OHCI specific operations. 102*7c478bd9Sstevel@tonic-gate * These timeout values are specified in terms of microseconds. 103*7c478bd9Sstevel@tonic-gate */ 104*7c478bd9Sstevel@tonic-gate #define OHCI_RH_POLL_TIME 30000 /* Root hub polling interval */ 105*7c478bd9Sstevel@tonic-gate 106*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 107*7c478bd9Sstevel@tonic-gate } 108*7c478bd9Sstevel@tonic-gate #endif 109*7c478bd9Sstevel@tonic-gate 110*7c478bd9Sstevel@tonic-gate #endif /* _SYS_USB_OHCI_HUB_H */ 111