git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
sound
/
core
/
seq
/
oss
/
seq_oss_synth.c
diff --git
a/sound/core/seq/oss/seq_oss_synth.c
b/sound/core/seq/oss/seq_oss_synth.c
index
638cc14
..
ab570a0
100644
(file)
--- a/
sound/core/seq/oss/seq_oss_synth.c
+++ b/
sound/core/seq/oss/seq_oss_synth.c
@@
-37,14
+37,14
@@
*/
/* sysex buffer */
*/
/* sysex buffer */
-struct seq_oss_synth_sysex
_t
{
+struct seq_oss_synth_sysex {
int len;
int skip;
unsigned char buf[MAX_SYSEX_BUFLEN];
};
/* synth info */
int len;
int skip;
unsigned char buf[MAX_SYSEX_BUFLEN];
};
/* synth info */
-struct seq_oss_synth
_t
{
+struct seq_oss_synth {
int seq_device;
/* for synth_info */
int seq_device;
/* for synth_info */
@@
-53,7
+53,7
@@
struct seq_oss_synth_t {
int nr_voices;
char name[SNDRV_SEQ_OSS_MAX_SYNTH_NAME];
int nr_voices;
char name[SNDRV_SEQ_OSS_MAX_SYNTH_NAME];
- s
nd_seq_oss_callback_t
oper;
+ s
truct snd_seq_oss_callback
oper;
int opened;
int opened;
@@
-66,8
+66,8
@@
struct seq_oss_synth_t {
* device table
*/
static int max_synth_devs;
* device table
*/
static int max_synth_devs;
-static s
eq_oss_synth_t
*synth_devs[SNDRV_SEQ_OSS_MAX_SYNTH_DEVS];
-static s
eq_oss_synth_t
midi_synth_dev = {
+static s
truct seq_oss_synth
*synth_devs[SNDRV_SEQ_OSS_MAX_SYNTH_DEVS];
+static s
truct seq_oss_synth
midi_synth_dev = {
-1, /* seq_device */
SYNTH_TYPE_MIDI, /* synth_type */
0, /* synth_subtype */
-1, /* seq_device */
SYNTH_TYPE_MIDI, /* synth_type */
0, /* synth_subtype */
@@
-80,8
+80,8
@@
static DEFINE_SPINLOCK(register_lock);
/*
* prototypes
*/
/*
* prototypes
*/
-static s
eq_oss_synth_t *get_synthdev(seq_oss_devinfo_t
*dp, int dev);
-static void reset_channels(s
eq_oss_synthinfo_t
*info);
+static s
truct seq_oss_synth *get_synthdev(struct seq_oss_devinfo
*dp, int dev);
+static void reset_channels(s
truct seq_oss_synthinfo
*info);
/*
* global initialization
/*
* global initialization
@@
-96,14
+96,14
@@
snd_seq_oss_synth_init(void)
* registration of the synth device
*/
int
* registration of the synth device
*/
int
-snd_seq_oss_synth_register(s
nd_seq_device_t
*dev)
+snd_seq_oss_synth_register(s
truct snd_seq_device
*dev)
{
int i;
{
int i;
- s
eq_oss_synth_t
*rec;
- s
nd_seq_oss_reg_t
*reg = SNDRV_SEQ_DEVICE_ARGPTR(dev);
+ s
truct seq_oss_synth
*rec;
+ s
truct snd_seq_oss_reg
*reg = SNDRV_SEQ_DEVICE_ARGPTR(dev);
unsigned long flags;
unsigned long flags;
- if ((rec = k
calloc(1,
sizeof(*rec), GFP_KERNEL)) == NULL) {
+ if ((rec = k
zalloc(
sizeof(*rec), GFP_KERNEL)) == NULL) {
snd_printk(KERN_ERR "can't malloc synth info\n");
return -ENOMEM;
}
snd_printk(KERN_ERR "can't malloc synth info\n");
return -ENOMEM;
}
@@
-148,10
+148,10
@@
snd_seq_oss_synth_register(snd_seq_device_t *dev)
int
int
-snd_seq_oss_synth_unregister(s
nd_seq_device_t
*dev)
+snd_seq_oss_synth_unregister(s
truct snd_seq_device
*dev)
{
int index;
{
int index;
- s
eq_oss_synth_t
*rec = dev->driver_data;
+ s
truct seq_oss_synth
*rec = dev->driver_data;
unsigned long flags;
spin_lock_irqsave(®ister_lock, flags);
unsigned long flags;
spin_lock_irqsave(®ister_lock, flags);
@@
-187,10
+187,10
@@
snd_seq_oss_synth_unregister(snd_seq_device_t *dev)
/*
*/
/*
*/
-static s
eq_oss_synth_t
*
+static s
truct seq_oss_synth
*
get_sdev(int dev)
{
get_sdev(int dev)
{
- s
eq_oss_synth_t
*rec;
+ s
truct seq_oss_synth
*rec;
unsigned long flags;
spin_lock_irqsave(®ister_lock, flags);
unsigned long flags;
spin_lock_irqsave(®ister_lock, flags);
@@
-207,11
+207,11
@@
get_sdev(int dev)
*/
void
*/
void
-snd_seq_oss_synth_setup(s
eq_oss_devinfo_t
*dp)
+snd_seq_oss_synth_setup(s
truct seq_oss_devinfo
*dp)
{
int i;
{
int i;
- s
eq_oss_synth_t
*rec;
- s
eq_oss_synthinfo_t
*info;
+ s
truct seq_oss_synth
*rec;
+ s
truct seq_oss_synthinfo
*info;
dp->max_synthdev = max_synth_devs;
dp->synth_opened = 0;
dp->max_synthdev = max_synth_devs;
dp->synth_opened = 0;
@@
-244,7
+244,7
@@
snd_seq_oss_synth_setup(seq_oss_devinfo_t *dp)
}
info->nr_voices = rec->nr_voices;
if (info->nr_voices > 0) {
}
info->nr_voices = rec->nr_voices;
if (info->nr_voices > 0) {
- info->ch = kcalloc(info->nr_voices, sizeof(s
eq_oss_chinfo_t
), GFP_KERNEL);
+ info->ch = kcalloc(info->nr_voices, sizeof(s
truct seq_oss_chinfo
), GFP_KERNEL);
if (!info->ch)
BUG();
reset_channels(info);
if (!info->ch)
BUG();
reset_channels(info);
@@
-263,7
+263,7
@@
snd_seq_oss_synth_setup(seq_oss_devinfo_t *dp)
*/
void
*/
void
-snd_seq_oss_synth_setup_midi(s
eq_oss_devinfo_t
*dp)
+snd_seq_oss_synth_setup_midi(s
truct seq_oss_devinfo
*dp)
{
int i;
{
int i;
@@
-271,7
+271,7
@@
snd_seq_oss_synth_setup_midi(seq_oss_devinfo_t *dp)
return;
for (i = 0; i < dp->max_mididev; i++) {
return;
for (i = 0; i < dp->max_mididev; i++) {
- s
eq_oss_synthinfo_t
*info;
+ s
truct seq_oss_synthinfo
*info;
info = &dp->synths[dp->max_synthdev];
if (snd_seq_oss_midi_open(dp, i, dp->file_mode) < 0)
continue;
info = &dp->synths[dp->max_synthdev];
if (snd_seq_oss_midi_open(dp, i, dp->file_mode) < 0)
continue;
@@
-297,11
+297,11
@@
snd_seq_oss_synth_setup_midi(seq_oss_devinfo_t *dp)
*/
void
*/
void
-snd_seq_oss_synth_cleanup(s
eq_oss_devinfo_t
*dp)
+snd_seq_oss_synth_cleanup(s
truct seq_oss_devinfo
*dp)
{
int i;
{
int i;
- s
eq_oss_synth_t
*rec;
- s
eq_oss_synthinfo_t
*info;
+ s
truct seq_oss_synth
*rec;
+ s
truct seq_oss_synthinfo
*info;
snd_assert(dp->max_synthdev <= SNDRV_SEQ_OSS_MAX_SYNTH_DEVS, return);
for (i = 0; i < dp->max_synthdev; i++) {
snd_assert(dp->max_synthdev <= SNDRV_SEQ_OSS_MAX_SYNTH_DEVS, return);
for (i = 0; i < dp->max_synthdev; i++) {
@@
-325,14
+325,10
@@
snd_seq_oss_synth_cleanup(seq_oss_devinfo_t *dp)
}
snd_use_lock_free(&rec->use_lock);
}
}
snd_use_lock_free(&rec->use_lock);
}
- if (info->sysex) {
- kfree(info->sysex);
- info->sysex = NULL;
- }
- if (info->ch) {
- kfree(info->ch);
- info->ch = NULL;
- }
+ kfree(info->sysex);
+ info->sysex = NULL;
+ kfree(info->ch);
+ info->ch = NULL;
}
dp->synth_opened = 0;
dp->max_synthdev = 0;
}
dp->synth_opened = 0;
dp->max_synthdev = 0;
@@
-342,7
+338,7
@@
snd_seq_oss_synth_cleanup(seq_oss_devinfo_t *dp)
* check if the specified device is MIDI mapped device
*/
static int
* check if the specified device is MIDI mapped device
*/
static int
-is_midi_dev(s
eq_oss_devinfo_t
*dp, int dev)
+is_midi_dev(s
truct seq_oss_devinfo
*dp, int dev)
{
if (dev < 0 || dev >= dp->max_synthdev)
return 0;
{
if (dev < 0 || dev >= dp->max_synthdev)
return 0;
@@
-354,10
+350,10
@@
is_midi_dev(seq_oss_devinfo_t *dp, int dev)
/*
* return synth device information pointer
*/
/*
* return synth device information pointer
*/
-static s
eq_oss_synth_t
*
-get_synthdev(s
eq_oss_devinfo_t
*dp, int dev)
+static s
truct seq_oss_synth
*
+get_synthdev(s
truct seq_oss_devinfo
*dp, int dev)
{
{
- s
eq_oss_synth_t
*rec;
+ s
truct seq_oss_synth
*rec;
if (dev < 0 || dev >= dp->max_synthdev)
return NULL;
if (! dp->synths[dev].opened)
if (dev < 0 || dev >= dp->max_synthdev)
return NULL;
if (! dp->synths[dev].opened)
@@
-378,7
+374,7
@@
get_synthdev(seq_oss_devinfo_t *dp, int dev)
* reset note and velocity on each channel.
*/
static void
* reset note and velocity on each channel.
*/
static void
-reset_channels(s
eq_oss_synthinfo_t
*info)
+reset_channels(s
truct seq_oss_synthinfo
*info)
{
int i;
if (info->ch == NULL || ! info->nr_voices)
{
int i;
if (info->ch == NULL || ! info->nr_voices)
@@
-396,10
+392,10
@@
reset_channels(seq_oss_synthinfo_t *info)
* event to the corresponding port.
*/
void
* event to the corresponding port.
*/
void
-snd_seq_oss_synth_reset(s
eq_oss_devinfo_t
*dp, int dev)
+snd_seq_oss_synth_reset(s
truct seq_oss_devinfo
*dp, int dev)
{
{
- s
eq_oss_synth_t
*rec;
- s
eq_oss_synthinfo_t
*info;
+ s
truct seq_oss_synth
*rec;
+ s
truct seq_oss_synthinfo
*info;
snd_assert(dev >= 0 && dev < dp->max_synthdev, return);
info = &dp->synths[dev];
snd_assert(dev >= 0 && dev < dp->max_synthdev, return);
info = &dp->synths[dev];
@@
-418,14
+414,10
@@
snd_seq_oss_synth_reset(seq_oss_devinfo_t *dp, int dev)
dp->file_mode) < 0) {
midi_synth_dev.opened--;
info->opened = 0;
dp->file_mode) < 0) {
midi_synth_dev.opened--;
info->opened = 0;
- if (info->sysex) {
- kfree(info->sysex);
- info->sysex = NULL;
- }
- if (info->ch) {
- kfree(info->ch);
- info->ch = NULL;
- }
+ kfree(info->sysex);
+ info->sysex = NULL;
+ kfree(info->ch);
+ info->ch = NULL;
}
return;
}
}
return;
}
@@
-436,7
+428,7
@@
snd_seq_oss_synth_reset(seq_oss_devinfo_t *dp, int dev)
if (rec->oper.reset) {
rec->oper.reset(&info->arg);
} else {
if (rec->oper.reset) {
rec->oper.reset(&info->arg);
} else {
- s
nd_seq_event_
t ev;
+ s
truct snd_seq_even
t ev;
memset(&ev, 0, sizeof(ev));
snd_seq_oss_fill_addr(dp, &ev, info->arg.addr.client,
info->arg.addr.port);
memset(&ev, 0, sizeof(ev));
snd_seq_oss_fill_addr(dp, &ev, info->arg.addr.client,
info->arg.addr.port);
@@
-452,10
+444,10
@@
snd_seq_oss_synth_reset(seq_oss_devinfo_t *dp, int dev)
* call load_patch callback function
*/
int
* call load_patch callback function
*/
int
-snd_seq_oss_synth_load_patch(s
eq_oss_devinfo_t
*dp, int dev, int fmt,
+snd_seq_oss_synth_load_patch(s
truct seq_oss_devinfo
*dp, int dev, int fmt,
const char __user *buf, int p, int c)
{
const char __user *buf, int p, int c)
{
- s
eq_oss_synth_t
*rec;
+ s
truct seq_oss_synth
*rec;
int rc;
if (dev < 0 || dev >= dp->max_synthdev)
int rc;
if (dev < 0 || dev >= dp->max_synthdev)
@@
-478,9
+470,9
@@
snd_seq_oss_synth_load_patch(seq_oss_devinfo_t *dp, int dev, int fmt,
* check if the device is valid synth device
*/
int
* check if the device is valid synth device
*/
int
-snd_seq_oss_synth_is_valid(s
eq_oss_devinfo_t
*dp, int dev)
+snd_seq_oss_synth_is_valid(s
truct seq_oss_devinfo
*dp, int dev)
{
{
- s
eq_oss_synth_t
*rec;
+ s
truct seq_oss_synth
*rec;
rec = get_synthdev(dp, dev);
if (rec) {
snd_use_lock_free(&rec->use_lock);
rec = get_synthdev(dp, dev);
if (rec) {
snd_use_lock_free(&rec->use_lock);
@@
-496,18
+488,18
@@
snd_seq_oss_synth_is_valid(seq_oss_devinfo_t *dp, int dev)
* (0xff).
*/
int
* (0xff).
*/
int
-snd_seq_oss_synth_sysex(s
eq_oss_devinfo_t *dp, int dev, unsigned char *buf, snd_seq_event_
t *ev)
+snd_seq_oss_synth_sysex(s
truct seq_oss_devinfo *dp, int dev, unsigned char *buf, struct snd_seq_even
t *ev)
{
int i, send;
unsigned char *dest;
{
int i, send;
unsigned char *dest;
- s
eq_oss_synth_sysex_t
*sysex;
+ s
truct seq_oss_synth_sysex
*sysex;
if (! snd_seq_oss_synth_is_valid(dp, dev))
return -ENXIO;
sysex = dp->synths[dev].sysex;
if (sysex == NULL) {
if (! snd_seq_oss_synth_is_valid(dp, dev))
return -ENXIO;
sysex = dp->synths[dev].sysex;
if (sysex == NULL) {
- sysex = k
calloc(1,
sizeof(*sysex), GFP_KERNEL);
+ sysex = k
zalloc(
sizeof(*sysex), GFP_KERNEL);
if (sysex == NULL)
return -ENOMEM;
dp->synths[dev].sysex = sysex;
if (sysex == NULL)
return -ENOMEM;
dp->synths[dev].sysex = sysex;
@@
-553,7
+545,7
@@
snd_seq_oss_synth_sysex(seq_oss_devinfo_t *dp, int dev, unsigned char *buf, snd_
* fill the event source/destination addresses
*/
int
* fill the event source/destination addresses
*/
int
-snd_seq_oss_synth_addr(s
eq_oss_devinfo_t *dp, int dev, snd_seq_event_
t *ev)
+snd_seq_oss_synth_addr(s
truct seq_oss_devinfo *dp, int dev, struct snd_seq_even
t *ev)
{
if (! snd_seq_oss_synth_is_valid(dp, dev))
return -EINVAL;
{
if (! snd_seq_oss_synth_is_valid(dp, dev))
return -EINVAL;
@@
-567,9
+559,9
@@
snd_seq_oss_synth_addr(seq_oss_devinfo_t *dp, int dev, snd_seq_event_t *ev)
* OSS compatible ioctl
*/
int
* OSS compatible ioctl
*/
int
-snd_seq_oss_synth_ioctl(s
eq_oss_devinfo_t
*dp, int dev, unsigned int cmd, unsigned long addr)
+snd_seq_oss_synth_ioctl(s
truct seq_oss_devinfo
*dp, int dev, unsigned int cmd, unsigned long addr)
{
{
- s
eq_oss_synth_t
*rec;
+ s
truct seq_oss_synth
*rec;
int rc;
if (is_midi_dev(dp, dev))
int rc;
if (is_midi_dev(dp, dev))
@@
-589,7
+581,7
@@
snd_seq_oss_synth_ioctl(seq_oss_devinfo_t *dp, int dev, unsigned int cmd, unsign
* send OSS raw events - SEQ_PRIVATE and SEQ_VOLUME
*/
int
* send OSS raw events - SEQ_PRIVATE and SEQ_VOLUME
*/
int
-snd_seq_oss_synth_raw_event(s
eq_oss_devinfo_t *dp, int dev, unsigned char *data, snd_seq_event_
t *ev)
+snd_seq_oss_synth_raw_event(s
truct seq_oss_devinfo *dp, int dev, unsigned char *data, struct snd_seq_even
t *ev)
{
if (! snd_seq_oss_synth_is_valid(dp, dev) || is_midi_dev(dp, dev))
return -ENXIO;
{
if (! snd_seq_oss_synth_is_valid(dp, dev) || is_midi_dev(dp, dev))
return -ENXIO;
@@
-603,9
+595,9
@@
snd_seq_oss_synth_raw_event(seq_oss_devinfo_t *dp, int dev, unsigned char *data,
* create OSS compatible synth_info record
*/
int
* create OSS compatible synth_info record
*/
int
-snd_seq_oss_synth_make_info(s
eq_oss_devinfo_t
*dp, int dev, struct synth_info *inf)
+snd_seq_oss_synth_make_info(s
truct seq_oss_devinfo
*dp, int dev, struct synth_info *inf)
{
{
- s
eq_oss_synth_t
*rec;
+ s
truct seq_oss_synth
*rec;
if (dp->synths[dev].is_midi) {
struct midi_info minf;
if (dp->synths[dev].is_midi) {
struct midi_info minf;
@@
-629,14
+621,15
@@
snd_seq_oss_synth_make_info(seq_oss_devinfo_t *dp, int dev, struct synth_info *i
}
}
+#ifdef CONFIG_PROC_FS
/*
* proc interface
*/
void
/*
* proc interface
*/
void
-snd_seq_oss_synth_info_read(s
nd_info_buffer_t
*buf)
+snd_seq_oss_synth_info_read(s
truct snd_info_buffer
*buf)
{
int i;
{
int i;
- s
eq_oss_synth_t
*rec;
+ s
truct seq_oss_synth
*rec;
snd_iprintf(buf, "\nNumber of synth devices: %d\n", max_synth_devs);
for (i = 0; i < max_synth_devs; i++) {
snd_iprintf(buf, "\nNumber of synth devices: %d\n", max_synth_devs);
for (i = 0; i < max_synth_devs; i++) {
@@
-656,4
+649,4
@@
snd_seq_oss_synth_info_read(snd_info_buffer_t *buf)
snd_use_lock_free(&rec->use_lock);
}
}
snd_use_lock_free(&rec->use_lock);
}
}
-
+#endif /* CONFIG_PROC_FS */