audio_apm.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 1999-2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* This header file defines the audio support module's public interfaces
* that may be used by audio personality modules. Audio drivers must NOT
* include this header file.
*
* CAUTION: This header file has not gone through a formal review process.
* Thus its commitment level is very low and may change or be removed
* at any time.
*/
#ifndef _SYS_AUDIO_APM_H
#define _SYS_AUDIO_APM_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
/*
* Miscellaneous defines.
*/
/* max # of clones to each instance */
#define AUDIO_TASKQ_SUSPENDED 0
#define AUDIO_TASKQ_RUNNING (~AUDIO_TASKQ_SUSPENDED)
/*
* audio_data_t - struct used to store original and processed audio data
*/
struct audio_data {
void *adata_orig; /* the original data */
void *adata_optr; /* marker into the orig. data */
void *adata_oeptr; /* end of the original data */
void *adata_proc; /* the processed data */
void *adata_pptr; /* marker into the proc. data */
void *adata_peptr; /* ptr to end of proc. data */
};
typedef struct audio_data audio_data_t;
/*
* The members of the audio_data structure, except adata_next, are protected
* by scheme because audio_sup_get_audio_data() removes one of these structures
* from the list and only that thread has access to the data structure.
*/
/*
* audio_ch_t - per channel state and operation data
*/
struct audio_ch {
/* APM's write put rtn */
/* APM's write svc rtn */
/* APM's read put routine */
/* APM's read svc routine */
int ch_dir; /* I/O direction */
void *ch_private; /* channel private data */
int ch_adata_cnt; /* # of queued data structs */
};
typedef struct audio_ch audio_ch_t;
/*
* Further analysis is needed for these structure members. We are
* deferring this analysis until later.
*/
/* audio_ch.ch_flags defines */
/*
* audio_state_t - per instance state and operation data
*/
struct audio_state {
int as_max_chs; /* max # of open channels */
int as_minors_per_inst; /* #minors per instance */
int as_audio_reserved; /* #audio devices */
int as_dev_instance; /* Audio Driver dev inst. # */
void *as_private; /* private audio driver data */
void *as_persistp; /* persistent data */
};
typedef struct audio_state audio_state_t;
/* these audio_state structure members are read only once set */
/*
* Further analysis is needed for this structure member. We are
* deferring this analysis until later.
*/
/*
* audio_apm_info_t - audio personality module state information
*/
struct audio_apm_info {
int, int, cred_t *);
/* APM open() routine */
/* APM close() routine */
int (*apm_restore_state)(audio_state_t *,
struct audio_apm_info *, int);
/* APM state retsore routine */
int (*apm_save_state)(audio_state_t *,
struct audio_apm_info *, int);
/* APM state save routine */
void *apm_private; /* private APM data */
void *apm_ad_infop; /* device capabilities */
void *apm_ad_state; /* state of the device */
};
typedef struct audio_apm_info audio_apm_info_t;
/* these audio_apm_info structure members are read only once set */
/*
* audio_apm_reg - This structure holds all of the data needed to
* register an Audio Personality Module for use.
*/
struct audio_apm_reg {
int aar_version; /* structure version */
int (*aar_apm_open)
/* APM open() routine */
/* APM close() routine */
audio_apm_info_t *, int);
/* APM save routine */
audio_apm_info_t *, int dir);
/* APM restore routine */
void *aar_private; /* APM private data */
void *aar_info; /* APM info structure */
void *aar_state; /* APM state structure */
};
typedef struct audio_apm_reg audio_apm_reg_t;
#define AM_AAR_VERSION AM_AAR_VERS1
/*
* Macros used to convert between audio handles and the state structure.
*/
/*
* Audio Support Module Channel Routines
*/
/*
* Audio Support Module State Routines
*/
/*
* Audio Support Module Persistent Memory Routines
*/
/*
* Audio Support Module Minor Routines
*/
/*
* Audio Support Module Audio Data Routines
*/
/*
* Audio Support Module Registration Routines
*/
/*
* Audio Support Module Task Queue Routines
*/
/*
* Audio Support Module Miscellaneous Routines
*/
int audio_sup_get_channel_number(queue_t *q);
void *audio_sup_get_info(queue_t *q);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_AUDIO_APM_H */