Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 #ifndef __SOUND_PCM_OSS_H
0003 #define __SOUND_PCM_OSS_H
0004 
0005 /*
0006  *  Digital Audio (PCM) - OSS compatibility abstract layer
0007  *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
0008  */
0009 
0010 struct snd_pcm_oss_setup {
0011     char *task_name;
0012     unsigned int disable:1,
0013              direct:1,
0014              block:1,
0015              nonblock:1,
0016              partialfrag:1,
0017              nosilence:1,
0018              buggyptr:1;
0019     unsigned int periods;
0020     unsigned int period_size;
0021     struct snd_pcm_oss_setup *next;
0022 };
0023 
0024 struct snd_pcm_oss_runtime {
0025     unsigned params: 1,         /* format/parameter change */
0026          prepare: 1,            /* need to prepare the operation */
0027          trigger: 1,            /* trigger flag */
0028          sync_trigger: 1;       /* sync trigger flag */
0029     int rate;               /* requested rate */
0030     int format;             /* requested OSS format */
0031     unsigned int channels;          /* requested channels */
0032     unsigned int fragshift;
0033     unsigned int maxfrags;
0034     unsigned int subdivision;       /* requested subdivision */
0035     size_t period_bytes;            /* requested period size */
0036     size_t period_frames;           /* period frames for poll */
0037     size_t period_ptr;          /* actual write pointer to period */
0038     unsigned int periods;
0039     size_t buffer_bytes;            /* requested buffer size */
0040     size_t bytes;               /* total # bytes processed */
0041     size_t mmap_bytes;
0042     char *buffer;               /* vmallocated period */
0043     size_t buffer_used;         /* used length from period buffer */
0044     struct mutex params_lock;
0045     atomic_t rw_ref;        /* concurrent read/write accesses */
0046 #ifdef CONFIG_SND_PCM_OSS_PLUGINS
0047     struct snd_pcm_plugin *plugin_first;
0048     struct snd_pcm_plugin *plugin_last;
0049 #endif
0050     unsigned int prev_hw_ptr_period;
0051 };
0052 
0053 struct snd_pcm_oss_file {
0054     struct snd_pcm_substream *streams[2];
0055 };
0056 
0057 struct snd_pcm_oss_substream {
0058     unsigned oss: 1;            /* oss mode */
0059     struct snd_pcm_oss_setup setup;     /* active setup */
0060 };
0061 
0062 struct snd_pcm_oss_stream {
0063     struct snd_pcm_oss_setup *setup_list;   /* setup list */
0064     struct mutex setup_mutex;
0065 #ifdef CONFIG_SND_VERBOSE_PROCFS
0066     struct snd_info_entry *proc_entry;
0067 #endif
0068 };
0069 
0070 struct snd_pcm_oss {
0071     int reg;
0072     unsigned int reg_mask;
0073 };
0074 
0075 #endif /* __SOUND_PCM_OSS_H */