summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-17 14:01:49 +0100
committerJaroslav Kysela <perex@suse.cz>2006-01-03 12:17:48 +0100
commit6ac77bc180fbd985988015020c2e2347e802959d (patch)
tree1959127176dbc937fe4646d94e48f14cc013d087
parentf956b4a3ae790e1bdde865ac42dd1b99b64a6256 (diff)
[ALSA] Remove xxx_t typedefs: PCM OSS-emulation
Modules: ALSA<-OSS emulation Remove xxx_t typedefs from the core PCM OSS-emulation codes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--include/sound/pcm_oss.h41
-rw-r--r--sound/core/oss/copy.c16
-rw-r--r--sound/core/oss/io.c28
-rw-r--r--sound/core/oss/linear.c38
-rw-r--r--sound/core/oss/mulaw.c54
-rw-r--r--sound/core/oss/pcm_oss.c364
-rw-r--r--sound/core/oss/pcm_plugin.c110
-rw-r--r--sound/core/oss/pcm_plugin.h208
-rw-r--r--sound/core/oss/rate.c83
-rw-r--r--sound/core/oss/route.c134
10 files changed, 543 insertions, 533 deletions
diff --git a/include/sound/pcm_oss.h b/include/sound/pcm_oss.h
index 0b67c9d105af..fddaddde47b4 100644
--- a/include/sound/pcm_oss.h
+++ b/include/sound/pcm_oss.h
@@ -22,10 +22,7 @@
*
*/
-typedef struct _snd_pcm_plugin snd_pcm_plugin_t;
-typedef struct _snd_pcm_oss_setup snd_pcm_oss_setup_t;
-
-struct _snd_pcm_oss_setup {
+struct snd_pcm_oss_setup {
char *task_name;
unsigned int disable:1,
direct:1,
@@ -36,10 +33,10 @@ struct _snd_pcm_oss_setup {
buggyptr:1;
unsigned int periods;
unsigned int period_size;
- snd_pcm_oss_setup_t *next;
+ struct snd_pcm_oss_setup *next;
};
-typedef struct _snd_pcm_oss_runtime {
+struct snd_pcm_oss_runtime {
unsigned params: 1, /* format/parameter change */
prepare: 1, /* need to prepare the operation */
trigger: 1, /* trigger flag */
@@ -59,30 +56,30 @@ typedef struct _snd_pcm_oss_runtime {
size_t mmap_bytes;
char *buffer; /* vmallocated period */
size_t buffer_used; /* used length from period buffer */
- snd_pcm_plugin_t *plugin_first;
- snd_pcm_plugin_t *plugin_last;
+ struct snd_pcm_plugin *plugin_first;
+ struct snd_pcm_plugin *plugin_last;
unsigned int prev_hw_ptr_interrupt;
-} snd_pcm_oss_runtime_t;
+};
-typedef struct _snd_pcm_oss_file {
- snd_pcm_substream_t *streams[2];
-} snd_pcm_oss_file_t;
+struct snd_pcm_oss_file {
+ struct snd_pcm_substream *streams[2];
+};
-typedef struct _snd_pcm_oss_substream {
+struct snd_pcm_oss_substream {
unsigned oss: 1; /* oss mode */
- snd_pcm_oss_setup_t *setup; /* active setup */
- snd_pcm_oss_file_t *file;
-} snd_pcm_oss_substream_t;
+ struct snd_pcm_oss_setup *setup; /* active setup */
+ struct snd_pcm_oss_file *file;
+};
-typedef struct _snd_pcm_oss_stream {
- snd_pcm_oss_setup_t *setup_list; /* setup list */
+struct snd_pcm_oss_stream {
+ struct snd_pcm_oss_setup *setup_list; /* setup list */
struct semaphore setup_mutex;
- snd_info_entry_t *proc_entry;
-} snd_pcm_oss_stream_t;
+ struct snd_info_entry *proc_entry;
+};
-typedef struct _snd_pcm_oss {
+struct snd_pcm_oss {
int reg;
unsigned int reg_mask;
-} snd_pcm_oss_t;
+};
#endif /* __SOUND_PCM_OSS_H */
diff --git a/sound/core/oss/copy.c b/sound/core/oss/copy.c
index edecbe7417bd..d6a04c2d5a75 100644
--- a/sound/core/oss/copy.c
+++ b/sound/core/oss/copy.c
@@ -25,9 +25,9 @@
#include <sound/pcm.h>
#include "pcm_plugin.h"
-static snd_pcm_sframes_t copy_transfer(snd_pcm_plugin_t *plugin,
- const snd_pcm_plugin_channel_t *src_channels,
- snd_pcm_plugin_channel_t *dst_channels,
+static snd_pcm_sframes_t copy_transfer(struct snd_pcm_plugin *plugin,
+ const struct snd_pcm_plugin_channel *src_channels,
+ struct snd_pcm_plugin_channel *dst_channels,
snd_pcm_uframes_t frames)
{
unsigned int channel;
@@ -58,13 +58,13 @@ static snd_pcm_sframes_t copy_transfer(snd_pcm_plugin_t *plugin,
return frames;
}
-int snd_pcm_plugin_build_copy(snd_pcm_plug_t *plug,
- snd_pcm_plugin_format_t *src_format,
- snd_pcm_plugin_format_t *dst_format,
- snd_pcm_plugin_t **r_plugin)
+int snd_pcm_plugin_build_copy(struct snd_pcm_substream *plug,
+ struct snd_pcm_plugin_format *src_format,
+ struct snd_pcm_plugin_format *dst_format,
+ struct snd_pcm_plugin **r_plugin)
{
int err;
- snd_pcm_plugin_t *plugin;
+ struct snd_pcm_plugin *plugin;
int width;
snd_assert(r_plugin != NULL, return -ENXIO);
diff --git a/sound/core/oss/io.c b/sound/core/oss/io.c
index 63eca9aec961..322702e05f3e 100644
--- a/sound/core/oss/io.c
+++ b/sound/core/oss/io.c
@@ -35,9 +35,9 @@
* Basic io plugin
*/
-static snd_pcm_sframes_t io_playback_transfer(snd_pcm_plugin_t *plugin,
- const snd_pcm_plugin_channel_t *src_channels,
- snd_pcm_plugin_channel_t *dst_channels,
+static snd_pcm_sframes_t io_playback_transfer(struct snd_pcm_plugin *plugin,
+ const struct snd_pcm_plugin_channel *src_channels,
+ struct snd_pcm_plugin_channel *dst_channels,
snd_pcm_uframes_t frames)
{
snd_assert(plugin != NULL, return -ENXIO);
@@ -58,9 +58,9 @@ static snd_pcm_sframes_t io_playback_transfer(snd_pcm_plugin_t *plugin,
}
}
-static snd_pcm_sframes_t io_capture_transfer(snd_pcm_plugin_t *plugin,
- const snd_pcm_plugin_channel_t *src_channels,
- snd_pcm_plugin_channel_t *dst_channels,
+static snd_pcm_sframes_t io_capture_transfer(struct snd_pcm_plugin *plugin,
+ const struct snd_pcm_plugin_channel *src_channels,
+ struct snd_pcm_plugin_channel *dst_channels,
snd_pcm_uframes_t frames)
{
snd_assert(plugin != NULL, return -ENXIO);
@@ -82,13 +82,13 @@ static snd_pcm_sframes_t io_capture_transfer(snd_pcm_plugin_t *plugin,
return 0;
}
-static snd_pcm_sframes_t io_src_channels(snd_pcm_plugin_t *plugin,
+static snd_pcm_sframes_t io_src_channels(struct snd_pcm_plugin *plugin,
snd_pcm_uframes_t frames,
- snd_pcm_plugin_channel_t **channels)
+ struct snd_pcm_plugin_channel **channels)
{
int err;
unsigned int channel;
- snd_pcm_plugin_channel_t *v;
+ struct snd_pcm_plugin_channel *v;
err = snd_pcm_plugin_client_channels(plugin, frames, &v);
if (err < 0)
return err;
@@ -100,13 +100,13 @@ static snd_pcm_sframes_t io_src_channels(snd_pcm_plugin_t *plugin,
return frames;
}
-int snd_pcm_plugin_build_io(snd_pcm_plug_t *plug,
- snd_pcm_hw_params_t *params,
- snd_pcm_plugin_t **r_plugin)
+int snd_pcm_plugin_build_io(struct snd_pcm_substream *plug,
+ struct snd_pcm_hw_params *params,
+ struct snd_pcm_plugin **r_plugin)
{
int err;
- snd_pcm_plugin_format_t format;
- snd_pcm_plugin_t *plugin;
+ struct snd_pcm_plugin_format format;
+ struct snd_pcm_plugin *plugin;
snd_assert(r_plugin != NULL, return -ENXIO);
*r_plugin = NULL;
diff --git a/sound/core/oss/linear.c b/sound/core/oss/linear.c
index 12ed27a57b27..8cbfa415ce40 100644
--- a/sound/core/oss/linear.c
+++ b/sound/core/oss/linear.c
@@ -30,19 +30,19 @@
* Basic linear conversion plugin
*/
-typedef struct linear_private_data {
+struct linear_priv {
int conv;
-} linear_t;
+};
-static void convert(snd_pcm_plugin_t *plugin,
- const snd_pcm_plugin_channel_t *src_channels,
- snd_pcm_plugin_channel_t *dst_channels,
+static void convert(struct snd_pcm_plugin *plugin,
+ const struct snd_pcm_plugin_channel *src_channels,
+ struct snd_pcm_plugin_channel *dst_channels,
snd_pcm_uframes_t frames)
{
#define CONV_LABELS
#include "plugin_ops.h"
#undef CONV_LABELS
- linear_t *data = (linear_t *)plugin->extra_data;
+ struct linear_priv *data = (struct linear_priv *)plugin->extra_data;
void *conv = conv_labels[data->conv];
int channel;
int nchannels = plugin->src_format.channels;
@@ -75,15 +75,15 @@ static void convert(snd_pcm_plugin_t *plugin,
}
}
-static snd_pcm_sframes_t linear_transfer(snd_pcm_plugin_t *plugin,
- const snd_pcm_plugin_channel_t *src_channels,
- snd_pcm_plugin_channel_t *dst_channels,
+static snd_pcm_sframes_t linear_transfer(struct snd_pcm_plugin *plugin,
+ const struct snd_pcm_plugin_channel *src_channels,
+ struct snd_pcm_plugin_channel *dst_channels,
snd_pcm_uframes_t frames)
{
- linear_t *data;
+ struct linear_priv *data;
snd_assert(plugin != NULL && src_channels != NULL && dst_channels != NULL, return -ENXIO);
- data = (linear_t *)plugin->extra_data;
+ data = (struct linear_priv *)plugin->extra_data;
if (frames == 0)
return 0;
#ifdef CONFIG_SND_DEBUG
@@ -128,14 +128,14 @@ int conv_index(int src_format, int dst_format)
return src_width * 32 + src_endian * 16 + sign * 8 + dst_width * 2 + dst_endian;
}
-int snd_pcm_plugin_build_linear(snd_pcm_plug_t *plug,
- snd_pcm_plugin_format_t *src_format,
- snd_pcm_plugin_format_t *dst_format,
- snd_pcm_plugin_t **r_plugin)
+int snd_pcm_plugin_build_linear(struct snd_pcm_substream *plug,
+ struct snd_pcm_plugin_format *src_format,
+ struct snd_pcm_plugin_format *dst_format,
+ struct snd_pcm_plugin **r_plugin)
{
int err;
- struct linear_private_data *data;
- snd_pcm_plugin_t *plugin;
+ struct linear_priv *data;
+ struct snd_pcm_plugin *plugin;
snd_assert(r_plugin != NULL, return -ENXIO);
*r_plugin = NULL;
@@ -147,10 +147,10 @@ int snd_pcm_plugin_build_linear(snd_pcm_plug_t *plug,
err = snd_pcm_plugin_build(plug, "linear format conversion",
src_format, dst_format,
- sizeof(linear_t), &plugin);
+ sizeof(struct linear_priv), &plugin);
if (err < 0)
return err;
- data = (linear_t *)plugin->extra_data;
+ data = (struct linear_priv *)plugin->extra_data;
data->conv = conv_index(src_format->format, dst_format->format);
plugin->transfer = linear_transfer;
*r_plugin = plugin;
diff --git a/sound/core/oss/mulaw.c b/sound/core/oss/mulaw.c
index 44ec4c66eb19..14f5578ec7a7 100644
--- a/sound/core/oss/mulaw.c
+++ b/sound/core/oss/mulaw.c
@@ -139,25 +139,25 @@ static int ulaw2linear(unsigned char u_val)
* Basic Mu-Law plugin
*/
-typedef void (*mulaw_f)(snd_pcm_plugin_t *plugin,
- const snd_pcm_plugin_channel_t *src_channels,
- snd_pcm_plugin_channel_t *dst_channels,
+typedef void (*mulaw_f)(struct snd_pcm_plugin *plugin,
+ const struct snd_pcm_plugin_channel *src_channels,
+ struct snd_pcm_plugin_channel *dst_channels,
snd_pcm_uframes_t frames);
-typedef struct mulaw_private_data {
+struct mulaw_priv {
mulaw_f func;
int conv;
-} mulaw_t;
+};
-static void mulaw_decode(snd_pcm_plugin_t *plugin,
- const snd_pcm_plugin_channel_t *src_channels,
- snd_pcm_plugin_channel_t *dst_channels,
+static void mulaw_decode(struct snd_pcm_plugin *plugin,
+ const struct snd_pcm_plugin_channel *src_channels,
+ struct snd_pcm_plugin_channel *dst_channels,
snd_pcm_uframes_t frames)
{
#define PUT_S16_LABELS
#include "plugin_ops.h"
#undef PUT_S16_LABELS
- mulaw_t *data = (mulaw_t *)plugin->extra_data;
+ struct mulaw_priv *data = (struct mulaw_priv *)plugin->extra_data;
void *put = put_s16_labels[data->conv];
int channel;
int nchannels = plugin->src_format.channels;
@@ -191,15 +191,15 @@ static void mulaw_decode(snd_pcm_plugin_t *plugin,
}
}
-static void mulaw_encode(snd_pcm_plugin_t *plugin,
- const snd_pcm_plugin_channel_t *src_channels,
- snd_pcm_plugin_channel_t *dst_channels,
+static void mulaw_encode(struct snd_pcm_plugin *plugin,
+ const struct snd_pcm_plugin_channel *src_channels,
+ struct snd_pcm_plugin_channel *dst_channels,
snd_pcm_uframes_t frames)
{
#define GET_S16_LABELS
#include "plugin_ops.h"
#undef GET_S16_LABELS
- mulaw_t *data = (mulaw_t *)plugin->extra_data;
+ struct mulaw_priv *data = (struct mulaw_priv *)plugin->extra_data;
void *get = get_s16_labels[data->conv];
int channel;
int nchannels = plugin->src_format.channels;
@@ -234,12 +234,12 @@ static void mulaw_encode(snd_pcm_plugin_t *plugin,
}
}
-static snd_pcm_sframes_t mulaw_transfer(snd_pcm_plugin_t *plugin,
- const snd_pcm_plugin_channel_t *src_channels,
- snd_pcm_plugin_channel_t *dst_channels,
+static snd_pcm_sframes_t mulaw_transfer(struct snd_pcm_plugin *plugin,
+ const struct snd_pcm_plugin_channel *src_channels,
+ struct snd_pcm_plugin_channel *dst_channels,
snd_pcm_uframes_t frames)
{
- mulaw_t *data;
+ struct mulaw_priv *data;
snd_assert(plugin != NULL && src_channels != NULL && dst_channels != NULL, return -ENXIO);
if (frames == 0)
@@ -257,20 +257,20 @@ static snd_pcm_sframes_t mulaw_transfer(snd_pcm_plugin_t *plugin,
}
}
#endif
- data = (mulaw_t *)plugin->extra_data;
+ data = (struct mulaw_priv *)plugin->extra_data;
data->func(plugin, src_channels, dst_channels, frames);
return frames;
}
-int snd_pcm_plugin_build_mulaw(snd_pcm_plug_t *plug,
- snd_pcm_plugin_format_t *src_format,
- snd_pcm_plugin_format_t *dst_format,
- snd_pcm_plugin_t **r_plugin)
+int snd_pcm_plugin_build_mulaw(struct snd_pcm_substream *plug,
+ struct snd_pcm_plugin_format *src_format,
+ struct snd_pcm_plugin_format *dst_format,
+ struct snd_pcm_plugin **r_plugin)
{
int err;
- mulaw_t *data;
- snd_pcm_plugin_t *plugin;
- snd_pcm_plugin_format_t *format;
+ struct mulaw_priv *data;
+ struct snd_pcm_plugin *plugin;
+ struct snd_pcm_plugin_format *format;
mulaw_f func;
snd_assert(r_plugin != NULL, return -ENXIO);
@@ -295,10 +295,10 @@ int snd_pcm_plugin_build_mulaw(snd_pcm_plug_t *plug,
err = snd_pcm_plugin_build(plug, "Mu-Law<->linear conversion",
src_format, dst_format,
- sizeof(mulaw_t), &plugin);
+ sizeof(struct mulaw_priv), &plugin);
if (err < 0)
return err;
- data = (mulaw_t*)plugin->extra_data;
+ data = (struct mulaw_priv *)plugin->extra_data;
data->func = func;
data->conv = getput_index(format->format);
snd_assert(data->conv >= 0 && data->conv < 4*2*2, return -EINVAL);
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index bcc970759134..ffc13b9194b7 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -61,10 +61,10 @@ MODULE_PARM_DESC(nonblock_open, "Don't block opening busy PCM devices.");
MODULE_ALIAS_SNDRV_MINOR(SNDRV_MINOR_OSS_PCM);
MODULE_ALIAS_SNDRV_MINOR(SNDRV_MINOR_OSS_PCM1);
-extern int snd_mixer_oss_ioctl_card(snd_card_t *card, unsigned int cmd, unsigned long arg);
-static int snd_pcm_oss_get_rate(snd_pcm_oss_file_t *pcm_oss_file);
-static int snd_pcm_oss_get_channels(snd_pcm_oss_file_t *pcm_oss_file);
-static int snd_pcm_oss_get_format(snd_pcm_oss_file_t *pcm_oss_file);
+extern int snd_mixer_oss_ioctl_card(struct snd_card *card, unsigned int cmd, unsigned long arg);
+static int snd_pcm_oss_get_rate(struct snd_pcm_oss_file *pcm_oss_file);
+static int snd_pcm_oss_get_channels(struct snd_pcm_oss_file *pcm_oss_file);
+static int snd_pcm_oss_get_format(struct snd_pcm_oss_file *pcm_oss_file);
static inline mm_segment_t snd_enter_user(void)
{
@@ -78,10 +78,10 @@ static inline void snd_leave_user(mm_segment_t fs)
set_fs(fs);
}
-static int snd_pcm_oss_plugin_clear(snd_pcm_substream_t *substream)
+static int snd_pcm_oss_plugin_clear(struct snd_pcm_substream *substream)
{
- snd_pcm_runtime_t *runtime = substream->runtime;
- snd_pcm_plugin_t *plugin, *next;
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ struct snd_pcm_plugin *plugin, *next;
plugin = runtime->oss.plugin_first;
while (plugin) {
@@ -93,9 +93,9 @@ static int snd_pcm_oss_plugin_clear(snd_pcm_substream_t *substream)
return 0;
}
-static int snd_pcm_plugin_insert(snd_pcm_plugin_t *plugin)
+static int snd_pcm_plugin_insert(struct snd_pcm_plugin *plugin)
{
- snd_pcm_runtime_t *runtime = plugin->plug->runtime;
+ struct snd_pcm_runtime *runtime = plugin->plug->runtime;
plugin->next = runtime->oss.plugin_first;
plugin->prev = NULL;
if (runtime->oss.plugin_first) {
@@ -108,9 +108,9 @@ static int snd_pcm_plugin_insert(snd_pcm_plugin_t *plugin)
return 0;
}
-int snd_pcm_plugin_append(snd_pcm_plugin_t *plugin)
+int snd_pcm_plugin_append(struct snd_pcm_plugin *plugin)
{
- snd_pcm_runtime_t *runtime = plugin->plug->runtime;
+ struct snd_pcm_runtime *runtime = plugin->plug->runtime;
plugin->next = NULL;
plugin->prev = runtime->oss.plugin_last;
if (runtime->oss.plugin_last) {
@@ -123,9 +123,9 @@ int snd_pcm_plugin_append(snd_pcm_plugin_t *plugin)
return 0;
}
-static long snd_pcm_oss_bytes(snd_pcm_substream_t *substream, long frames)
+static long snd_pcm_oss_bytes(struct snd_pcm_substream *substream, long frames)
{
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct snd_pcm_runtime *runtime = substream->runtime;
long buffer_size = snd_pcm_lib_buffer_bytes(substream);
long bytes = frames_to_bytes(runtime, frames);
if (buffer_size == runtime->oss.buffer_bytes)
@@ -142,9 +142,9 @@ static long snd_pcm_oss_bytes(snd_pcm_substream_t *substream, long frames)
#endif
}
-static long snd_pcm_alsa_frames(snd_pcm_substream_t *substream, long bytes)
+static long snd_pcm_alsa_frames(struct snd_pcm_substream *substream, long bytes)
{
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct snd_pcm_runtime *runtime = substream->runtime;
long buffer_size = snd_pcm_lib_buffer_bytes(substream);
if (buffer_size == runtime->oss.buffer_bytes)
return bytes_to_frames(runtime, bytes);
@@ -185,14 +185,14 @@ static int snd_pcm_oss_format_to(int format)
}
}
-static int snd_pcm_oss_period_size(snd_pcm_substream_t *substream,
- snd_pcm_hw_params_t *oss_params,
- snd_pcm_hw_params_t *slave_params)
+static int snd_pcm_oss_period_size(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *oss_params,
+ struct snd_pcm_hw_params *slave_params)
{
size_t s;
size_t oss_buffer_size, oss_period_size, oss_periods;
size_t min_period_size, max_period_size;
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct snd_pcm_runtime *runtime = substream->runtime;
size_t oss_frame_size;
oss_frame_size = snd_pcm_format_physical_width(params_format(oss_params)) *
@@ -277,11 +277,11 @@ static int snd_pcm_oss_period_size(snd_pcm_substream_t *substream,
return 0;
}
-static int choose_rate(snd_pcm_substream_t *substream,
- snd_pcm_hw_params_t *params, unsigned int best_rate)
+static int choose_rate(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params, unsigned int best_rate)
{
- snd_interval_t *it;
- snd_pcm_hw_params_t *save;
+ struct snd_interval *it;
+ struct snd_pcm_hw_params *save;
unsigned int rate, prev;
save = kmalloc(sizeof(*save), GFP_KERNEL);
@@ -317,18 +317,18 @@ static int choose_rate(snd_pcm_substream_t *substream,
return snd_pcm_hw_param_near(substream, params, SNDRV_PCM_HW_PARAM_RATE, best_rate, NULL);
}
-static int snd_pcm_oss_change_params(snd_pcm_substream_t *substream)
+static int snd_pcm_oss_change_params(struct snd_pcm_substream *substream)
{
- snd_pcm_runtime_t *runtime = substream->runtime;
- snd_pcm_hw_params_t *params, *sparams;
- snd_pcm_sw_params_t *sw_params;
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ struct snd_pcm_hw_params *params, *sparams;
+ struct snd_pcm_sw_params *sw_params;
ssize_t oss_buffer_size, oss_period_size;
size_t oss_frame_size;
int err;
int direct;
int format, sformat, n;
- snd_mask_t sformat_mask;
- snd_mask_t mask;
+ struct snd_mask sformat_mask;
+ struct snd_mask mask;
sw_params = kmalloc(sizeof(*sw_params), GFP_KERNEL);
params = kmalloc(sizeof(*params), GFP_KERNEL);
@@ -342,7 +342,7 @@ static int snd_pcm_oss_change_params(snd_pcm_substream_t *substream)
if (atomic_read(&runtime->mmap_count)) {
direct = 1;
} else {
- snd_pcm_oss_setup_t *setup = substream->oss.setup;
+ struct snd_pcm_oss_setup *setup = substream->oss.setup;
direct = (setup != NULL && setup->direct);
}
@@ -424,7 +424,7 @@ static int snd_pcm_oss_change_params(snd_pcm_substream_t *substream)
goto failure;
}
if (runtime->oss.plugin_first) {
- snd_pcm_plugin_t *plugin;
+ struct snd_pcm_plugin *plugin;
if ((err = snd_pcm_plugin_build_io(substream, sparams, &plugin)) < 0) {
snd_printd("snd_pcm_plugin_build_io failed: %i\n", err);
snd_pcm_oss_plugin_clear(substream);
@@ -540,10 +540,10 @@ failure:
return err;
}
-static int snd_pcm_oss_get_active_substream(snd_pcm_oss_file_t *pcm_oss_file, snd_pcm_substream_t **r_substream)
+static int snd_pcm_oss_get_active_substream(struct snd_pcm_oss_file *pcm_oss_file, struct snd_pcm_substream **r_substream)
{
int idx, err;
- snd_pcm_substream_t *asubstream = NULL, *substream;
+ struct snd_pcm_substream *asubstream = NULL, *substream;
for (idx = 0; idx < 2; idx++) {
substream = pcm_oss_file->streams[idx];
@@ -563,10 +563,10 @@ static int snd_pcm_oss_get_active_substream(snd_pcm_oss_file_t *pcm_oss_file, sn
return 0;
}
-static int snd_pcm_oss_prepare(snd_pcm_substream_t *substream)
+static int snd_pcm_oss_prepare(struct snd_pcm_substream *substream)
{
int err;
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct snd_pcm_runtime *runtime = substream->runtime;
err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_PREPARE, NULL);
if (err < 0) {
@@ -581,9 +581,9 @@ static int snd_pcm_oss_prepare(snd_pcm_substream_t *substream)
return 0;
}
-static int snd_pcm_oss_make_ready(snd_pcm_substream_t *substream)
+static int snd_pcm_oss_make_ready(struct snd_pcm_substream *substream)
{
- snd_pcm_runtime_t *runtime;
+ struct snd_pcm_runtime *runtime;
int err;
if (substream == NULL)
@@ -602,9 +602,9 @@ static int snd_pcm_oss_make_ready(snd_pcm_substream_t *substream)
return 0;
}
-static int snd_pcm_oss_capture_position_fixup(snd_pcm_substream_t *substream, snd_pcm_sframes_t *delay)
+static int snd_pcm_oss_capture_position_fixup(struct snd_pcm_substream *substream, snd_pcm_sframes_t *delay)
{
- snd_pcm_runtime_t *runtime;
+ struct snd_pcm_runtime *runtime;
snd_pcm_uframes_t frames;
int err = 0;
@@ -627,9 +627,9 @@ static int snd_pcm_oss_capture_position_fixup(snd_pcm_substream_t *substream, sn
return err;
}
-snd_pcm_sframes_t snd_pcm_oss_write3(snd_pcm_substream_t *substream, const char *ptr, snd_pcm_uframes_t frames, int in_kernel)
+snd_pcm_sframes_t snd_pcm_oss_write3(struct snd_pcm_substream *substream, const char *ptr, snd_pcm_uframes_t frames, int in_kernel)
{
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct snd_pcm_runtime *runtime = substream->runtime;
int ret;
while (1) {
if (runtime->status->state == SNDRV_PCM_STATE_XRUN ||
@@ -662,9 +662,9 @@ snd_pcm_sframes_t snd_pcm_oss_write3(snd_pcm_substream_t *substream, const char
return ret;
}
-snd_pcm_sframes_t snd_pcm_oss_read3(snd_pcm_substream_t *substream, char *ptr, snd_pcm_uframes_t frames, int in_kernel)
+snd_pcm_sframes_t snd_pcm_oss_read3(struct snd_pcm_substream *substream, char *ptr, snd_pcm_uframes_t frames, int in_kernel)
{
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct snd_pcm_runtime *runtime = substream->runtime;
snd_pcm_sframes_t delay;
int ret;
while (1) {
@@ -709,9 +709,9 @@ snd_pcm_sframes_t snd_pcm_oss_read3(snd_pcm_substream_t *substream, char *ptr, s
return ret;
}
-snd_pcm_sframes_t snd_pcm_oss_writev3(snd_pcm_substream_t *substream, void **bufs, snd_pcm_uframes_t frames, int in_kernel)
+snd_pcm_sframes_t snd_pcm_oss_writev3(struct snd_pcm_substream *substream, void **bufs, snd_pcm_uframes_t frames, int in_kernel)
{
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct snd_pcm_runtime *runtime = substream->runtime;
int ret;
while (1) {
if (runtime->status->state == SNDRV_PCM_STATE_XRUN ||
@@ -745,9 +745,9 @@ snd_pcm_sframes_t snd_pcm_oss_writev3(snd_pcm_substream_t *substream, void **buf
return ret;
}
-snd_pcm_sframes_t snd_pcm_oss_readv3(snd_pcm_substream_t *substream, void **bufs, snd_pcm_uframes_t frames, int in_kernel)
+snd_pcm_sframes_t snd_pcm_oss_readv3(struct snd_pcm_substream *substream, void **bufs, snd_pcm_uframes_t frames, int in_kernel)
{
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct snd_pcm_runtime *runtime = substream->runtime;
int ret;
while (1) {
if (runtime->status->state == SNDRV_PCM_STATE_XRUN ||
@@ -780,12 +780,12 @@ snd_pcm_sframes_t snd_pcm_oss_readv3(snd_pcm_substream_t *substream, void **bufs
return ret;
}
-static ssize_t snd_pcm_oss_write2(snd_pcm_substream_t *substream, const char *buf, size_t bytes, int in_kernel)
+static ssize_t snd_pcm_oss_write2(struct snd_pcm_substream *substream, const char *buf, size_t bytes, int in_kernel)
{
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct snd_pcm_runtime *runtime = substream->runtime;
snd_pcm_sframes_t frames, frames1;
if (runtime->oss.plugin_first) {
- snd_pcm_plugin_channel_t *channels;
+ struct snd_pcm_plugin_channel *channels;
size_t oss_frame_bytes = (runtime->oss.plugin_first->src_width * runtime->oss.plugin_first->src_format.channels) / 8;
if (!in_kernel) {
if (copy_from_user(runtime->oss.buffer, (const char __user *)buf, bytes))
@@ -810,11 +810,11 @@ static ssize_t snd_pcm_oss_write2(snd_pcm_substream_t *substream, const char *bu
return bytes;
}
-static ssize_t snd_pcm_oss_write1(snd_pcm_substream_t *substream, const char __user *buf, size_t bytes)
+static ssize_t snd_pcm_oss_write1(struct snd_pcm_substream *substream, const char __user *buf, size_t bytes)
{
size_t xfer = 0;
ssize_t tmp;
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct snd_pcm_runtime *runtime = substream->runtime;
if (atomic_read(&runtime->mmap_count))
return -ENXIO;
@@ -867,13 +867,13 @@ static ssize_t snd_pcm_oss_write1(snd_pcm_substream_t *substream, const char __u
return xfer;
}
-static ssize_t snd_pcm_oss_read2(snd_pcm_substream_t *substream, char *buf, size_t bytes, int in_kernel)
+static ssize_t snd_pcm_oss_read2(struct snd_pcm_substream *substream, char *buf, size_t bytes, int in_kernel)
{
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct snd_pcm_runtime *runtime = substream->runtime;
snd_pcm_sframes_t frames, frames1;
char __user *final_dst = (char __user *)buf;
if (runtime->oss.plugin_first) {
- snd_pcm_plugin_channel_t *channels;
+ struct snd_pcm_plugin_channel *channels;
size_t oss_frame_bytes = (runtime->oss.plugin_last->dst_width * runtime->oss.plugin_last->dst_format.channels) / 8;
if (!in_kernel)
buf = runtime->oss.buffer;
@@ -897,11 +897,11 @@ static ssize_t snd_pcm_oss_read2(snd_pcm_substream_t *substream, char *buf, size
return bytes;
}
-static ssize_t snd_pcm_oss_read1(snd_pcm_substream_t *substream, char __user *buf, size_t bytes)
+static ssize_t snd_pcm_oss_read1(struct snd_pcm_substream *substream, char __user *buf, size_t bytes)
{
size_t xfer = 0;
ssize_t tmp;
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct snd_pcm_runtime *runtime = substream->runtime;
if (atomic_read(&runtime->mmap_count))
return -ENXIO;
@@ -941,9 +941,9 @@ static ssize_t snd_pcm_oss_read1(snd_pcm_substream_t *substream, char __user *bu
return xfer;
}
-static int snd_pcm_oss_reset(snd_pcm_oss_file_t *pcm_oss_file)
+static int snd_pcm_oss_reset(struct snd_pcm_oss_file *pcm_oss_file)
{
- snd_pcm_substream_t *substream;
+ struct snd_pcm_substream *substream;
substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK];
if (substream != NULL) {
@@ -958,9 +958,9 @@ static int snd_pcm_oss_reset(snd_pcm_oss_file_t *pcm_oss_file)
return 0;
}
-static int snd_pcm_oss_post(snd_pcm_oss_file_t *pcm_oss_file)
+static int snd_pcm_oss_post(struct snd_pcm_oss_file *pcm_oss_file)
{
- snd_pcm_substream_t *substream;
+ struct snd_pcm_substream *substream;
int err;
substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK];
@@ -974,9 +974,9 @@ static int snd_pcm_oss_post(snd_pcm_oss_file_t *pcm_oss_file)
return 0;
}
-static int snd_pcm_oss_sync1(snd_pcm_substream_t *substream, size_t size)
+static int snd_pcm_oss_sync1(struct snd_pcm_substream *substream, size_t size)
{
- snd_pcm_runtime_t *runtime;
+ struct snd_pcm_runtime *runtime;
ssize_t result = 0;
long res;
wait_queue_t wait;
@@ -1020,12 +1020,12 @@ static int snd_pcm_oss_sync1(snd_pcm_substream_t *substream, size_t size)
return result;
}
-static int snd_pcm_oss_sync(snd_pcm_oss_file_t *pcm_oss_file)
+static int snd_pcm_oss_sync(struct snd_pcm_oss_file *pcm_oss_file)
{
int err = 0;
unsigned int saved_f_flags;
- snd_pcm_substream_t *substream;
- snd_pcm_runtime_t *runtime;
+ struct snd_pcm_substream *substream;
+ struct snd_pcm_runtime *runtime;
snd_pcm_format_t format;
unsigned long width;
size_t size;
@@ -1117,13 +1117,13 @@ static int snd_pcm_oss_sync(snd_pcm_oss_file_t *pcm_oss_file)
return 0;
}
-static int snd_pcm_oss_set_rate(snd_pcm_oss_file_t *pcm_oss_file, int rate)
+static int snd_pcm_oss_set_rate(struct snd_pcm_oss_file *pcm_oss_file, int rate)
{
int idx;
for (idx = 1; idx >= 0; --idx) {
- snd_pcm_substream_t *substream = pcm_oss_file->streams[idx];
- snd_pcm_runtime_t *runtime;
+ struct snd_pcm_substream *substream = pcm_oss_file->streams[idx];
+ struct snd_pcm_runtime *runtime;
if (substream == NULL)
continue;
runtime = substream->runtime;
@@ -1139,9 +1139,9 @@ static int snd_pcm_oss_set_rate(snd_pcm_oss_file_t *pcm_oss_file, int rate)
return snd_pcm_oss_get_rate(pcm_oss_file);
}
-static int snd_pcm_oss_get_rate(snd_pcm_oss_file_t *pcm_oss_file)
+static int snd_pcm_oss_get_rate(struct snd_pcm_oss_file *pcm_oss_file)
{
- snd_pcm_substream_t *substream;
+ struct snd_pcm_substream *substream;
int err;
if ((err = snd_pcm_oss_get_active_substream(pcm_oss_file, &substream)) < 0)
@@ -1149,7 +1149,7 @@ static int snd_pcm_oss_get_rate(snd_pcm_oss_file_t *pcm_oss_file)
return substream->runtime->oss.rate;
}
-static int snd_pcm_oss_set_channels(snd_pcm_oss_file_t *pcm_oss_file, unsigned int channels)
+static int snd_pcm_oss_set_channels(struct snd_pcm_oss_file *pcm_oss_file, unsigned int channels)
{
int idx;
if (channels < 1)
@@ -1157,8 +1157,8 @@ static int snd_pcm_oss_set_channels(snd_pcm_oss_file_t *pcm_oss_file, unsigned i
if (channels > 128)
return -EINVAL;
for (idx = 1; idx >= 0; --idx) {
- snd_pcm_substream_t *substream = pcm_oss_file->streams[idx];
- snd_pcm_runtime_t *runtime;
+ struct snd_pcm_substream *substream = pcm_oss_file->streams[idx];
+ struct snd_pcm_runtime *runtime;
if (substream == NULL)
continue;
runtime = substream->runtime;
@@ -1170,9 +1170,9 @@ static int snd_pcm_oss_set_channels(snd_pcm_oss_file_t *pcm_oss_file, unsigned i
return snd_pcm_oss_get_channels(pcm_oss_file);
}
-static int snd_pcm_oss_get_channels(snd_pcm_oss_file_t *pcm_oss_file)
+static int snd_pcm_oss_get_channels(struct snd_pcm_oss_file *pcm_oss_file)
{
- snd_pcm_substream_t *substream;
+ struct snd_pcm_substream *substream;
int err;
if ((err = snd_pcm_oss_get_active_substream(pcm_oss_file, &substream)) < 0)
@@ -1180,9 +1180,9 @@ static int snd_pcm_oss_get_channels(snd_pcm_oss_file_t *pcm_oss_file)
return substream->runtime->oss.channels;
}
-static int snd_pcm_oss_get_block_size(snd_pcm_oss_file_t *pcm_oss_file)
+static int snd_pcm_oss_get_block_size(struct snd_pcm_oss_file *pcm_oss_file)
{
- snd_pcm_substream_t *substream;
+ struct snd_pcm_substream *substream;
int err;
if ((err = snd_pcm_oss_get_active_substream(pcm_oss_file, &substream)) < 0)
@@ -1190,14 +1190,14 @@ static int snd_pcm_oss_get_block_size(snd_pcm_oss_file_t *pcm_oss_file)
return substream->runtime->oss.period_bytes;
}
-static int snd_pcm_oss_get_formats(snd_pcm_oss_file_t *pcm_oss_file)
+static int snd_pcm_oss_get_formats(struct snd_pcm_oss_file *pcm_oss_file)
{
- snd_pcm_substream_t *substream;
+ struct snd_pcm_substream *substream;
int err;
int direct;
- snd_pcm_hw_params_t *params;
+ struct snd_pcm_hw_params *params;
unsigned int formats = 0;
- snd_mask_t format_mask;
+ struct snd_mask format_mask;
int fmt;
if ((err = snd_pcm_oss_get_active_substream(pcm_oss_file, &substream)) < 0)
@@ -1205,7 +1205,7 @@ static int snd_pcm_oss_get_formats(snd_pcm_oss_file_t *pcm_oss_file)
if (atomic_read(&substream->runtime->mmap_count)) {
direct = 1;
} else {
- snd_pcm_oss_setup_t *setup = substream->oss.setup;
+ struct snd_pcm_oss_setup *setup = substream->oss.setup;
direct = (setup != NULL && setup->direct);
}
if (!direct)
@@ -1231,7 +1231,7 @@ static int snd_pcm_oss_get_formats(snd_pcm_oss_file_t *pcm_oss_file)
return formats;
}
-static int snd_pcm_oss_set_format(snd_pcm_oss_file_t *pcm_oss_file, int format)
+static int snd_pcm_oss_set_format(struct snd_pcm_oss_file *pcm_oss_file, int format)
{
int formats, idx;
@@ -1240,8 +1240,8 @@ static int snd_pcm_oss_set_format(snd_pcm_oss_file_t *pcm_oss_file, int format)
if (!(formats & format))
format = AFMT_U8;
for (idx = 1; idx >= 0; --idx) {
- snd_pcm_substream_t *substream = pcm_oss_file->streams[idx];
- snd_pcm_runtime_t *runtime;
+ struct snd_pcm_substream *substream = pcm_oss_file->streams[idx];
+ struct snd_pcm_runtime *runtime;
if (substream == NULL)
continue;
runtime = substream->runtime;
@@ -1254,9 +1254,9 @@ static int snd_pcm_oss_set_format(snd_pcm_oss_file_t *pcm_oss_file, int format)
return snd_pcm_oss_get_format(pcm_oss_file);
}
-static int snd_pcm_oss_get_format(snd_pcm_oss_file_t *pcm_oss_file)
+static int snd_pcm_oss_get_format(struct snd_pcm_oss_file *pcm_oss_file)
{
- snd_pcm_substream_t *substream;
+ struct snd_pcm_substream *substream;
int err;
if ((err = snd_pcm_oss_get_active_substream(pcm_oss_file, &substream)) < 0)
@@ -1264,9 +1264,9 @@ static int snd_pcm_oss_get_format(snd_pcm_oss_file_t *pcm_oss_file)
return substream->runtime->oss.format;
}
-static int snd_pcm_oss_set_subdivide1(snd_pcm_substream_t *substream, int subdivide)
+static int snd_pcm_oss_set_subdivide1(struct snd_pcm_substream *substream, int subdivide)
{
- snd_pcm_runtime_t *runtime;
+ struct snd_pcm_runtime *runtime;
if (substream == NULL)
return 0;
@@ -1287,12 +1287,12 @@ static int snd_pcm_oss_set_subdivide1(snd_pcm_substream_t *substream, int subdiv
return subdivide;
}
-static int snd_pcm_oss_set_subdivide(snd_pcm_oss_file_t *pcm_oss_file, int subdivide)
+static int snd_pcm_oss_set_subdivide(struct snd_pcm_oss_file *pcm_oss_file, int subdivide)
{
int err = -EINVAL, idx;
for (idx = 1; idx >= 0; --idx) {
- snd_pcm_substream_t *substream = pcm_oss_file->streams[idx];
+ struct snd_pcm_substream *substream = pcm_oss_file->streams[idx];
if (substream == NULL)
continue;
if ((err = snd_pcm_oss_set_subdivide1(substream, subdivide)) < 0)
@@ -1301,9 +1301,9 @@ static int snd_pcm_oss_set_subdivide(snd_pcm_oss_file_t *pcm_oss_file, int subdi
return err;
}
-static int snd_pcm_oss_set_fragment1(snd_pcm_substream_t *substream, unsigned int val)
+static int snd_pcm_oss_set_fragment1(struct snd_pcm_substream *substream, unsigned int val)
{
- snd_pcm_runtime_t *runtime;
+ struct snd_pcm_runtime *runtime;
if (substream == NULL)
return 0;
@@ -1320,12 +1320,12 @@ static int snd_pcm_oss_set_fragment1(snd_pcm_substream_t *substream, unsigned in
return 0;
}</