Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef __SOUND_PCM_OSS_H |
| 2 | #define __SOUND_PCM_OSS_H |
| 3 | |
| 4 | /* |
| 5 | * Digital Audio (PCM) - OSS compatibility abstract layer |
Jaroslav Kysela | c1017a4 | 2007-10-15 09:50:19 +0200 | [diff] [blame] | 6 | * Copyright (c) by Jaroslav Kysela <perex@perex.cz> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 25 | struct snd_pcm_oss_setup { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | char *task_name; |
| 27 | unsigned int disable:1, |
| 28 | direct:1, |
| 29 | block:1, |
| 30 | nonblock:1, |
| 31 | partialfrag:1, |
Takashi Iwai | 10f69f9 | 2005-09-08 13:48:34 +0200 | [diff] [blame] | 32 | nosilence:1, |
| 33 | buggyptr:1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | unsigned int periods; |
| 35 | unsigned int period_size; |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 36 | struct snd_pcm_oss_setup *next; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | }; |
| 38 | |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 39 | struct snd_pcm_oss_runtime { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 */ |
Takashi Iwai | e3a5d59 | 2006-11-14 13:03:19 +0100 | [diff] [blame] | 59 | struct mutex params_lock; |
Jaroslav Kysela | 21a3479 | 2006-01-13 09:12:11 +0100 | [diff] [blame] | 60 | #ifdef CONFIG_SND_PCM_OSS_PLUGINS |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 61 | struct snd_pcm_plugin *plugin_first; |
| 62 | struct snd_pcm_plugin *plugin_last; |
Jaroslav Kysela | 21a3479 | 2006-01-13 09:12:11 +0100 | [diff] [blame] | 63 | #endif |
Jaroslav Kysela | f240406 | 2010-01-05 17:19:34 +0100 | [diff] [blame] | 64 | unsigned int prev_hw_ptr_period; |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 65 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 67 | struct snd_pcm_oss_file { |
| 68 | struct snd_pcm_substream *streams[2]; |
| 69 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 71 | struct snd_pcm_oss_substream { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | unsigned oss: 1; /* oss mode */ |
Takashi Iwai | 060d77b | 2006-03-27 16:44:52 +0200 | [diff] [blame] | 73 | struct snd_pcm_oss_setup setup; /* active setup */ |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 74 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 76 | struct snd_pcm_oss_stream { |
| 77 | struct snd_pcm_oss_setup *setup_list; /* setup list */ |
Ingo Molnar | 1a60d4c | 2006-01-16 16:29:08 +0100 | [diff] [blame] | 78 | struct mutex setup_mutex; |
Takashi Iwai | b7d90a3 | 2006-04-25 12:56:04 +0200 | [diff] [blame] | 79 | #ifdef CONFIG_SND_VERBOSE_PROCFS |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 80 | struct snd_info_entry *proc_entry; |
Takashi Iwai | b7d90a3 | 2006-04-25 12:56:04 +0200 | [diff] [blame] | 81 | #endif |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 82 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 83 | |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 84 | struct snd_pcm_oss { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 85 | int reg; |
| 86 | unsigned int reg_mask; |
Takashi Iwai | 6ac77bc | 2005-11-17 14:01:49 +0100 | [diff] [blame] | 87 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 88 | |
| 89 | #endif /* __SOUND_PCM_OSS_H */ |