1 /* SPDX-License-Identifier: GPL-2.0-or-later * 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 #ifndef __SOUND_PCM_OSS_H 2 #ifndef __SOUND_PCM_OSS_H 3 #define __SOUND_PCM_OSS_H 3 #define __SOUND_PCM_OSS_H 4 4 5 /* 5 /* 6 * Digital Audio (PCM) - OSS compatibility ab 6 * Digital Audio (PCM) - OSS compatibility abstract layer 7 * Copyright (c) by Jaroslav Kysela <perex@pe 7 * Copyright (c) by Jaroslav Kysela <perex@perex.cz> 8 */ 8 */ 9 9 10 struct snd_pcm_oss_setup { 10 struct snd_pcm_oss_setup { 11 char *task_name; 11 char *task_name; 12 unsigned int disable:1, 12 unsigned int disable:1, 13 direct:1, 13 direct:1, 14 block:1, 14 block:1, 15 nonblock:1, 15 nonblock:1, 16 partialfrag:1, 16 partialfrag:1, 17 nosilence:1, 17 nosilence:1, 18 buggyptr:1; 18 buggyptr:1; 19 unsigned int periods; 19 unsigned int periods; 20 unsigned int period_size; 20 unsigned int period_size; 21 struct snd_pcm_oss_setup *next; 21 struct snd_pcm_oss_setup *next; 22 }; 22 }; 23 23 24 struct snd_pcm_oss_runtime { 24 struct snd_pcm_oss_runtime { 25 unsigned params: 1, 25 unsigned params: 1, /* format/parameter change */ 26 prepare: 1, 26 prepare: 1, /* need to prepare the operation */ 27 trigger: 1, 27 trigger: 1, /* trigger flag */ 28 sync_trigger: 1; 28 sync_trigger: 1; /* sync trigger flag */ 29 int rate; 29 int rate; /* requested rate */ 30 int format; 30 int format; /* requested OSS format */ 31 unsigned int channels; 31 unsigned int channels; /* requested channels */ 32 unsigned int fragshift; 32 unsigned int fragshift; 33 unsigned int maxfrags; 33 unsigned int maxfrags; 34 unsigned int subdivision; 34 unsigned int subdivision; /* requested subdivision */ 35 size_t period_bytes; 35 size_t period_bytes; /* requested period size */ 36 size_t period_frames; 36 size_t period_frames; /* period frames for poll */ 37 size_t period_ptr; 37 size_t period_ptr; /* actual write pointer to period */ 38 unsigned int periods; 38 unsigned int periods; 39 size_t buffer_bytes; 39 size_t buffer_bytes; /* requested buffer size */ 40 size_t bytes; 40 size_t bytes; /* total # bytes processed */ 41 size_t mmap_bytes; 41 size_t mmap_bytes; 42 char *buffer; 42 char *buffer; /* vmallocated period */ 43 size_t buffer_used; 43 size_t buffer_used; /* used length from period buffer */ 44 struct mutex params_lock; 44 struct mutex params_lock; 45 atomic_t rw_ref; /* con 45 atomic_t rw_ref; /* concurrent read/write accesses */ 46 #ifdef CONFIG_SND_PCM_OSS_PLUGINS 46 #ifdef CONFIG_SND_PCM_OSS_PLUGINS 47 struct snd_pcm_plugin *plugin_first; 47 struct snd_pcm_plugin *plugin_first; 48 struct snd_pcm_plugin *plugin_last; 48 struct snd_pcm_plugin *plugin_last; 49 #endif 49 #endif 50 unsigned int prev_hw_ptr_period; 50 unsigned int prev_hw_ptr_period; 51 }; 51 }; 52 52 53 struct snd_pcm_oss_file { 53 struct snd_pcm_oss_file { 54 struct snd_pcm_substream *streams[2]; 54 struct snd_pcm_substream *streams[2]; 55 }; 55 }; 56 56 57 struct snd_pcm_oss_substream { 57 struct snd_pcm_oss_substream { 58 unsigned oss: 1; 58 unsigned oss: 1; /* oss mode */ 59 struct snd_pcm_oss_setup setup; 59 struct snd_pcm_oss_setup setup; /* active setup */ 60 }; 60 }; 61 61 62 struct snd_pcm_oss_stream { 62 struct snd_pcm_oss_stream { 63 struct snd_pcm_oss_setup *setup_list; 63 struct snd_pcm_oss_setup *setup_list; /* setup list */ 64 struct mutex setup_mutex; 64 struct mutex setup_mutex; 65 #ifdef CONFIG_SND_VERBOSE_PROCFS 65 #ifdef CONFIG_SND_VERBOSE_PROCFS 66 struct snd_info_entry *proc_entry; 66 struct snd_info_entry *proc_entry; 67 #endif 67 #endif 68 }; 68 }; 69 69 70 struct snd_pcm_oss { 70 struct snd_pcm_oss { 71 int reg; 71 int reg; 72 unsigned int reg_mask; 72 unsigned int reg_mask; 73 }; 73 }; 74 74 75 #endif /* __SOUND_PCM_OSS_H */ 75 #endif /* __SOUND_PCM_OSS_H */ 76 76
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.