Thomas Gleixner | 1a59d1b8 | 2019-05-27 08:55:05 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | #ifndef __SOUND_PCM_OSS_H |
| 3 | #define __SOUND_PCM_OSS_H |
| 4 | |
| 5 | /* |
| 6 | * Digital Audio (PCM) - OSS compatibility abstract layer |
Jaroslav Kysela | c1017a4 | 2007-10-15 09:50:19 +0200 | [diff] [blame] | 7 | * Copyright (c) by Jaroslav Kysela <perex@perex.cz> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | */ |
| 9 | |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 10 | struct snd_pcm_oss_setup { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | char *task_name; |
| 12 | unsigned int disable:1, |
| 13 | direct:1, |
| 14 | block:1, |
| 15 | nonblock:1, |
| 16 | partialfrag:1, |
Takashi Iwai | 10f69f9 | 2005-09-08 13:48:34 +0200 | [diff] [blame] | 17 | nosilence:1, |
| 18 | buggyptr:1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | unsigned int periods; |
| 20 | unsigned int period_size; |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 21 | struct snd_pcm_oss_setup *next; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | }; |
| 23 | |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 24 | struct snd_pcm_oss_runtime { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | unsigned params: 1, /* format/parameter change */ |
| 26 | prepare: 1, /* need to prepare the operation */ |
| 27 | trigger: 1, /* trigger flag */ |
| 28 | sync_trigger: 1; /* sync trigger flag */ |
| 29 | int rate; /* requested rate */ |
| 30 | int format; /* requested OSS format */ |
| 31 | unsigned int channels; /* requested channels */ |
| 32 | unsigned int fragshift; |
| 33 | unsigned int maxfrags; |
| 34 | unsigned int subdivision; /* requested subdivision */ |
| 35 | size_t period_bytes; /* requested period size */ |
| 36 | size_t period_frames; /* period frames for poll */ |
| 37 | size_t period_ptr; /* actual write pointer to period */ |
| 38 | unsigned int periods; |
| 39 | size_t buffer_bytes; /* requested buffer size */ |
| 40 | size_t bytes; /* total # bytes processed */ |
| 41 | size_t mmap_bytes; |
| 42 | char *buffer; /* vmallocated period */ |
| 43 | size_t buffer_used; /* used length from period buffer */ |
Takashi Iwai | e3a5d59 | 2006-11-14 13:03:19 +0100 | [diff] [blame] | 44 | struct mutex params_lock; |
Takashi Iwai | 40cab6e | 2018-03-23 08:03:26 +0100 | [diff] [blame] | 45 | atomic_t rw_ref; /* concurrent read/write accesses */ |
Jaroslav Kysela | 21a3479 | 2006-01-13 09:12:11 +0100 | [diff] [blame] | 46 | #ifdef CONFIG_SND_PCM_OSS_PLUGINS |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 47 | struct snd_pcm_plugin *plugin_first; |
| 48 | struct snd_pcm_plugin *plugin_last; |
Jaroslav Kysela | 21a3479 | 2006-01-13 09:12:11 +0100 | [diff] [blame] | 49 | #endif |
Jaroslav Kysela | f240406 | 2010-01-05 17:19:34 +0100 | [diff] [blame] | 50 | unsigned int prev_hw_ptr_period; |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 51 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 53 | struct snd_pcm_oss_file { |
| 54 | struct snd_pcm_substream *streams[2]; |
| 55 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 57 | struct snd_pcm_oss_substream { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | unsigned oss: 1; /* oss mode */ |
Takashi Iwai | 060d77b | 2006-03-27 16:44:52 +0200 | [diff] [blame] | 59 | struct snd_pcm_oss_setup setup; /* active setup */ |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 60 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 62 | struct snd_pcm_oss_stream { |
| 63 | struct snd_pcm_oss_setup *setup_list; /* setup list */ |
Ingo Molnar | 1a60d4c | 2006-01-16 16:29:08 +0100 | [diff] [blame] | 64 | struct mutex setup_mutex; |
Takashi Iwai | b7d90a3 | 2006-04-25 12:56:04 +0200 | [diff] [blame] | 65 | #ifdef CONFIG_SND_VERBOSE_PROCFS |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 66 | struct snd_info_entry *proc_entry; |
Takashi Iwai | b7d90a3 | 2006-04-25 12:56:04 +0200 | [diff] [blame] | 67 | #endif |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 68 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 70 | struct snd_pcm_oss { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 71 | int reg; |
| 72 | unsigned int reg_mask; |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 73 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | |
| 75 | #endif /* __SOUND_PCM_OSS_H */ |