usb_ac.h revision d29f5a711240f866521445b1656d114da090335e
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_USB_AC_H
#define _SYS_USB_AC_H
#ifdef __cplusplus
extern "C" {
#endif
/* driver specific macros */
#define USB_AC_HIWATER (AM_MAX_QUEUED_MSGS_SIZE)
/* structure for each unit described by descriptors */
typedef struct usb_ac_unit_list {
void *acu_descriptor;
#define USB_AC_ID_NONE 0
#define USB_AC_FIND_ONE 0
#define USB_AC_FIND_ALL 1
#define USB_AC_MAX_DEPTH 8
/*
* plumbing data; info per plumbed module
*/
typedef struct usb_ac_plumbed {
int acp_linkid; /* link ID for plumbing */
int acp_driver; /* Plumbed driver, see value below */
void *acp_data; /* ptr to streams or hid data */
/*
* request structure to usb_as: info per MCTL request;
* only one active at a time.
*/
typedef struct usb_ac_to_as_req {
int acr_wait_flag; /* an mblk sent wait on this flag */
int acr_curr_dir;
/* registration and plumbing info per streaming interface */
typedef struct usb_ac_streams_info {
/* ptr to entry in plumbed list */
/* valid registration data rcvd */
/* pointer to registration data */
/* request structure to usb_as; one active at a time */
/* Multiple command management */
/* power state */
typedef struct usb_ac_power {
void *acpm_state; /* points back to usb_ac_state */
int acpm_pm_busy; /* device busy accounting */
/* this is the bit mask of the power states that device has */
/* wakeup and power transistion capabilites of an interface */
/* current power level the device is in */
/* limits */
/* usb_ac soft state */
typedef struct usb_ac_state {
/* audio framework */
/* descriptors */
/* unit number array, indexed by unit ID */
/* adjacency matrix for reflecting connections */
/* port types, eg LINE IN, Micr, Speakers */
/* pipe handle */
/* streams management */
/* serial access */
/* power management */
/* mixer registration data */
/* plumbing management */
int usb_ac_mux_minor;
/* Current plumbed module index to usb_ac_plumbed structure */
/* per streams interface info */
/*
* preserve streams registration because the mixer does not
* copy registration data
*/
typedef struct usb_ac_state_space {
void *sp; /* soft state for the instance */
/* ptr to usb_ac_restore_audio_state */
int (*restore_func)
(usb_ac_state_t *, int);
/* ptr to usb_ac_get_featureID */
(usb_ac_state_t *, uchar_t,
/* ptr to the usb_ac entry points */
void (*pm_busy_component)
(usb_ac_state_t *);
void (*pm_idle_component)
(usb_ac_state_t *);
/* warlock directives, stable data */
/* usb_ac driver only care about two states: plumbed or unplumbed */
#define USB_AC_STATE_UNPLUMBED 0
#define USB_AC_STATE_PLUMBED 1
#define USB_AC_STATE_PLUMBED_RESTORING 2
/* Default pipe states */
#define USB_AC_DEF_CLOSED 0
#define USB_AC_DEF_OPENED 1
/*
* delay before restoring state
*/
/* value for acp_driver */
#define USB_AS_PLUMBED 1
#define USB_AH_PLUMBED 2
#define UNKNOWN_PLUMBED 3
/* other useful macros */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_USB_AC_H */