/* max size of event size */
#define SNDRV_SEQ_MAX_EVENT_LEN 0x3fffffff
-/* call-backs for kernel client */
-
-struct snd_seq_client_callback {
- void *private_data;
- unsigned allow_input: 1,
- allow_output: 1;
- /*...*/
-};
-
/* call-backs for kernel port */
struct snd_seq_port_callback {
struct module *owner;
};
/* interface for kernel client */
-int snd_seq_create_kernel_client(struct snd_card *card, int client_index,
- struct snd_seq_client_callback *callback);
+int snd_seq_create_kernel_client(struct snd_card *card, int client_index);
int snd_seq_delete_kernel_client(int client);
int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, int atomic, int hop);
int snd_seq_kernel_client_dispatch(int client, struct snd_seq_event *ev, int atomic, int hop);
snd_seq_oss_create_client(void)
{
int rc;
- struct snd_seq_client_callback callback;
struct snd_seq_client_info *info;
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;
-
- rc = snd_seq_create_kernel_client(NULL, SNDRV_SEQ_CLIENT_OSS, &callback);
+ rc = snd_seq_create_kernel_client(NULL, SNDRV_SEQ_CLIENT_OSS);
if (rc < 0)
goto __error;
/* exported to kernel modules */
-int snd_seq_create_kernel_client(struct snd_card *card, int client_index,
- struct snd_seq_client_callback *callback)
+int snd_seq_create_kernel_client(struct snd_card *card, int client_index)
{
struct snd_seq_client *client;
snd_assert(! in_interrupt(), return -EBUSY);
- if (callback == NULL)
- return -EINVAL;
if (card && client_index > 3)
return -EINVAL;
if (card == NULL && client_index > 63)
}
usage_alloc(&client_usage, 1);
- client->accept_input = callback->allow_output;
- client->accept_output = callback->allow_input;
+ client->accept_input = 1;
+ client->accept_output = 1;
sprintf(client->name, "Client-%d", client->number);
int snd_seq_dispatch_event(struct snd_seq_event_cell *cell, int atomic, int hop);
/* exported to other modules */
-int snd_seq_register_kernel_client(struct snd_seq_client_callback *callback, void *private_data);
-int snd_seq_unregister_kernel_client(int client);
int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, int atomic, int hop);
int snd_seq_kernel_client_enqueue_blocking(int client, struct snd_seq_event * ev,
struct file *file, int atomic, int hop);
static int __init
register_client(void)
{
- struct snd_seq_client_callback cb;
struct snd_seq_client_info cinfo;
struct snd_seq_dummy_port *rec1, *rec2;
int i;
}
/* create client */
- memset(&cb, 0, sizeof(cb));
- cb.allow_input = 1;
- cb.allow_output = 1;
- my_client = snd_seq_create_kernel_client(NULL, SNDRV_SEQ_CLIENT_DUMMY, &cb);
+ my_client = snd_seq_create_kernel_client(NULL, SNDRV_SEQ_CLIENT_DUMMY);
if (my_client < 0)
return my_client;
struct snd_rawmidi_info *info;
int newclient = 0;
unsigned int p, ports;
- struct snd_seq_client_callback callbacks;
struct snd_seq_port_callback pcallbacks;
struct snd_card *card = dev->card;
int device = dev->device;
kfree(info);
return -ENOMEM;
}
- memset(&callbacks, 0, sizeof(callbacks));
- callbacks.private_data = client;
- callbacks.allow_input = callbacks.allow_output = 1;
- client->seq_client = snd_seq_create_kernel_client(card, 0, &callbacks);
+ client->seq_client = snd_seq_create_kernel_client(card, 0);
if (client->seq_client < 0) {
kfree(client);
up(®ister_mutex);
/* register our internal client */
int __init snd_seq_system_client_init(void)
{
-
- struct snd_seq_client_callback callbacks;
struct snd_seq_port_callback pcallbacks;
struct snd_seq_client_info *inf;
struct snd_seq_port_info *port;
return -ENOMEM;
}
- memset(&callbacks, 0, sizeof(callbacks));
memset(&pcallbacks, 0, sizeof(pcallbacks));
pcallbacks.owner = THIS_MODULE;
pcallbacks.event_input = event_input_timer;
/* register client */
- callbacks.allow_input = callbacks.allow_output = 1;
- sysclient = snd_seq_create_kernel_client(NULL, 0, &callbacks);
+ sysclient = snd_seq_create_kernel_client(NULL, 0);
/* set our name */
inf->client = 0;
static int snd_virmidi_dev_attach_seq(struct snd_virmidi_dev *rdev)
{
int client;
- struct snd_seq_client_callback callbacks;
struct snd_seq_port_callback pcallbacks;
struct snd_seq_client_info *info;
struct snd_seq_port_info *pinfo;
goto __error;
}
- memset(&callbacks, 0, sizeof(callbacks));
- callbacks.private_data = rdev;
- callbacks.allow_input = 1;
- callbacks.allow_output = 1;
- client = snd_seq_create_kernel_client(rdev->card, rdev->device, &callbacks);
+ client = snd_seq_create_kernel_client(rdev->card, rdev->device);
if (client < 0) {
err = client;
goto __error;
{
struct snd_opl3 *opl3;
int client;
- struct snd_seq_client_callback callbacks;
struct snd_seq_client_info cinfo;
int opl_ver;
opl3->seq_client = -1;
/* allocate new client */
- memset(&callbacks, 0, sizeof(callbacks));
- callbacks.private_data = opl3;
- callbacks.allow_output = callbacks.allow_input = 1;
client = opl3->seq_client =
- snd_seq_create_kernel_client(opl3->card, opl3->seq_dev_num, &callbacks);
+ snd_seq_create_kernel_client(opl3->card, opl3->seq_dev_num);
if (client < 0)
return client;
{
struct snd_opl4 *opl4;
int client;
- struct snd_seq_client_callback callbacks;
struct snd_seq_client_info cinfo;
struct snd_seq_port_callback pcallbacks;
opl4->chset->private_data = opl4;
/* allocate new client */
- memset(&callbacks, 0, sizeof(callbacks));
- callbacks.private_data = opl4;
- callbacks.allow_output = callbacks.allow_input = 1;
- client = snd_seq_create_kernel_client(opl4->card, opl4->seq_dev_num, &callbacks);
+ client = snd_seq_create_kernel_client(opl4->card, opl4->seq_dev_num);
if (client < 0) {
snd_midi_channel_free_set(opl4->chset);
return client;
{
struct snd_gus_card *gus;
int client, i;
- struct snd_seq_client_callback callbacks;
struct snd_seq_client_info *cinfo;
struct snd_seq_port_subscribe sub;
struct snd_iwffff_ops *iwops;
return -ENOMEM;
/* allocate new client */
- memset(&callbacks, 0, sizeof(callbacks));
- callbacks.private_data = gus;
- callbacks.allow_output = callbacks.allow_input = 1;
client = gus->gf1.seq_client =
- snd_seq_create_kernel_client(gus->card, 1, &callbacks);
+ snd_seq_create_kernel_client(gus->card, 1);
if (client < 0) {
kfree(cinfo);
return client;
{
struct snd_trident *trident;
int client, i;
- struct snd_seq_client_callback callbacks;
struct snd_seq_client_info cinfo;
struct snd_seq_port_subscribe sub;
struct snd_simple_ops *simpleops;
trident->synth.seq_client = -1;
/* allocate new client */
- memset(&callbacks, 0, sizeof(callbacks));
- callbacks.private_data = trident;
- callbacks.allow_output = callbacks.allow_input = 1;
client = trident->synth.seq_client =
- snd_seq_create_kernel_client(trident->card, 1, &callbacks);
+ snd_seq_create_kernel_client(trident->card, 1);
if (client < 0)
return client;
static int
get_client(struct snd_card *card, int index, char *name)
{
- struct snd_seq_client_callback callbacks;
struct snd_seq_client_info cinfo;
int client;
- memset(&callbacks, 0, sizeof(callbacks));
- callbacks.private_data = NULL;
- callbacks.allow_input = 1;
- callbacks.allow_output = 1;
-
/* Find a free client, start from 1 as the MPU expects to use 0 */
- client = snd_seq_create_kernel_client(card, index, &callbacks);
+ client = snd_seq_create_kernel_client(card, index);
if (client < 0)
return client;