31 #include <linux/export.h>
33 #include <linux/slab.h>
42 static int system_client = -1;
43 static int system_port = -1;
45 static int num_clients;
52 static int receive_announce(
struct snd_seq_event *ev,
int direct,
void *
private,
int atomic,
int hop);
53 static int translate_mode(
struct file *
file);
57 static int delete_seq_queue(
int queue);
58 static void free_devinfo(
void *
private);
60 #define call_ctl(type,rec) snd_seq_kernel_client_ctl(system_client, type, rec)
92 memset(port, 0,
sizeof(*port));
93 strcpy(port->name,
"Receiver");
94 port->addr.client = system_client;
98 memset(&port_callback, 0,
sizeof(port_callback));
103 port->kernel = &port_callback;
106 if ((system_port = port->addr.port) >= 0) {
109 memset(&subs, 0,
sizeof(subs));
112 subs.
dest.client = system_client;
113 subs.
dest.port = system_port;
138 if (ev->
data.
addr.client == system_client)
147 if (ev->
data.
addr.client == system_client)
163 if (system_client >= 0)
188 dp->
cseq = system_client;
193 if (client_table[i] ==
NULL)
198 if (i >= SNDRV_SEQ_OSS_MAX_CLIENTS) {
216 rc = create_port(dp);
224 rc = alloc_seq_queue(dp);
287 delete_seq_queue(dp->
queue);
325 port.midi_channels = 128;
326 port.synth_voices = 128;
332 callback.private_free = free_devinfo;
369 memset(&qinfo, 0,
sizeof(qinfo));
370 qinfo.owner = system_client;
372 strcpy(qinfo.name,
"OSS Sequencer Emulation");
375 dp->
queue = qinfo.queue;
383 delete_seq_queue(
int queue)
390 memset(&qinfo, 0,
sizeof(qinfo));
394 printk(
KERN_ERR "seq-oss: unable to delete queue %d (%d)\n", queue, rc);
403 free_devinfo(
void *
private)
443 delete_seq_queue(queue);
455 if (! dp->
timer->running)
495 #ifdef CONFIG_PROC_FS
502 return bool ?
"enabled" :
"disabled";
506 filemode_str(
int val)
508 static char *
str[] = {
509 "none",
"read",
"write",
"read/write",
524 snd_iprintf(buf,
"ALSA client number %d\n", system_client);
525 snd_iprintf(buf,
"ALSA receiver port %d\n", system_port);
527 snd_iprintf(buf,
"\nNumber of applications: %d\n", num_clients);
528 for (i = 0; i < num_clients; i++) {
529 snd_iprintf(buf,
"\nApplication %d: ", i);
530 if ((dp = client_table[i]) ==
NULL) {
531 snd_iprintf(buf,
"*empty*\n");
534 snd_iprintf(buf,
"port %d : queue %d\n", dp->
port, dp->
queue);
535 snd_iprintf(buf,
" sequencer mode = %s : file open mode = %s\n",
539 snd_iprintf(buf,
" timer tempo = %d, timebase = %d\n",
540 dp->
timer->oss_tempo, dp->
timer->oss_timebase);
541 snd_iprintf(buf,
" max queue length %d\n", maxqlen);