]>
Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | #ifndef __SOUND_PCM_OSS_H |
2 | #define __SOUND_PCM_OSS_H | |
3 | ||
4 | /* | |
5 | * Digital Audio (PCM) - OSS compatibility abstract layer | |
c1017a4c | 6 | * Copyright (c) by Jaroslav Kysela <[email protected]> |
1da177e4 LT |
7 | * |
8 | * | |
9 | * This program is free software; you can redistribute it and/or modify | |
10 | * it under the terms of the GNU General Public License as published by | |
11 | * the Free Software Foundation; either version 2 of the License, or | |
12 | * (at your option) any later version. | |
13 | * | |
14 | * This program is distributed in the hope that it will be useful, | |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | * GNU General Public License for more details. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License | |
20 | * along with this program; if not, write to the Free Software | |
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
22 | * | |
23 | */ | |
24 | ||
6ac77bc1 | 25 | struct snd_pcm_oss_setup { |
1da177e4 LT |
26 | char *task_name; |
27 | unsigned int disable:1, | |
28 | direct:1, | |
29 | block:1, | |
30 | nonblock:1, | |
31 | partialfrag:1, | |
10f69f9e TI |
32 | nosilence:1, |
33 | buggyptr:1; | |
1da177e4 LT |
34 | unsigned int periods; |
35 | unsigned int period_size; | |
6ac77bc1 | 36 | struct snd_pcm_oss_setup *next; |
1da177e4 LT |
37 | }; |
38 | ||
6ac77bc1 | 39 | struct snd_pcm_oss_runtime { |
1da177e4 LT |
40 | unsigned params: 1, /* format/parameter change */ |
41 | prepare: 1, /* need to prepare the operation */ | |
42 | trigger: 1, /* trigger flag */ | |
43 | sync_trigger: 1; /* sync trigger flag */ | |
44 | int rate; /* requested rate */ | |
45 | int format; /* requested OSS format */ | |
46 | unsigned int channels; /* requested channels */ | |
47 | unsigned int fragshift; | |
48 | unsigned int maxfrags; | |
49 | unsigned int subdivision; /* requested subdivision */ | |
50 | size_t period_bytes; /* requested period size */ | |
51 | size_t period_frames; /* period frames for poll */ | |
52 | size_t period_ptr; /* actual write pointer to period */ | |
53 | unsigned int periods; | |
54 | size_t buffer_bytes; /* requested buffer size */ | |
55 | size_t bytes; /* total # bytes processed */ | |
56 | size_t mmap_bytes; | |
57 | char *buffer; /* vmallocated period */ | |
58 | size_t buffer_used; /* used length from period buffer */ | |
e3a5d59a | 59 | struct mutex params_lock; |
40cab6e8 | 60 | atomic_t rw_ref; /* concurrent read/write accesses */ |
21a3479a | 61 | #ifdef CONFIG_SND_PCM_OSS_PLUGINS |
6ac77bc1 TI |
62 | struct snd_pcm_plugin *plugin_first; |
63 | struct snd_pcm_plugin *plugin_last; | |
21a3479a | 64 | #endif |
f240406b | 65 | unsigned int prev_hw_ptr_period; |
6ac77bc1 | 66 | }; |
1da177e4 | 67 | |
6ac77bc1 TI |
68 | struct snd_pcm_oss_file { |
69 | struct snd_pcm_substream *streams[2]; | |
70 | }; | |
1da177e4 | 71 | |
6ac77bc1 | 72 | struct snd_pcm_oss_substream { |
1da177e4 | 73 | unsigned oss: 1; /* oss mode */ |
060d77b9 | 74 | struct snd_pcm_oss_setup setup; /* active setup */ |
6ac77bc1 | 75 | }; |
1da177e4 | 76 | |
6ac77bc1 TI |
77 | struct snd_pcm_oss_stream { |
78 | struct snd_pcm_oss_setup *setup_list; /* setup list */ | |
1a60d4c5 | 79 | struct mutex setup_mutex; |
b7d90a35 | 80 | #ifdef CONFIG_SND_VERBOSE_PROCFS |
6ac77bc1 | 81 | struct snd_info_entry *proc_entry; |
b7d90a35 | 82 | #endif |
6ac77bc1 | 83 | }; |
1da177e4 | 84 | |
6ac77bc1 | 85 | struct snd_pcm_oss { |
1da177e4 LT |
86 | int reg; |
87 | unsigned int reg_mask; | |
6ac77bc1 | 88 | }; |
1da177e4 LT |
89 | |
90 | #endif /* __SOUND_PCM_OSS_H */ |