hwahc.h revision ff0e937b36dcde1a47ff7b00aa76a491c0dc07a8
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_USB_HWAHC_H
#define _SYS_USB_HWAHC_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* Power Management support
*/
typedef struct hwahc_power {
void *hwahc_state; /* points back to hwahc_state */
int hwahc_pm_busy; /* device busy counting */
/* wakeup and power transistion capabilites of an interface */
/* current power level the device is in */
/* softstate init state */
#define HWAHC_LOCK_INITED 0x0001
#define HWAHC_HUBDI_REGISTERED 0x0002
#define HWAHC_MINOR_NODE_CREATED 0x0004
#define HWAHC_EVENTS_REGISTERED 0x0010
#define HWAHC_HUBREG 0x0020
#define HWAHC_WA_INITED 0x0040
#define HWAHC_HCDI_REGISTERED 0x0080
#define HWAHC_HC_INITED 0x0400
#define HWAHC_WA_STARTED 0x0800
/* hardware operation state */
#define HWAHC_HW_STOPPED 0
#define HWAHC_HW_STARTED 1
#define HWAHC_HW_CH_STOPPED 2
#define HWAHC_HW_CH_SUSPEND 3
/* Tracking events registered by children */
#define HWAHC_CHILD_EVENT_DISCONNECT 0x01
#define HWAHC_CHILD_EVENT_PRESUSPEND 0x02
/* Host controller software states */
#define HWAHC_CTRL_INIT_STATE 0 /* Initialization state */
/* Host controller pipe states */
/* Additional pipe states for the hwahc_pipe_cleanup */
typedef struct hwahc_pipe_private {
/*
* Save the original client's request
*/
/*
* Softstate structure
*/
typedef struct hwahc_state {
int hwahc_instance;
/* mutex to protect softstate and hw regs */
int hwahc_hw_state; /* hc start flag */
int hwahc_hc_soft_state; /* driver states. */
/* default pipe handle as a usba client device */
/* wire adapter common data */
/* WUSB HC common data. hold HC and children info */
/* for DN notification */
/* for transfer result notification */
/* track event registration of children */
/* warlock directives */
/* Debug masks */
#define PRINT_MASK_ALL 0xFFFFFFFF
#define HWAHC_MINOR_HUB_BITS_MASK 0xff
#define HWAHC_MINOR_INSTANCE_SHIFT 8
#define HWAHC_MINOR_TO_INSTANCE(minor) \
(((minor) & HWAHC_MINOR_INSTANCE_MASK) >> \
#define HWAHC_CONSTRUCT_MINOR(inst) \
/* base of MAC layer dev address for HWA class device */
#define HWAHC_DEV_ADDR_BASE 0xA100
typedef struct hwahc_dn_notif_list {
/* max elements in notification queue */
#define HWAHC_MAX_NOTIF 100
/* notification queue drain timeout - 60sec */
#define HWAHC_NOTIF_DRAIN_TIMEOUT 60
/*
* cfgadm state values
*/
#define HWAHC_CFGADM_NORMAL 0 /* normal state */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_USB_HWAHC_H */