xref: /onnv-gate/usr/src/uts/common/sys/usb/hcd/openhci/ohci_hub.h (revision 7492:2387323b838f)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7492SZhigang.Lu@Sun.COM  * Common Development and Distribution License (the "License").
6*7492SZhigang.Lu@Sun.COM  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*7492SZhigang.Lu@Sun.COM  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #ifndef _SYS_USB_OHCI_HUB_H
270Sstevel@tonic-gate #define	_SYS_USB_OHCI_HUB_H
280Sstevel@tonic-gate 
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #ifdef	__cplusplus
310Sstevel@tonic-gate extern "C" {
320Sstevel@tonic-gate #endif
330Sstevel@tonic-gate 
340Sstevel@tonic-gate /*
350Sstevel@tonic-gate  * Open Host Controller Driver (OHCI)
360Sstevel@tonic-gate  *
370Sstevel@tonic-gate  * The USB Open Host Controller driver is a software driver which interfaces
380Sstevel@tonic-gate  * to the Universal Serial Bus layer (USBA) and the USB Open Host Controller.
390Sstevel@tonic-gate  * The interface to USB Open Host Controller is defined by the OpenHCI  Host
400Sstevel@tonic-gate  * Controller Interface.
410Sstevel@tonic-gate  *
420Sstevel@tonic-gate  * This header file describes the data structures required for the USB Open
430Sstevel@tonic-gate  * Host Controller Driver to maintain state of USB Open Host Controller, to
440Sstevel@tonic-gate  * perform different USB transfers and for the bandwidth allocations.
450Sstevel@tonic-gate  */
460Sstevel@tonic-gate 
470Sstevel@tonic-gate /*
480Sstevel@tonic-gate  * Root hub information structure
490Sstevel@tonic-gate  *
500Sstevel@tonic-gate  * The Root hub is a Universal Serial Bus hub attached directly to the
510Sstevel@tonic-gate  * Host Controller (HC) and all the internal registers of the root hub
520Sstevel@tonic-gate  * are exposed to the Host Controller Driver (HCD) which is responsible
530Sstevel@tonic-gate  * for providing the proper hub-class protocol with the  USB driver and
540Sstevel@tonic-gate  * proper control of the root hub. This structure contains information
550Sstevel@tonic-gate  * about the root hub and its ports.
560Sstevel@tonic-gate  */
570Sstevel@tonic-gate typedef struct ohci_root_hub {
580Sstevel@tonic-gate 	usb_hub_descr_t	rh_descr;	/* Copy of rh descriptor */
590Sstevel@tonic-gate 	uint_t		rh_des_A;	/* Descriptor reg A value */
600Sstevel@tonic-gate 	uint_t		rh_des_B;	/* Descriptor reg B value */
610Sstevel@tonic-gate 	uint_t		rh_status;	/* Last root hub status */
620Sstevel@tonic-gate 
630Sstevel@tonic-gate 	/* Last state & status for each root hub port */
640Sstevel@tonic-gate 	uint_t		rh_port_status[OHCI_MAX_RH_PORTS];
650Sstevel@tonic-gate 	uint_t		rh_port_state[OHCI_MAX_RH_PORTS];
660Sstevel@tonic-gate 
670Sstevel@tonic-gate 	/* Root hub control pipe handle */
680Sstevel@tonic-gate 	usba_pipe_handle_data_t *rh_ctrl_pipe_handle;
690Sstevel@tonic-gate 
700Sstevel@tonic-gate 	/* Current control request pointer */
710Sstevel@tonic-gate 	usb_ctrl_req_t	*rh_curr_ctrl_reqp;
720Sstevel@tonic-gate 
730Sstevel@tonic-gate 	/* Root hub control pipe state */
740Sstevel@tonic-gate 	uint_t		rh_ctrl_pipe_state;
750Sstevel@tonic-gate 
760Sstevel@tonic-gate 	/* Root hub interrupt pipe handle */
770Sstevel@tonic-gate 	usba_pipe_handle_data_t *rh_intr_pipe_handle;
780Sstevel@tonic-gate 
790Sstevel@tonic-gate 	/* Current interrupt request pointer */
800Sstevel@tonic-gate 	usb_intr_req_t	*rh_curr_intr_reqp;
810Sstevel@tonic-gate 
820Sstevel@tonic-gate 	/* Saved original interrupt request pointer */
830Sstevel@tonic-gate 	usb_intr_req_t	*rh_client_intr_reqp;
840Sstevel@tonic-gate 
850Sstevel@tonic-gate 	/* Root hub interrupt pipe state and timer-id */
860Sstevel@tonic-gate 	uint_t		rh_intr_pipe_state;
870Sstevel@tonic-gate 	timeout_id_t	rh_intr_pipe_timer_id;
880Sstevel@tonic-gate } ohci_root_hub_t;
890Sstevel@tonic-gate 
900Sstevel@tonic-gate /* Port States */
910Sstevel@tonic-gate #define	UNINIT		0x00		/* Uninitialized port */
920Sstevel@tonic-gate #define	POWERED_OFF	0x01		/* Port has no power */
930Sstevel@tonic-gate #define	DISCONNECTED	0x02		/* Port has power, no dev */
940Sstevel@tonic-gate #define	DISABLED	0x03		/* Dev connected, no downstream data */
950Sstevel@tonic-gate #define	ENABLED		0x04		/* Downstream data is enabled */
960Sstevel@tonic-gate #define	SUSPEND		0x05		/* Suspended port */
970Sstevel@tonic-gate 
980Sstevel@tonic-gate /*
990Sstevel@tonic-gate  * Time waits for the different OHCI specific operations.
1000Sstevel@tonic-gate  * These timeout values are specified in terms of microseconds.
1010Sstevel@tonic-gate  */
1020Sstevel@tonic-gate #define	OHCI_RH_POLL_TIME	30000	/* Root hub polling interval */
1030Sstevel@tonic-gate 
1040Sstevel@tonic-gate #ifdef __cplusplus
1050Sstevel@tonic-gate }
1060Sstevel@tonic-gate #endif
1070Sstevel@tonic-gate 
1080Sstevel@tonic-gate #endif /* _SYS_USB_OHCI_HUB_H */
109