audio_shim.h revision 88447a05f537aabe9a1bc3d5313f22581ec992a7
/*
* 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 _AUDIO_SHIM_H
#define _AUDIO_SHIM_H
#ifdef __cplusplus
extern "C" {
#endif
#define TQ_NM_MAX 64
#define DSTR_MAX 64
typedef struct ashim_config_arg ashim_config_arg_t;
typedef struct ashim_ctrl ashim_ctrl_t;
typedef struct ashim_fmt ashim_fmt_t;
typedef struct ashim_eng ashim_eng_t;
typedef struct ashim_state ashim_state_t;
struct ashim_config_arg {
int cmd;
int dir;
int arg1;
int arg2;
};
struct ashim_ctrl {
int dcmd; /* SADA command */
int dir; /* play or record */
int flags; /* CTRL_XXX flags */
};
struct ashim_fmt {
int sr; /* sample rate */
};
struct ashim_eng {
int af_eflags; /* ENGINE_* flags */
int af_fmt; /* AUDIO_FORMAT_* flags */
unsigned intrate; /* interrupt rate */
unsigned sampsz; /* sample size */
unsigned framesz; /* frame size */
unsigned fragsz; /* fragment size */
unsigned nfrags; /* number of fragments in buffer */
unsigned fragfr; /* number of frames per fragment */
unsigned frsmshift; /* right shift: frames in sample cnt */
unsigned smszshift; /* left shift: sample cnt * sampsz */
unsigned bufsz; /* buffer size */
char *name;
#define ENG_STARTED 0x1
#define ENG_ENABLED 0x10
int flags;
};
struct ashim_state {
void *private; /* private audio driver data */
#define ASHIM_ENG_MAX 2
int engcnt;
char *devnm;
#define AF_REGISTERED 0x1
#define AD_SETUP 0x10
int flags;
};
/*
* Macros used to convert between audio handles and the shim state structure.
*/
#ifdef __cplusplus
}
#endif
#endif /* _AUDIO_SHIM_H */