24 #include <linux/slab.h>
25 #include <linux/module.h>
68 if (port->
addr.port == num) {
88 num = pinfo->
addr.port;
92 if (port->
addr.port < num)
94 if (port->
addr.port == num) {
143 new_port = kzalloc(
sizeof(*new_port),
GFP_KERNEL);
145 snd_printd(
"malloc failed for registering client port\n");
150 new_port->
addr.port = -1;
154 port_subs_info_init(&new_port->
c_src);
155 port_subs_info_init(&new_port->
c_dest);
157 num = port >= 0 ? port : 0;
161 if (p->
addr.port > num)
164 num = p->
addr.port + 1;
169 new_port->
addr.port = num;
226 aport = get_client_port(&subs->
info.dest, &c);
229 aport = get_client_port(&subs->
info.sender, &c);
232 unsubscribe_port(client, port, grp, &subs->
info, 0);
250 unsubscribe_port(c, aport, agrp, &subs->
info, 1);
290 if (p->addr.port == port) {
301 return port_delete(client, found);
322 INIT_LIST_HEAD(&deleted_list);
331 port_delete(client, port);
427 if (!try_module_get(port->
owner))
433 module_put(port->
owner);
460 module_put(port->
owner);
499 int err, src_called = 0;
523 if (match_subs_info(info, &s->
info))
527 if (match_subs_info(info, &s->
info))
532 if ((err = subscribe_port(src_client, src_port, src, info,
537 if ((err = subscribe_port(dest_client, dest_port, dest, info,
557 unsubscribe_port(src_client, src_port, src, info,
585 if (match_subs_info(info, &subs->
info)) {
593 unsubscribe_port(src_client, src_port, src, info,
595 unsubscribe_port(dest_client, dest_port, dest, info,
617 if (addr_match(dest_addr, &s->
info.dest)) {
635 int cap,
int type,
int midi_channels,
636 int midi_voices,
char *portname)
642 memset(&portinfo, 0,
sizeof(portinfo));
644 strlcpy(portinfo.
name, portname ? portname :
"Unamed port",
645 sizeof(portinfo.
name));
659 ret = portinfo.
addr.port;
675 memset(&portinfo, 0,
sizeof(portinfo));