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_init.c
diff --git
a/sound/core/seq/oss/seq_oss_init.c
b/sound/core/seq/oss/seq_oss_init.c
index
c8b199d
..
ca5a2ed
100644
(file)
--- a/
sound/core/seq/oss/seq_oss_init.c
+++ b/
sound/core/seq/oss/seq_oss_init.c
@@
-41,17
+41,17
@@
static int system_client = -1; /* ALSA sequencer client number */
static int system_port = -1;
static int num_clients;
static int system_port = -1;
static int num_clients;
-static s
eq_oss_devinfo_t
*client_table[SNDRV_SEQ_OSS_MAX_CLIENTS];
+static s
truct seq_oss_devinfo
*client_table[SNDRV_SEQ_OSS_MAX_CLIENTS];
/*
* prototypes
*/
/*
* prototypes
*/
-static int receive_announce(s
nd_seq_event_
t *ev, int direct, void *private, int atomic, int hop);
+static int receive_announce(s
truct snd_seq_even
t *ev, int direct, void *private, int atomic, int hop);
static int translate_mode(struct file *file);
static int translate_mode(struct file *file);
-static int create_port(s
eq_oss_devinfo_t
*dp);
-static int delete_port(s
eq_oss_devinfo_t
*dp);
-static int alloc_seq_queue(s
eq_oss_devinfo_t
*dp);
+static int create_port(s
truct seq_oss_devinfo
*dp);
+static int delete_port(s
truct seq_oss_devinfo
*dp);
+static int alloc_seq_queue(s
truct seq_oss_devinfo
*dp);
static int delete_seq_queue(int queue);
static void free_devinfo(void *private);
static int delete_seq_queue(int queue);
static void free_devinfo(void *private);
@@
-65,53
+65,44
@@
int __init
snd_seq_oss_create_client(void)
{
int rc;
snd_seq_oss_create_client(void)
{
int rc;
- snd_seq_client_callback_t callback;
- snd_seq_client_info_t info;
- snd_seq_port_info_t port;
- snd_seq_port_callback_t port_callback;
+ struct snd_seq_port_info *port;
+ struct snd_seq_port_callback port_callback;
- /* create ALSA client */
- memset(&callback, 0, sizeof(callback));
-
- callback.private_data = NULL;
- callback.allow_input = 1;
- callback.allow_output = 1;
+ port = kmalloc(sizeof(*port), GFP_KERNEL);
+ if (!port) {
+ rc = -ENOMEM;
+ goto __error;
+ }
- rc = snd_seq_create_kernel_client(NULL, SNDRV_SEQ_CLIENT_OSS, &callback);
+ /* create ALSA client */
+ rc = snd_seq_create_kernel_client(NULL, SNDRV_SEQ_CLIENT_OSS,
+ "OSS sequencer");
if (rc < 0)
if (rc < 0)
-
return rc
;
+
goto __error
;
system_client = rc;
debug_printk(("new client = %d\n", rc));
system_client = rc;
debug_printk(("new client = %d\n", rc));
- /* set client information */
- memset(&info, 0, sizeof(info));
- info.client = system_client;
- info.type = KERNEL_CLIENT;
- strcpy(info.name, "OSS sequencer");
-
- rc = call_ctl(SNDRV_SEQ_IOCTL_SET_CLIENT_INFO, &info);
-
/* look up midi devices */
snd_seq_oss_midi_lookup_ports(system_client);
/* create annoucement receiver port */
/* look up midi devices */
snd_seq_oss_midi_lookup_ports(system_client);
/* create annoucement receiver port */
- memset(
&port, 0, sizeof(
port));
- strcpy(port
.
name, "Receiver");
- port
.
addr.client = system_client;
- port
.
capability = SNDRV_SEQ_PORT_CAP_WRITE; /* receive only */
- port
.
type = 0;
+ memset(
port, 0, sizeof(*
port));
+ strcpy(port
->
name, "Receiver");
+ port
->
addr.client = system_client;
+ port
->
capability = SNDRV_SEQ_PORT_CAP_WRITE; /* receive only */
+ port
->
type = 0;
memset(&port_callback, 0, sizeof(port_callback));
/* don't set port_callback.owner here. otherwise the module counter
* is incremented and we can no longer release the module..
*/
port_callback.event_input = receive_announce;
memset(&port_callback, 0, sizeof(port_callback));
/* don't set port_callback.owner here. otherwise the module counter
* is incremented and we can no longer release the module..
*/
port_callback.event_input = receive_announce;
- port
.
kernel = &port_callback;
+ port
->
kernel = &port_callback;
- call_ctl(SNDRV_SEQ_IOCTL_CREATE_PORT,
&
port);
- if ((system_port = port
.
addr.port) >= 0) {
- s
nd_seq_port_subscribe_t
subs;
+ call_ctl(SNDRV_SEQ_IOCTL_CREATE_PORT, port);
+ if ((system_port = port
->
addr.port) >= 0) {
+ s
truct snd_seq_port_subscribe
subs;
memset(&subs, 0, sizeof(subs));
subs.sender.client = SNDRV_SEQ_CLIENT_SYSTEM;
memset(&subs, 0, sizeof(subs));
subs.sender.client = SNDRV_SEQ_CLIENT_SYSTEM;
@@
-120,9
+111,11
@@
snd_seq_oss_create_client(void)
subs.dest.port = system_port;
call_ctl(SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT, &subs);
}
subs.dest.port = system_port;
call_ctl(SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT, &subs);
}
+ rc = 0;
-
- return 0;
+ __error:
+ kfree(port);
+ return rc;
}
}
@@
-130,9
+123,9
@@
snd_seq_oss_create_client(void)
* receive annoucement from system port, and check the midi device
*/
static int
* receive annoucement from system port, and check the midi device
*/
static int
-receive_announce(s
nd_seq_event_
t *ev, int direct, void *private, int atomic, int hop)
+receive_announce(s
truct snd_seq_even
t *ev, int direct, void *private, int atomic, int hop)
{
{
- s
nd_seq_port_info_t
pinfo;
+ s
truct snd_seq_port_info
pinfo;
if (atomic)
return 0; /* it must not happen */
if (atomic)
return 0; /* it must not happen */
@@
-181,9
+174,9
@@
int
snd_seq_oss_open(struct file *file, int level)
{
int i, rc;
snd_seq_oss_open(struct file *file, int level)
{
int i, rc;
- s
eq_oss_devinfo_t
*dp;
+ s
truct seq_oss_devinfo
*dp;
- if ((dp =
snd_kc
alloc(sizeof(*dp), GFP_KERNEL)) == NULL) {
+ if ((dp =
kz
alloc(sizeof(*dp), GFP_KERNEL)) == NULL) {
snd_printk(KERN_ERR "can't malloc device info\n");
return -ENOMEM;
}
snd_printk(KERN_ERR "can't malloc device info\n");
return -ENOMEM;
}
@@
-211,7
+204,7
@@
snd_seq_oss_open(struct file *file, int level)
snd_seq_oss_midi_setup(dp);
if (dp->synth_opened == 0 && dp->max_mididev == 0) {
snd_seq_oss_midi_setup(dp);
if (dp->synth_opened == 0 && dp->max_mididev == 0) {
- snd_printk(KERN_ERR "no device found\n");
+ /* snd_printk(KERN_ERR "no device found\n"); */
rc = -ENODEV;
goto _error;
}
rc = -ENODEV;
goto _error;
}
@@
-313,11
+306,11
@@
translate_mode(struct file *file)
* create sequencer port
*/
static int
* create sequencer port
*/
static int
-create_port(s
eq_oss_devinfo_t
*dp)
+create_port(s
truct seq_oss_devinfo
*dp)
{
int rc;
{
int rc;
- s
nd_seq_port_info_t
port;
- s
nd_seq_port_callback_t
callback;
+ s
truct snd_seq_port_info
port;
+ s
truct snd_seq_port_callback
callback;
memset(&port, 0, sizeof(port));
port.addr.client = dp->cseq;
memset(&port, 0, sizeof(port));
port.addr.client = dp->cseq;
@@
-348,7
+341,7
@@
create_port(seq_oss_devinfo_t *dp)
* delete ALSA port
*/
static int
* delete ALSA port
*/
static int
-delete_port(s
eq_oss_devinfo_t
*dp)
+delete_port(s
truct seq_oss_devinfo
*dp)
{
if (dp->port < 0)
return 0;
{
if (dp->port < 0)
return 0;
@@
-361,9
+354,9
@@
delete_port(seq_oss_devinfo_t *dp)
* allocate a queue
*/
static int
* allocate a queue
*/
static int
-alloc_seq_queue(s
eq_oss_devinfo_t
*dp)
+alloc_seq_queue(s
truct seq_oss_devinfo
*dp)
{
{
- s
nd_seq_queue_info_t
qinfo;
+ s
truct snd_seq_queue_info
qinfo;
int rc;
memset(&qinfo, 0, sizeof(qinfo));
int rc;
memset(&qinfo, 0, sizeof(qinfo));
@@
-382,7
+375,7
@@
alloc_seq_queue(seq_oss_devinfo_t *dp)
static int
delete_seq_queue(int queue)
{
static int
delete_seq_queue(int queue)
{
- s
nd_seq_queue_info_t
qinfo;
+ s
truct snd_seq_queue_info
qinfo;
int rc;
if (queue < 0)
int rc;
if (queue < 0)
@@
-402,7
+395,7
@@
delete_seq_queue(int queue)
static void
free_devinfo(void *private)
{
static void
free_devinfo(void *private)
{
- s
eq_oss_devinfo_t *dp = (seq_oss_devinfo_t
*)private;
+ s
truct seq_oss_devinfo *dp = (struct seq_oss_devinfo
*)private;
if (dp->timer)
snd_seq_oss_timer_delete(dp->timer);
if (dp->timer)
snd_seq_oss_timer_delete(dp->timer);
@@
-421,7
+414,7
@@
free_devinfo(void *private)
* close sequencer device
*/
void
* close sequencer device
*/
void
-snd_seq_oss_release(s
eq_oss_devinfo_t
*dp)
+snd_seq_oss_release(s
truct seq_oss_devinfo
*dp)
{
int queue;
{
int queue;
@@
-450,7
+443,7
@@
snd_seq_oss_release(seq_oss_devinfo_t *dp)
* Wait until the queue is empty (if we don't have nonblock)
*/
void
* Wait until the queue is empty (if we don't have nonblock)
*/
void
-snd_seq_oss_drain_write(s
eq_oss_devinfo_t
*dp)
+snd_seq_oss_drain_write(s
truct seq_oss_devinfo
*dp)
{
if (! dp->timer->running)
return;
{
if (! dp->timer->running)
return;
@@
-467,7
+460,7
@@
snd_seq_oss_drain_write(seq_oss_devinfo_t *dp)
* reset sequencer devices
*/
void
* reset sequencer devices
*/
void
-snd_seq_oss_reset(s
eq_oss_devinfo_t
*dp)
+snd_seq_oss_reset(s
truct seq_oss_devinfo
*dp)
{
int i;
{
int i;
@@
-491,14
+484,35
@@
snd_seq_oss_reset(seq_oss_devinfo_t *dp)
snd_seq_oss_timer_stop(dp->timer);
}
snd_seq_oss_timer_stop(dp->timer);
}
+
+#ifdef CONFIG_PROC_FS
+/*
+ * misc. functions for proc interface
+ */
+char *
+enabled_str(int bool)
+{
+ return bool ? "enabled" : "disabled";
+}
+
+static char *
+filemode_str(int val)
+{
+ static char *str[] = {
+ "none", "read", "write", "read/write",
+ };
+ return str[val & SNDRV_SEQ_OSS_FILE_ACMODE];
+}
+
+
/*
* proc interface
*/
void
/*
* proc interface
*/
void
-snd_seq_oss_system_info_read(s
nd_info_buffer_t
*buf)
+snd_seq_oss_system_info_read(s
truct snd_info_buffer
*buf)
{
int i;
{
int i;
- s
eq_oss_devinfo_t
*dp;
+ s
truct seq_oss_devinfo
*dp;
snd_iprintf(buf, "ALSA client number %d\n", system_client);
snd_iprintf(buf, "ALSA receiver port %d\n", system_port);
snd_iprintf(buf, "ALSA client number %d\n", system_client);
snd_iprintf(buf, "ALSA receiver port %d\n", system_port);
@@
-522,23
+536,4
@@
snd_seq_oss_system_info_read(snd_info_buffer_t *buf)
snd_seq_oss_readq_info_read(dp->readq, buf);
}
}
snd_seq_oss_readq_info_read(dp->readq, buf);
}
}
-
-/*
- * misc. functions for proc interface
- */
-char *
-enabled_str(int bool)
-{
- return bool ? "enabled" : "disabled";
-}
-
-char *
-filemode_str(int val)
-{
- static char *str[] = {
- "none", "read", "write", "read/write",
- };
- return str[val & SNDRV_SEQ_OSS_FILE_ACMODE];
-}
-
-
+#endif /* CONFIG_PROC_FS */